Skip to content

Commit

Permalink
running targets
Browse files Browse the repository at this point in the history
  • Loading branch information
nxskok committed Feb 7, 2024
1 parent 3c9e024 commit 3d27719
Show file tree
Hide file tree
Showing 242 changed files with 4,638 additions and 4,649 deletions.
Binary file modified _freeze/ancova/figure-beamer/ancova-plot-1.pdf
Binary file not shown.
Binary file modified _freeze/ancova/figure-beamer/unnamed-chunk-4-1.pdf
Binary file not shown.
Binary file modified _freeze/ancova/figure-beamer/unnamed-chunk-6-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-10-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-14-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-18-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-19-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-21-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-22-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-26-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-30-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/bAnova-31-1.pdf
Binary file not shown.
Binary file modified _freeze/anova/figure-beamer/tartuffo-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/asphalt-14-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/asphalt-15-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/asphalt-17-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/asphalt-39-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/asphalt-41-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/asphalt-5-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/asphalt-9-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/unnamed-chunk-1-1.pdf
Binary file not shown.
Binary file modified _freeze/asphalt/figure-beamer/unnamed-chunk-2-1.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion _freeze/bootstrap/execute-results/html.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _freeze/bootstrap/execute-results/tex.json

Large diffs are not rendered by default.

Binary file modified _freeze/bootstrap/figure-beamer/bootstrap-18-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap/figure-beamer/bootstrap-23-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap/figure-beamer/bootstrap-28-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap/figure-beamer/bootstrap-3-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap/figure-beamer/bootstrap-8-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap/figure-beamer/bootstrap-9-1.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions _freeze/bootstrap_R/execute-results/html.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/bootstrap_R/execute-results/tex.json

Large diffs are not rendered by default.

Binary file modified _freeze/bootstrap_R/figure-beamer/bootstrap-R-10-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap_R/figure-beamer/bootstrap-R-12-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap_R/figure-beamer/bootstrap-R-15-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap_R/figure-beamer/bootstrap-R-17-1.pdf
Binary file not shown.
Binary file modified _freeze/bootstrap_R/figure-beamer/bootstrap-R-19-1.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions _freeze/choosing/execute-results/html.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/choosing/execute-results/tex.json

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions _freeze/dates_and_times/execute-results/html.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/dates_and_times/execute-results/tex.json

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions _freeze/dip/execute-results/html.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/dip/execute-results/tex.json

Large diffs are not rendered by default.

Binary file modified _freeze/discrim/figure-beamer/bDiscrim-24-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/bDiscrim-25-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/bDiscrim-32-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/bDiscrim-33-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/bDiscrim-34-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/bDiscrim-45-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/bDiscrim-8-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/graziani-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/piacentini-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/unnamed-chunk-1-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-beamer/unnamed-chunk-5-1.pdf
Binary file not shown.
Binary file modified _freeze/discrim/figure-revealjs/bDiscrim-24-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/discrim/figure-revealjs/bDiscrim-32-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/discrim/figure-revealjs/bDiscrim-34-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/discrim/figure-revealjs/graziani-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/discrim/figure-revealjs/unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion _freeze/factor/execute-results/html.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _freeze/factor/execute-results/tex.json

Large diffs are not rendered by default.

Binary file modified _freeze/factor/figure-beamer/bFactor-11-1.pdf
Binary file not shown.
Binary file modified _freeze/factor/figure-beamer/bFactor-13-1.pdf
Binary file not shown.
Binary file modified _freeze/factor/figure-beamer/bFactor-3-1.pdf
Binary file not shown.
Binary file modified _freeze/factor/figure-beamer/bem-biplot-1.pdf
Binary file not shown.
Binary file modified _freeze/factor/figure-beamer/bem-scree-two-1.pdf
Binary file not shown.
Binary file modified _freeze/factor/figure-beamer/biplot-two-ag-1.pdf
Binary file not shown.
Binary file modified _freeze/factor/figure-beamer/genoa-1.pdf
Binary file not shown.
4 changes: 1 addition & 3 deletions _freeze/functions/execute-results/html.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions _freeze/inference_5a/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"hash": "8f9406f10bd58457eddca218b9249988",
"result": {
"markdown": "---\ntitle: \"Mood's Median Test\"\neditor: \n markdown: \n wrap: 72\n---\n\n\n## Packages\n\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(tidyverse)\nlibrary(smmr)\n```\n:::\n\n\n## Two-sample test: What to do if normality fails\n\n- If normality fails (for one or both of the groups), what do we do\n then?\n- Again, can compare medians: use the thought process of the sign\n test, which does not depend on normality and is not damaged by\n outliers.\n- A suitable test called Mood's median test.\n- Before we get to that, a diversion.\n\n## The chi-squared test for independence\n\nSuppose we want to know whether people are in favour of having daylight\nsavings time all year round. We ask 20 males and 20 females whether they\neach agree with having DST all year round (\"yes\") or not (\"no\"). Some\nrandomly chosen data:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nmy_url <- \"http://ritsokiguess.site/datafiles/dst.txt\"\ndst <- read_delim(my_url,\" \")\ndst %>% slice_sample(n = 10)\n```\n\n::: {.cell-output-display}\n`````{=html}\n<div data-pagedtable=\"false\">\n <script data-pagedtable-source type=\"application/json\">\n{\"columns\":[{\"label\":[\"gender\"],\"name\":[1],\"type\":[\"chr\"],\"align\":[\"left\"]},{\"label\":[\"agree\"],\"name\":[2],\"type\":[\"chr\"],\"align\":[\"left\"]}],\"data\":[{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"female\",\"2\":\"yes\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"female\",\"2\":\"yes\"},{\"1\":\"female\",\"2\":\"no\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"male\",\"2\":\"yes\"}],\"options\":{\"columns\":{\"min\":{},\"max\":[10]},\"rows\":{\"min\":[10],\"max\":[10]},\"pages\":{}}}\n </script>\n</div>\n`````\n:::\n:::\n\n\n## ... continued\n\nCount up individuals in each category combination, and arrange in\ncontingency table:\n\n\n::: {.cell}\n\n```{.r .cell-code}\ntab <- with(dst, table(gender, agree))\ntab\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n agree\ngender no yes\n female 11 9\n male 3 17\n```\n:::\n:::\n\n\n- Most of the males say \"yes\", but the females are about evenly split.\n- Looks like males more likely to say \"yes\", ie. an association\n between gender and agreement.\n- Test an $H_0$ of \"no association\" (\"independence\") vs. alternative\n that there is really some association.\n- Done with `chisq.test`.\n\n## ...And finally\n\n\n::: {.cell}\n\n```{.r .cell-code}\nchisq.test(tab, correct=FALSE)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n\n\tPearson's Chi-squared test\n\ndata: tab\nX-squared = 7.033, df = 1, p-value = 0.008002\n```\n:::\n:::\n\n\n- Reject null hypothesis of no association (P-value 0.008)\n- therefore there is a difference in rates of agreement between (all)\n males and females (or that gender and agreement are associated).\n- This calculation gives same answers as you would get by hand.\n (Omitting `correct = FALSE` uses \"Yates correction\".\n\n## Mood's median test\n\n- Earlier: compare medians of two groups.\n- Sign test: count number of values above and below something (there,\n hypothesized median).\n- Mood's median test:\n - Find \"grand median\" of all the data, regardless of group\n - Count data values in each group above/below grand median.\n - Make contingency table of group vs. above/below.\n - Test for association.\n- If group medians equal, each group should have about half its\n observations above/below grand median. If not, one group will be\n mostly above grand median and other below.\n\n## Mood's median test for reading data\n\n\n::: {.cell}\n\n:::\n\n\n- Find overall median score:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nkids %>% summarize(med=median(score)) %>% pull(med) -> m\nm\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] 47\n```\n:::\n:::\n\n\n- Make table of above/below vs. group:\n\n\n::: {.cell}\n\n```{.r .cell-code}\ntab <- with(kids, table(group, score > m))\ntab\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n \ngroup FALSE TRUE\n c 15 8\n t 7 14\n```\n:::\n:::\n\n\n- Treatment group scores mostly above median, control group scores\n mostly below, as expected.\n\n## The test\n\n- Do chi-squared test:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nchisq.test(tab, correct=F)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n\n\tPearson's Chi-squared test\n\ndata: tab\nX-squared = 4.4638, df = 1, p-value = 0.03462\n```\n:::\n:::\n\n\n- This test actually two-sided (tests for any association).\n- Here want to test that new reading method *better* (one-sided).\n- Most of treatment children above overall median, so do 1-sided test\n by halving P-value to get 0.017.\n- This way too, children do better at learning to read using the new\n method.\n\n## Or by smmr\n\n- `median_test` does the whole thing:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nmedian_test(kids,score,group)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n$grand_median\n[1] 47\n\n$table\n above\ngroup above below\n c 8 15\n t 14 7\n\n$test\n what value\n1 statistic 4.46376812\n2 df 1.00000000\n3 P-value 0.03462105\n```\n:::\n:::\n\n\n- P-value again two-sided.\n\n## Comments\n\n- P-value 0.013 for (1-sided) t-test, 0.017 for (1-sided) Mood median\n test.\n- Like the sign test, Mood's median test doesn't use the data very\n efficiently (only, is each value above or below grand median).\n- Thus, if we can justify doing *t*-test, we should do it. This is the\n case here.\n- The *t*-test will usually give smaller P-value because it uses the\n data more efficiently.\n- The time to use Mood's median test is if we are definitely unhappy\n with the normality assumption (and thus the t-test P-value is not to\n be trusted).\n",
"supporting": [
"inference_5a_files"
],
"markdown": "---\ntitle: \"Mood's Median Test\"\neditor: \n markdown: \n wrap: 72\n---\n\n\n## Packages\n\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(tidyverse)\nlibrary(smmr)\n```\n:::\n\n\n## Two-sample test: What to do if normality fails\n\n- If normality fails (for one or both of the groups), what do we do\n then?\n- Again, can compare medians: use the thought process of the sign\n test, which does not depend on normality and is not damaged by\n outliers.\n- A suitable test called Mood's median test.\n- Before we get to that, a diversion.\n\n## The chi-squared test for independence\n\nSuppose we want to know whether people are in favour of having daylight\nsavings time all year round. We ask 20 males and 20 females whether they\neach agree with having DST all year round (\"yes\") or not (\"no\"). Some\nrandomly chosen data:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nmy_url <- \"http://ritsokiguess.site/datafiles/dst.txt\"\ndst <- read_delim(my_url,\" \")\ndst %>% slice_sample(n = 10)\n```\n\n::: {.cell-output-display}\n`````{=html}\n<div data-pagedtable=\"false\">\n <script data-pagedtable-source type=\"application/json\">\n{\"columns\":[{\"label\":[\"gender\"],\"name\":[1],\"type\":[\"chr\"],\"align\":[\"left\"]},{\"label\":[\"agree\"],\"name\":[2],\"type\":[\"chr\"],\"align\":[\"left\"]}],\"data\":[{\"1\":\"female\",\"2\":\"yes\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"female\",\"2\":\"yes\"},{\"1\":\"female\",\"2\":\"no\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"female\",\"2\":\"yes\"},{\"1\":\"male\",\"2\":\"yes\"},{\"1\":\"female\",\"2\":\"no\"},{\"1\":\"female\",\"2\":\"no\"}],\"options\":{\"columns\":{\"min\":{},\"max\":[10]},\"rows\":{\"min\":[10],\"max\":[10]},\"pages\":{}}}\n </script>\n</div>\n`````\n:::\n:::\n\n\n## ... continued\n\nCount up individuals in each category combination, and arrange in\ncontingency table:\n\n\n::: {.cell}\n\n```{.r .cell-code}\ntab <- with(dst, table(gender, agree))\ntab\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n agree\ngender no yes\n female 11 9\n male 3 17\n```\n:::\n:::\n\n\n- Most of the males say \"yes\", but the females are about evenly split.\n- Looks like males more likely to say \"yes\", ie. an association\n between gender and agreement.\n- Test an $H_0$ of \"no association\" (\"independence\") vs. alternative\n that there is really some association.\n- Done with `chisq.test`.\n\n## ...And finally\n\n\n::: {.cell}\n\n```{.r .cell-code}\nchisq.test(tab, correct=FALSE)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n\n\tPearson's Chi-squared test\n\ndata: tab\nX-squared = 7.033, df = 1, p-value = 0.008002\n```\n:::\n:::\n\n\n- Reject null hypothesis of no association (P-value 0.008)\n- therefore there is a difference in rates of agreement between (all)\n males and females (or that gender and agreement are associated).\n- This calculation gives same answers as you would get by hand.\n (Omitting `correct = FALSE` uses \"Yates correction\".\n\n## Mood's median test\n\n- Earlier: compare medians of two groups.\n- Sign test: count number of values above and below something (there,\n hypothesized median).\n- Mood's median test:\n - Find \"grand median\" of all the data, regardless of group\n - Count data values in each group above/below grand median.\n - Make contingency table of group vs. above/below.\n - Test for association.\n- If group medians equal, each group should have about half its\n observations above/below grand median. If not, one group will be\n mostly above grand median and other below.\n\n## Mood's median test for reading data\n\n\n::: {.cell}\n\n:::\n\n\n- Find overall median score:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nkids %>% summarize(med=median(score)) %>% pull(med) -> m\nm\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] 47\n```\n:::\n:::\n\n\n- Make table of above/below vs. group:\n\n\n::: {.cell}\n\n```{.r .cell-code}\ntab <- with(kids, table(group, score > m))\ntab\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n \ngroup FALSE TRUE\n c 15 8\n t 7 14\n```\n:::\n:::\n\n\n- Treatment group scores mostly above median, control group scores\n mostly below, as expected.\n\n## The test\n\n- Do chi-squared test:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nchisq.test(tab, correct=F)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n\n\tPearson's Chi-squared test\n\ndata: tab\nX-squared = 4.4638, df = 1, p-value = 0.03462\n```\n:::\n:::\n\n\n- This test actually two-sided (tests for any association).\n- Here want to test that new reading method *better* (one-sided).\n- Most of treatment children above overall median, so do 1-sided test\n by halving P-value to get 0.017.\n- This way too, children do better at learning to read using the new\n method.\n\n## Or by smmr\n\n- `median_test` does the whole thing:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nmedian_test(kids,score,group)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n$grand_median\n[1] 47\n\n$table\n above\ngroup above below\n c 8 15\n t 14 7\n\n$test\n what value\n1 statistic 4.46376812\n2 df 1.00000000\n3 P-value 0.03462105\n```\n:::\n:::\n\n\n- P-value again two-sided.\n\n## Comments\n\n- P-value 0.013 for (1-sided) t-test, 0.017 for (1-sided) Mood median\n test.\n- Like the sign test, Mood's median test doesn't use the data very\n efficiently (only, is each value above or below grand median).\n- Thus, if we can justify doing *t*-test, we should do it. This is the\n case here.\n- The *t*-test will usually give smaller P-value because it uses the\n data more efficiently.\n- The time to use Mood's median test is if we are definitely unhappy\n with the normality assumption (and thus the t-test P-value is not to\n be trusted).\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
Expand Down
Loading

0 comments on commit 3d27719

Please sign in to comment.