Flipped Assignment 18 Nested Factors

author: “Peter Keller”

date: “2023-11-30”

Model Equation:

\[ \gamma_{ijk}= \mu + \alpha_i+\beta_{j(i)}+\epsilon_{ijk} \]

Hypothesis:

\[ \text{Factor-Process} \\H_0:\mu_{i1} =\mu_{i2} =\mu_{i3} \\H_a: \text{at least one } \mu_i \text{ differs} \\ \text{Factor-Batch} \\H_0:\mu_{j(i)1} =\mu_{j(i)2} =\mu_{j(i)3}=\mu_{j(i)4} \\H_a: \text{at least one } \mu_{j(i)} \text{ differs} \]

process<-rep(c(rep(1,4),rep(2,4),rep(3,4)),3)
batch<-rep(c(1,2,3,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)
table<-data.frame(process,batch,Obs)
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.
process<-as.fixed(process)
batch<-as.random(batch)
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

As shown above, the process factor is not significant and has a p value of .28. We fail to reject the null hypothesis. The batch, however, is significant within the process and is significant with a value of .000000547. We reject the null hypothesis.