library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
temp <- c(0.15,0.18,0.20,0.25)
depth <- rep(temp,9)
feed <- c(rep(rep(0.2,4),3),rep(rep(0.25,4),3),rep(rep(0.3,4),3))
block <- rep(seq(1,3),3)
obs <- c(74,79,82,99,
64,68,88,104,
60,73,92,96,
92,98,99,104,
86,104,108,110,
88,88,95,99,
99,104,108,114,
98,99,110,111,
102,95,99,107)
data <- data.frame(feed,depth,block,obs)
data$feed <- as.fixed(data$feed)
data$depth <- as.fixed(data$depth)
For this experiment, now, since we need to consider a block that represents the replicates, the linear model equation is the following:
\[ y_{ijkl}=\alpha_i+\beta_j+\gamma_k+\alpha\beta_{ij}+\epsilon_{ijkl} \]
And the hypothesis that we are testing is still the following:
\[ Ho: \alpha\beta_{ij} = 0\\ Ha: \alpha\beta_{ij} \neq 0 \]
Therefore, to correct analyze the data, letโs perform the following:
model.aov.5.34 <- aov(obs~depth+feed+block+depth*feed,data=data)
summary(model.aov.5.34)
## Df Sum Sq Mean Sq F value Pr(>F)
## depth 3 2125.1 708.4 25.195 1.88e-07 ***
## feed 2 3160.5 1580.2 56.205 1.40e-09 ***
## block 1 42.7 42.7 1.518 0.2304
## depth:feed 6 557.1 92.8 3.302 0.0171 *
## Residuals 23 646.7 28.1
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the p-values shown above, we can see that blocking the repetitions is not as significant as we expect.
The Mean Square Error from the Residuals has gone from 28.7 to 28.1, which represents a reduction of 2% in the mean squared error.