Nested Design

Model equation

\[ y_{ijk} = \mu +\tau_i + \beta_{j(i)} + \gamma_{k(ij)} + \epsilon_{(ijk)l}\\ \tau_i = Effect \; of \;process\\ \beta_{j(i)} = Effect \; of \; batches\\ \gamma_{k(ij)} = Effect \; of \; k^{th} \; batch \; with \; the \; i^{th} \; process\\ \epsilon_{(ijk)l} = Error \; term \; NID(0,\sigma^2) \]

Hypothesis to be tested

\[ H_0: \mu_{\gamma_{k(ij)}}=0 \] \[ H_0: \mu_{\gamma_{k(ij)}} \not= 0 \]

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.
values<- 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)
batch <- as.random(rep(seq(1,4),9))
obervations<- as.fixed(c(rep(1,12),rep(2,12),rep(3,12)))
process<-as.fixed(rep(c(rep(1,4),rep(2,4),rep(3,4)),3))
dat<-data.frame(process,batch,obervations,values)
model<- lm(values~process+batch%in%process)
gad(model)
## Analysis of Variance Table
## 
## Response: values
##               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)

With an alpha of 0.05, we reject the null hypothesis. The batch within the process have a significant effect with an P-value of 5.477e-07.

In addition, with the residual plot we can see that the variance is not constant because we have varying spread. However, the data points looks fairly normal distributed.