The design
In a split-plot trial, one factor is applied to large main plots and a second factor to smaller subplots inside them. The example: four nitrogen rates (N0, N60, N120, N180) on main plots, three varieties (V1, V2, V3) on subplots, four blocks, grain yield in t/ha (the sample data of the split-plot tool). Because main plots are larger and fewer, nitrogen is estimated less precisely than variety, so the two factors need different error terms:
- Error (a), the block × main-plot interaction, for blocks and the main-plot factor;
- Error (b), the residual, for the subplot factor and the interaction.
Option 1: agricolae::sp.plot
library(agricolae)
d <- read.csv("splitplot.csv") # columns Rep, Nitrogen, Variety, Yield
sp <- with(d, sp.plot(Rep, Nitrogen, Variety, Yield))
Df Sum Sq Mean Sq F value Pr(>F)
Rep 3 30.4590 10.1530 90.0781 3.362e-13 ***
Nitrogen 3 19.9757 6.6586 26.5209 8.421e-05 ***
Ea 9 2.2596 0.2511
Variety 2 5.8411 2.9205 25.9111 1.012e-06 ***
Nitrogen:Variety 6 2.7113 0.4519 4.0091 0.006394 **
Eb 24 2.7051 0.1127
cv(a) = 9.7 %, cv(b) = 6.5 %, Mean = 5.175833
Option 2: base R with Error()
d[] <- lapply(d, function(x) if (is.character(x)) factor(x) else x)
m <- aov(Yield ~ Nitrogen * Variety + Error(Rep / Nitrogen), data = d)
summary(m)
This gives the same F values for nitrogen (26.52 with 3 and 9 df), variety (25.91 with 2 and 24 df) and the interaction (4.01 with 6 and 24 df), split into strata. It does not test blocks.
Comparing the means
Each comparison must use the error term of its factor. With agricolae, pass the right error mean square and degrees of freedom:
with(d, HSD.test(Yield, Nitrogen, DFerror = sp$gl.a, MSerror = sp$Ea, console = TRUE)) # main plots: Error (a)
with(d, HSD.test(Yield, Variety, DFerror = sp$gl.b, MSerror = sp$Eb, console = TRUE)) # subplots: Error (b)
| Nitrogen (Error a, 9 df) | Mean | Group |
|---|---|---|
| N120 | 5.78 | a |
| N180 | 5.69 | ab |
| N60 | 5.07 | b |
| N0 | 4.17 | c |
| Variety (Error b, 24 df) | Mean | Group |
|---|---|---|
| V2 | 5.57 | a |
| V3 | 5.24 | b |
| V1 | 4.72 | c |
Tukey's HSD is 0.639 for nitrogen means and 0.296 for variety means. The interaction is significant (p = 0.006), so the varieties are best compared within each nitrogen rate, again with Error (b):
for (n in unique(d$Nitrogen)) {
s <- d[d$Nitrogen == n, ]
print(HSD.test(s$Yield, s$Variety, DFerror = sp$gl.b, MSerror = sp$Eb)$groups)
}
| Variety | N0 | N60 | N120 | N180 |
|---|---|---|---|---|
| V1 | 3.98 b | 4.82 a | 5.33 b | 4.76 b |
| V2 | 4.67 a | 5.31 a | 6.09 a | 6.21 a |
| V3 | 3.85 b | 5.07 a | 5.93 a | 6.11 a |
V2 is the best or equal-best variety at every rate. V1 yields significantly less than V2 at N0, N120 and N180, and at N60 the three varieties do not differ. Comparing nitrogen rates within one variety needs a combined error term with approximate degrees of freedom and is not shown here.
What goes wrong with an ordinary factorial ANOVA
Analysing the same data as a two-factor RCBD, aov(Yield ~ Rep + Nitrogen * Variety), pools both error terms into one residual (MS = 0.150 with 33 df). Nitrogen is then tested against an error that is too small: F rises from 26.52 to 44.26. Here nitrogen is significant either way, but with fewer blocks or smaller effects the factorial analysis can declare a main-plot effect significant when the correct split-plot analysis does not.
The same without code
The split-plot tool runs this whole analysis in your browser: both error terms, blocks tested against Error (a), CV(a) and CV(b), Tukey, LSD or Duncan letters for main plots, subplots and subplots within each main plot, an interaction plot, and an R script that reproduces everything. It runs free on its sample data; your own data need FieldTrialHub Pro. All values match R; see the validation page.
Reference: Gomez, K. A., & Gomez, A. A. (1984). Statistical procedures for agricultural research (2nd ed.). John Wiley & Sons.