
Split-Plot Design with Two Factors in the Sub-Plot
Source:R/design_split_plot.R
anova_spd_c_main_ab_sub.RdSplit-plot design where the main plots carry factor C and the sub-plots carry the factorial combination of two factors (A x B). C is tested against Error(a); A, B, A x B and every interaction with C against Error(b).
Usage
anova_spd_c_main_ab_sub(
data,
response,
main_plot,
sub_factor1,
sub_factor2,
replication,
posthoc = "lsd",
alpha = 0.05,
verbose = TRUE
)Arguments
- data
Data frame containing the experimental data.
- response
Name of the response variable.
- main_plot
Main-plot factor (C).
- sub_factor1
First sub-plot factor (A).
- sub_factor2
Second sub-plot factor (B).
- replication
Name of the replication column.
- posthoc
Method for the letters (default
"lsd").- alpha
Significance level. Default 0.05.
- verbose
Logical. If TRUE (default), prints the report.
Value
An object of class aridagri_spd_cab; see
anova_spd_ab_main for the components.
Examples
data <- expand.grid(rep = 1:3, irrigation = c("I1", "I2", "I3"),
variety = c("V1", "V2"),
nitrogen = c("N1", "N2", "N3", "N4"))
set.seed(4)
data$yield <- rnorm(nrow(data), 1200, 80)
res <- anova_spd_c_main_ab_sub(data, response = "yield",
main_plot = "irrigation",
sub_factor1 = "variety",
sub_factor2 = "nitrogen",
replication = "rep", verbose = FALSE)
res$anova_table
#> Df Sum Sq Mean Sq F value Pr(>F)
#> rep 2 54.61507 27.30753 0.004381521 0.9956328
#> irrigation 2 14472.46046 7236.23023 1.161060321 0.4003081
#> Error(a) 4 24929.73052 6232.43263 NA NA
#> variety 1 3954.51513 3954.51513 0.621092119 0.4350673
#> nitrogen 3 25498.37894 8499.45965 1.334916476 0.2758600
#> irrigation:variety 2 15359.07639 7679.53820 1.206140449 0.3095070
#> irrigation:nitrogen 6 6739.98293 1123.33049 0.176429142 0.9817802
#> variety:nitrogen 3 8110.32613 2703.44204 0.424599854 0.7363593
#> irrigation:variety:nitrogen 6 9890.70026 1648.45004 0.258903885 0.9528143
#> Error(b) 42 267415.46114 6367.03479 NA NA