Model Equation \[y_{ijk} = \mu+\alpha_{i}+\beta_{j\left( i \right)}+ \epsilon_{ijk}\]

Hypothesis: Null Hypothesis ; \[\beta_{j\left(i \right)} = 0\]

Alternative Hypothesis: \[\beta_{j\left(i \right)} \neq 0\]

Batch<-rep(c(rep(1,3),rep(2,3),rep(3,3),rep(4,3)),3)
observations<-c(25,30,26,19,28,20,15,17,14,15,16,13,19,17,14,23,24,21,18,21,17,35,27,25,14,15,20,35,21,24,38,54,50,25,29,33)
library(GAD)
## Warning: package 'GAD' was built under R version 4.1.3
## Loading required package: matrixStats
## Warning: package 'matrixStats' was built under R version 4.1.3
## Loading required package: R.methodsS3
## Warning: package 'R.methodsS3' was built under R version 4.1.3
## R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
process<-c(rep(1,12),rep(2,12),rep(3,12))
Batch<-as.random(Batch)
process<-as.fixed(process)
model<-lm(observations~process+Batch%in%process)
gad(model)
## Analysis of Variance Table
## 
## Response: observations
##               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

Comment: So We have suffifient evidence to reject the null hypothesis at alpha=0.05 level that the nested within the factor is not effecting the model. so here we took process has primary factor and batch as random factor by looking the P-value from GAD model , we got the factor with in factor as significant.