Skip to content

Commit

Permalink
add split-split repeated data
Browse files Browse the repository at this point in the history
  • Loading branch information
jpiaskowski committed Oct 15, 2024
1 parent d3ba367 commit f4b7bdc
Show file tree
Hide file tree
Showing 5 changed files with 376 additions and 66 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
.RData
.Ruserdata
.DS_Store

/.quarto/
/_site/
docs/
docs/
site_libs/
24 changes: 10 additions & 14 deletions chapters/repeated-measures.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -373,24 +373,20 @@ Add a link for further exploring emmeans and contrast statements.
Recall, we have evaluated the split-split experiment design in [**Chapter 5**](split-plot-design.qmd), where we had a one factor in main-plot, other in subplot and the third factor in sub-subplot. In this example we will be adding a repeated measures statement.

```{r}
agridat::caribbean.maize
phos <- read.csv(here::here("data", "split_split_repeated.csv"))
```

```{r}
library(agridat)
data("durban.splitplot")
data("brandle.rape")
data1 <- brandle.rape
table(data1$gen, data1$loc)
```
| | |
|-------------|---------------------------------|
| plot | experimental unit |
| block | replication unit |
| Ptrt | Main plot, 2 levels |
| Inoc | Split plot, 2 levels |
| Cv | Split-split plot, 5 levels
| time | time points for data collection |
| P_leaf | leaf phosphorous content |

```{r}
data("hunter.corn")
data2 <- hunter.corn

table(data2$nitro, data2$loc, data2$year)
```

4. **Factorial design repeated measures**

Expand Down
241 changes: 241 additions & 0 deletions data/split_split_repeated.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
"plot","bloc","Ptrt","Inoc","Cv","time","P_leaf"
1,1,"high","none","LOUISE","PT1",3153.56
1,1,"high","none","LOUISE","PT2",2330.62
1,1,"high","none","LOUISE","PT3",246.94
2,1,"high","none","BlancaG","PT1",3015.97
2,1,"high","none","BlancaG","PT2",2160.43
2,1,"high","none","BlancaG","PT3",116.58
3,1,"high","none","WALWORTH","PT1",2688.4
3,1,"high","none","WALWORTH","PT2",2030.94
3,1,"high","none","WALWORTH","PT3",237.22
4,1,"high","none","ALPOWA","PT1",3278.15
4,1,"high","none","ALPOWA","PT2",2212.63
4,1,"high","none","ALPOWA","PT3",149.97
5,1,"high","none","OTIS","PT1",3095.96
5,1,"high","none","OTIS","PT2",1910.25
5,1,"high","none","OTIS","PT3",99.36
6,1,"high","myco","LOUISE","PT1",3047.06
6,1,"high","myco","LOUISE","PT2",2478.69
6,1,"high","myco","LOUISE","PT3",102.24
7,1,"high","myco","WALWORTH","PT1",2653.33
7,1,"high","myco","WALWORTH","PT2",1845.89
7,1,"high","myco","WALWORTH","PT3",395.48
8,1,"high","myco","ALPOWA","PT1",3048.42
8,1,"high","myco","ALPOWA","PT2",2119.95
8,1,"high","myco","ALPOWA","PT3",121.31
9,1,"high","myco","OTIS","PT1",2812.55
9,1,"high","myco","OTIS","PT2",1794.94
9,1,"high","myco","OTIS","PT3",221.62
10,1,"high","myco","BlancaG","PT1",2836.97
10,1,"high","myco","BlancaG","PT2",2166.25
10,1,"high","myco","BlancaG","PT3",315.9
11,1,"low","myco","LOUISE","PT1",2865.5
11,1,"low","myco","LOUISE","PT2",2257.2
11,1,"low","myco","LOUISE","PT3",126.97
12,1,"low","myco","WALWORTH","PT1",2366.51
12,1,"low","myco","WALWORTH","PT2",1861.34
12,1,"low","myco","WALWORTH","PT3",108.82
13,1,"low","myco","OTIS","PT1",2946.59
13,1,"low","myco","OTIS","PT2",2056.83
13,1,"low","myco","OTIS","PT3",97.25
14,1,"low","myco","BlancaG","PT1",3101.53
14,1,"low","myco","BlancaG","PT2",2291.24
14,1,"low","myco","BlancaG","PT3",77.65
15,1,"low","myco","ALPOWA","PT1",2900.24
15,1,"low","myco","ALPOWA","PT2",1995.07
15,1,"low","myco","ALPOWA","PT3",103.65
16,1,"low","none","WALWORTH","PT1",2688.32
16,1,"low","none","WALWORTH","PT2",2100.78
16,1,"low","none","WALWORTH","PT3",136.26
17,1,"low","none","BlancaG","PT1",3300.29
17,1,"low","none","BlancaG","PT2",2191.93
17,1,"low","none","BlancaG","PT3",204.45
18,1,"low","none","OTIS","PT1",3078.67
18,1,"low","none","OTIS","PT2",2001.15
18,1,"low","none","OTIS","PT3",101.77
19,1,"low","none","ALPOWA","PT1",3095.95
19,1,"low","none","ALPOWA","PT2",1794.06
19,1,"low","none","ALPOWA","PT3",158.92
20,1,"low","none","LOUISE","PT1",2765.21
20,1,"low","none","LOUISE","PT2",2161.4
20,1,"low","none","LOUISE","PT3",96.5
21,2,"high","none","ALPOWA","PT1",3326.34
21,2,"high","none","ALPOWA","PT2",2190.51
21,2,"high","none","ALPOWA","PT3",95.49
22,2,"high","none","OTIS","PT1",3316.29
22,2,"high","none","OTIS","PT2",2206.75
22,2,"high","none","OTIS","PT3",540.44
23,2,"high","none","BlancaG","PT1",2891.15
23,2,"high","none","BlancaG","PT2",1921.73
23,2,"high","none","BlancaG","PT3",143.72
24,2,"high","none","LOUISE","PT1",2868.94
24,2,"high","none","LOUISE","PT2",2323.77
24,2,"high","none","LOUISE","PT3",287.2
25,2,"high","none","WALWORTH","PT1",2719.08
25,2,"high","none","WALWORTH","PT2",2232.77
25,2,"high","none","WALWORTH","PT3",265.17
26,2,"high","myco","BlancaG","PT1",3246.61
26,2,"high","myco","BlancaG","PT2",2223.95
26,2,"high","myco","BlancaG","PT3",206.41
27,2,"high","myco","LOUISE","PT1",3028.71
27,2,"high","myco","LOUISE","PT2",2162.3
27,2,"high","myco","LOUISE","PT3",160.93
28,2,"high","myco","OTIS","PT1",3160.97
28,2,"high","myco","OTIS","PT2",2273.23
28,2,"high","myco","OTIS","PT3",201.72
29,2,"high","myco","WALWORTH","PT1",2678.77
29,2,"high","myco","WALWORTH","PT2",2071.53
29,2,"high","myco","WALWORTH","PT3",86.53
30,2,"high","myco","ALPOWA","PT1",3341.98
30,2,"high","myco","ALPOWA","PT2",2307.88
30,2,"high","myco","ALPOWA","PT3",110.01
31,2,"low","myco","LOUISE","PT1",3058.75
31,2,"low","myco","LOUISE","PT2",2308.6
31,2,"low","myco","LOUISE","PT3",128.92
32,2,"low","myco","BlancaG","PT1",3323.79
32,2,"low","myco","BlancaG","PT2",2258.96
32,2,"low","myco","BlancaG","PT3",405.41
33,2,"low","myco","OTIS","PT1",3149.84
33,2,"low","myco","OTIS","PT2",2173.6
33,2,"low","myco","OTIS","PT3",181.31
34,2,"low","myco","WALWORTH","PT1",2730.34
34,2,"low","myco","WALWORTH","PT2",2278.6
34,2,"low","myco","WALWORTH","PT3",122.5
35,2,"low","myco","ALPOWA","PT1",2955.3
35,2,"low","myco","ALPOWA","PT2",2281.57
35,2,"low","myco","ALPOWA","PT3",204.52
36,2,"low","none","WALWORTH","PT1",2908.17
36,2,"low","none","WALWORTH","PT2",2273.94
36,2,"low","none","WALWORTH","PT3",156.49
37,2,"low","none","BlancaG","PT1",3279.12
37,2,"low","none","BlancaG","PT2",2378.4
37,2,"low","none","BlancaG","PT3",295.98
38,2,"low","none","LOUISE","PT1",3301.16
38,2,"low","none","LOUISE","PT2",2378.16
38,2,"low","none","LOUISE","PT3",80.06
39,2,"low","none","OTIS","PT1",3317.56
39,2,"low","none","OTIS","PT2",2302.96
39,2,"low","none","OTIS","PT3",343.33
40,2,"low","none","ALPOWA","PT1",3477.65
40,2,"low","none","ALPOWA","PT2",2246.01
40,2,"low","none","ALPOWA","PT3",161.36
41,3,"low","myco","BlancaG","PT1",3208.48
41,3,"low","myco","BlancaG","PT2",2183.48
41,3,"low","myco","BlancaG","PT3",168.58
42,3,"low","myco","OTIS","PT1",3156.61
42,3,"low","myco","OTIS","PT2",2223.08
42,3,"low","myco","OTIS","PT3",155.5
43,3,"low","myco","LOUISE","PT1",2952.87
43,3,"low","myco","LOUISE","PT2",2221.82
43,3,"low","myco","LOUISE","PT3",56.86
44,3,"low","myco","ALPOWA","PT1",3202.11
44,3,"low","myco","ALPOWA","PT2",2366.08
44,3,"low","myco","ALPOWA","PT3",82.06
45,3,"low","myco","WALWORTH","PT1",2804.63
45,3,"low","myco","WALWORTH","PT2",2248.44
45,3,"low","myco","WALWORTH","PT3",239.51
46,3,"low","none","WALWORTH","PT1",2736.36
46,3,"low","none","WALWORTH","PT2",2011.94
46,3,"low","none","WALWORTH","PT3",269.09
47,3,"low","none","ALPOWA","PT1",3557.58
47,3,"low","none","ALPOWA","PT2",2384.26
47,3,"low","none","ALPOWA","PT3",192.68
48,3,"low","none","LOUISE","PT1",3188.2
48,3,"low","none","LOUISE","PT2",2392.04
48,3,"low","none","LOUISE","PT3",200.88
49,3,"low","none","OTIS","PT1",3289.97
49,3,"low","none","OTIS","PT2",2278.48
49,3,"low","none","OTIS","PT3",253.58
50,3,"low","none","BlancaG","PT1",3084.52
50,3,"low","none","BlancaG","PT2",2362.27
50,3,"low","none","BlancaG","PT3",306.42
51,3,"high","none","WALWORTH","PT1",2505.9
51,3,"high","none","WALWORTH","PT2",2345.14
51,3,"high","none","WALWORTH","PT3",162.39
52,3,"high","none","OTIS","PT1",3688.84
52,3,"high","none","OTIS","PT2",2595.79
52,3,"high","none","OTIS","PT3",246.91
53,3,"high","none","BlancaG","PT1",2967.28
53,3,"high","none","BlancaG","PT2",2462.95
53,3,"high","none","BlancaG","PT3",185.6
54,3,"high","none","LOUISE","PT1",3198.21
54,3,"high","none","LOUISE","PT2",2370.36
54,3,"high","none","LOUISE","PT3",194.88
55,3,"high","none","ALPOWA","PT1",3449.64
55,3,"high","none","ALPOWA","PT2",2108.75
55,3,"high","none","ALPOWA","PT3",260.13
56,3,"high","myco","WALWORTH","PT1",2778.38
56,3,"high","myco","WALWORTH","PT2",2259.6
56,3,"high","myco","WALWORTH","PT3",170.64
57,3,"high","myco","ALPOWA","PT1",3305.73
57,3,"high","myco","ALPOWA","PT2",2409.31
57,3,"high","myco","ALPOWA","PT3",175.46
58,3,"high","myco","LOUISE","PT1",3361.35
58,3,"high","myco","LOUISE","PT2",2549.08
58,3,"high","myco","LOUISE","PT3",155.61
59,3,"high","myco","BlancaG","PT1",3482.14
59,3,"high","myco","BlancaG","PT2",2460.24
59,3,"high","myco","BlancaG","PT3",189.36
60,3,"high","myco","OTIS","PT1",3395.24
60,3,"high","myco","OTIS","PT2",2501.59
60,3,"high","myco","OTIS","PT3",216.84
61,4,"low","myco","LOUISE","PT1",3325.57
61,4,"low","myco","LOUISE","PT2",2383.62
61,4,"low","myco","LOUISE","PT3",172.33
62,4,"low","myco","BlancaG","PT1",3269.36
62,4,"low","myco","BlancaG","PT2",2636.64
62,4,"low","myco","BlancaG","PT3",119.24
63,4,"low","myco","WALWORTH","PT1",2610.58
63,4,"low","myco","WALWORTH","PT2",2109.42
63,4,"low","myco","WALWORTH","PT3",136.65
64,4,"low","myco","OTIS","PT1",3129.03
64,4,"low","myco","OTIS","PT2",2367.46
64,4,"low","myco","OTIS","PT3",160.02
65,4,"low","myco","ALPOWA","PT1",2900.38
65,4,"low","myco","ALPOWA","PT2",2266.56
65,4,"low","myco","ALPOWA","PT3",130.65
66,4,"low","none","WALWORTH","PT1",2903.09
66,4,"low","none","WALWORTH","PT2",2307.1
66,4,"low","none","WALWORTH","PT3",150.23
67,4,"low","none","OTIS","PT1",3406.82
67,4,"low","none","OTIS","PT2",2358.26
67,4,"low","none","OTIS","PT3",306.26
68,4,"low","none","LOUISE","PT1",3262.42
68,4,"low","none","LOUISE","PT2",2621.3
68,4,"low","none","LOUISE","PT3",94.33
69,4,"low","none","ALPOWA","PT1",3213.52
69,4,"low","none","ALPOWA","PT2",2287.44
69,4,"low","none","ALPOWA","PT3",210.53
70,4,"low","none","BlancaG","PT1",3299.55
70,4,"low","none","BlancaG","PT2",2667.98
70,4,"low","none","BlancaG","PT3",353.52
71,4,"high","none","OTIS","PT1",3367.55
71,4,"high","none","OTIS","PT2",2587.79
71,4,"high","none","OTIS","PT3",239.69
72,4,"high","none","WALWORTH","PT1",3195.74
72,4,"high","none","WALWORTH","PT2",2428.95
72,4,"high","none","WALWORTH","PT3",235.15
73,4,"high","none","LOUISE","PT1",3389.36
73,4,"high","none","LOUISE","PT2",2463.04
73,4,"high","none","LOUISE","PT3",192.6
74,4,"high","none","BlancaG","PT1",3296.4
74,4,"high","none","BlancaG","PT2",2499.31
74,4,"high","none","BlancaG","PT3",192.77
75,4,"high","none","ALPOWA","PT1",3163.43
75,4,"high","none","ALPOWA","PT2",2223.13
75,4,"high","none","ALPOWA","PT3",463.65
76,4,"high","myco","LOUISE","PT1",3169.92
76,4,"high","myco","LOUISE","PT2",2457.93
76,4,"high","myco","LOUISE","PT3",490.82
77,4,"high","myco","BlancaG","PT1",3327.87
77,4,"high","myco","BlancaG","PT2",2480.39
77,4,"high","myco","BlancaG","PT3",72.63
78,4,"high","myco","OTIS","PT1",3340.98
78,4,"high","myco","OTIS","PT2",2421.35
78,4,"high","myco","OTIS","PT3",371.19
79,4,"high","myco","ALPOWA","PT1",3003.66
79,4,"high","myco","ALPOWA","PT2",2399.74
79,4,"high","myco","ALPOWA","PT3",231.12
80,4,"high","myco","WALWORTH","PT1",2936.19
80,4,"high","myco","WALWORTH","PT2",2306.95
80,4,"high","myco","WALWORTH","PT3",208.94
14 changes: 14 additions & 0 deletions data/wheat_met_process.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

library(dplyr); library(tidyr)

mydata <- read.csv("data/MET_wheat.csv") |>
select(site, year, siteyear, plot, bloc, Ptrt, Inoc, Cv, PT1, PT2, PT3) |>
filter(siteyear == "Colfax2010") |>
select(-site, -year, -siteyear) |>
pivot_longer(cols = PT1:PT3, names_to = "time", values_to = "P_leaf")

write.csv(mydata, "data/split_split_repeated.csv", row.names = FALSE)

# main plot: Ptrt (phosphorus treatment)
# split-plot: Inoc (inoculation)
# split-split plot: Cv (cultivar)
Loading

0 comments on commit f4b7bdc

Please sign in to comment.