As this is a nested design the model equation is as follows:
\(y_{ijk}=\mu+\alpha_i+\beta_{j(i)}+\epsilon_{ijk}\)
Also the hypothesis is as follows:
\(H_0: \alpha_i=0\) and \(H_0:\sigma^2_\beta=0\)
\(H_1: \alpha_i\ne0\) and \(H_1:\sigma^2_\beta\ne0\)
process <- c(rep(1,4),rep(2,4),rep(3,4),rep(1,4),rep(2,4),rep(3,4),rep(1,4),rep(2,4),rep(3,4))
batch <- rep(seq(1,4),9)
obs <- c(25,19,15,15,19,23,18,35,14,35,38,25,30,28,17,16,17,24,21,27,15,21,54,29,26,20,14,13,14,21,17,25,20,24,50,33)
library(GAD)
process <- as.fixed(process)
batch <- as.random(batch)
data <- data.frame(process,batch,obs)
model <- lm(obs~process+batch%in%process)
gad(model)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## process 2 676.06 338.03 1.4643 0.2815
## process:batch 9 2077.58 230.84 12.2031 5.477e-07 ***
## Residual 24 454.00 18.92
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model)
summary(model)
##
## Call:
## lm(formula = obs ~ process + batch %in% process)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.333 -2.083 -0.500 2.333 8.333
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 27.000 2.511 10.752 1.17e-10 ***
## process2 -10.333 3.551 -2.910 0.00768 **
## process3 -10.667 3.551 -3.004 0.00615 **
## process1:batch2 -4.667 3.551 -1.314 0.20123
## process2:batch2 6.000 3.551 1.690 0.10406
## process3:batch2 10.333 3.551 2.910 0.00768 **
## process1:batch3 -11.667 3.551 -3.285 0.00312 **
## process2:batch3 2.000 3.551 0.563 0.57853
## process3:batch3 31.000 3.551 8.729 6.51e-09 ***
## process1:batch4 -12.333 3.551 -3.473 0.00197 **
## process2:batch4 12.333 3.551 3.473 0.00197 **
## process3:batch4 12.667 3.551 3.567 0.00156 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.349 on 24 degrees of freedom
## Multiple R-squared: 0.8585, Adjusted R-squared: 0.7936
## F-statistic: 13.23 on 11 and 24 DF, p-value: 1.177e-07
based on these results the effect of batches nested within the processes is significant (\(\alpha=5.477e-07\)), but the effect of the process was not significant (\(\alpha=0.05\)).