Skip to content

Commit 1fdf925

Browse files
committed
expt with repaginating
1 parent 39a72f1 commit 1fdf925

File tree

154 files changed

+37985
-3798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+37985
-3798
lines changed

_output.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
bookdown::gitbook:
22
includes:
33
in_header: hypothesis.html
4+
css: style.css
45
config:
56
toc:
67
collapse: section
78
before: |
89
<li><a href="./">Just enough R</a></li>
910
download: ["pdf", "epub"]
10-
split_by: rmd
11+
split_by: section
1112

1213
bookdown::pdf_book:
1314
includes:

airquality-r-values.csv

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"","Ozone","Solar.R","Wind","Temp","Month","Day"
2+
"Ozone",0,0.00197241942881554,1.2981615782337e-11,0,0.561787014869315,1
3+
"Solar.R",0.000179310857165049,0,1,0.00751772924010297,1,0.561787014869315
4+
"Wind",9.27258270166931e-13,0.495955206815127,0,3.43407631220316e-08,0.247105980658337,1
5+
"Temp",0,0.000751772924010297,2.6415971632332e-09,0,7.23144291114863e-07,0.645698579067462
6+
"Month",0.0776000963996033,0.366353350873138,0.0274562200731485,6.02620242595719e-08,0,1
7+
"Day",0.887942543669527,0.0702233768586644,0.738746589753025,0.107616429844577,0.92218998575754,0

anova-cookbook.Rmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ output:
88
knitr::opts_chunk$set(echo = TRUE, collapse=TRUE, cache=TRUE)
99
library(tidyverse)
1010
library(pander)
11+
1112
library(lmerTest)
1213
```
1314

1415

1516

16-
1717
# Anova 'Cookbook'
1818

1919
This section is intended as a shortcut to running Anova for a variety of common types of model. If you want to understand more about what you are doing, read the section on [principles of Anova in R](anova.html).
@@ -25,9 +25,8 @@ This section is intended as a shortcut to running Anova for a variety of common
2525

2626
### Factorial anova, no bigger than 2x2
2727

28-
```{r}
2928

30-
```
29+
TODO
3130

3231

3332
### Factorial anova, where one factor has > 2 levels.
@@ -54,6 +53,9 @@ eysenck %>%
5453
```
5554

5655

56+
[Visual inspection of the data (see Figure X) suggested that older adults recalled more words than younger adults, and that this difference was greatest for the intention, imagery, and adjective conditions. Recall peformance was worst in the counting and rhyming conditions.]{.apa-example}
57+
58+
5759
Or alternatively if we wanted to provde a better summary of the distribution of the raw data we could use a boxplot:
5860

5961
```{r, fig.cap="Boxplot for recall in older and young adults, by condition."}

correlations.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ mycorrelations
7272
One thing to be aware of is that by default `corr.test()` produces p values that are adjusted for multiple comparisons in the top right hand triangle (i.e. above the diagonal). If you want the uncorrected values use the values below the diagonal (or pass `adjust=FALSE` when calling the function).
7373

7474

75-
## Making correlation tables for publication
75+
## Tables for publication
7676

7777

78-
### `apaTables`
78+
### Using `apaTables` {-}
7979
If you want to produce output tables for publication the `apaTables` package might be useful. This block saves an APA formatted correlation table to an [external Word document like this](Table1_APA.doc).
8080

8181
```{r}
@@ -84,7 +84,7 @@ apa.cor.table(airquality, filename="Table1_APA.doc", show.conf.interval=F)
8484
```
8585

8686

87-
### By hand
87+
### By hand {-}
8888

8989
If you're not bothered about strict APA foramt, you might still want to extract the *r* and *p* values as dataframes which can then be saved to a csv and opened in excel, or converted to a table by some other means.
9090

@@ -108,7 +108,7 @@ mycorrelations$ci %>%
108108
```
109109

110110

111-
## Other types of correlation
111+
## Other correlation methods
112112

113113
By default `corr.test` produces Pearson correlations, but You can pass the `method` argument `psych::corr.test()`:
114114

docs/a-real-example.html

Lines changed: 459 additions & 0 deletions
Large diffs are not rendered by default.

docs/a-warning.html

Lines changed: 354 additions & 0 deletions
Large diffs are not rendered by default.

docs/anova-cookbook.html

Lines changed: 130 additions & 512 deletions
Large diffs are not rendered by default.

docs/anova-cookbook.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ output:
88

99

1010

11-
1211
# Anova 'Cookbook'
1312

1413
This section is intended as a shortcut to running Anova for a variety of common types of model. If you want to understand more about what you are doing, read the section on [principles of Anova in R](anova.html).
@@ -21,6 +20,7 @@ This section is intended as a shortcut to running Anova for a variety of common
2120
### Factorial anova, no bigger than 2x2
2221

2322

23+
TODO
2424

2525

2626
### Factorial anova, where one factor has > 2 levels.
@@ -40,7 +40,10 @@ eysenck %>%
4040
ylab("Recall (95% CI)") + xlab("")
4141
```
4242

43-
<img src="anova-cookbook_files/figure-html/unnamed-chunk-4-1.png" width="672" />
43+
<img src="anova-cookbook_files/figure-html/unnamed-chunk-3-1.png" width="672" />
44+
45+
46+
[Visual inspection of the data (see Figure X) suggested that older adults recalled more words than younger adults, and that this difference was greatest for the intention, imagery, and adjective conditions. Recall peformance was worst in the counting and rhyming conditions.]{.apa-example}
4447

4548

4649
Or alternatively if we wanted to provde a better summary of the distribution of the raw data we could use a boxplot:
@@ -54,8 +57,8 @@ eysenck %>%
5457
```
5558

5659
<div class="figure">
57-
<img src="anova-cookbook_files/figure-html/unnamed-chunk-5-1.png" alt="Boxplot for recall in older and young adults, by condition." width="672" />
58-
<p class="caption">(\#fig:unnamed-chunk-5)Boxplot for recall in older and young adults, by condition.</p>
60+
<img src="anova-cookbook_files/figure-html/unnamed-chunk-4-1.png" alt="Boxplot for recall in older and young adults, by condition." width="672" />
61+
<p class="caption">(\#fig:unnamed-chunk-4)Boxplot for recall in older and young adults, by condition.</p>
5962
</div>
6063

6164

@@ -110,8 +113,8 @@ car::qqPlot(eysenck.model)
110113
```
111114

112115
<div class="figure">
113-
<img src="anova-cookbook_files/figure-html/unnamed-chunk-8-1.png" alt="QQ plot to assess normality of model residuals" width="672" />
114-
<p class="caption">(\#fig:unnamed-chunk-8)QQ plot to assess normality of model residuals</p>
116+
<img src="anova-cookbook_files/figure-html/unnamed-chunk-7-1.png" alt="QQ plot to assess normality of model residuals" width="672" />
117+
<p class="caption">(\#fig:unnamed-chunk-7)QQ plot to assess normality of model residuals</p>
115118
</div>
116119

117120

@@ -131,8 +134,8 @@ data_frame(
131134
```
132135

133136
<div class="figure">
134-
<img src="anova-cookbook_files/figure-html/unnamed-chunk-9-1.png" alt="Residual vs fitted (spread vs. level) plot to check homogeneity of variance." width="672" />
135-
<p class="caption">(\#fig:unnamed-chunk-9)Residual vs fitted (spread vs. level) plot to check homogeneity of variance.</p>
137+
<img src="anova-cookbook_files/figure-html/unnamed-chunk-8-1.png" alt="Residual vs fitted (spread vs. level) plot to check homogeneity of variance." width="672" />
138+
<p class="caption">(\#fig:unnamed-chunk-8)Residual vs fitted (spread vs. level) plot to check homogeneity of variance.</p>
136139
</div>
137140

138141

@@ -315,7 +318,7 @@ lme4::sleepstudy %>%
315318
geom_label(aes(y=450, x=9, label="imagine how bad\nyou feel by this point"), color="red")
316319
```
317320

318-
<img src="anova-cookbook_files/figure-html/unnamed-chunk-13-1.png" width="672" />
321+
<img src="anova-cookbook_files/figure-html/unnamed-chunk-12-1.png" width="672" />
319322

320323

321324
If we want to test whether there are significant differences in RTs between `Days`, we could fit something very similar to a traditional repeat measures Anova using the `lme4::lmer()` function, and obtain an Anova table for the model using the special `lmerTest::anova()` function:
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)