\(H_a: \tau_i \neq 0\) for some \(i\)
batch <- c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
days <- c(rep(seq(1,5),5))
ingredients <- c("A","B","D","C","E","C","E","A","D","B","B","A","C","E","D","D","C","E","B","A","E","D","B","A","C")
obs2 <- c(8,7,1,7,3,11,2,7,3,8,4,9,10,1,5,6,8,6,6,10,4,2,3,8,8)
dat2 <- cbind(batch,days,ingredients,obs2)
dat2 <- as.data.frame(dat2)
dat2$batch <- as.fixed(dat2$batch)
dat2$Day <- as.fixed(dat2$days)
dat2$ingredients <- as.fixed(dat2$ingredients)
model2 <- lm(dat2$obs2~dat2$batch+dat2$days+dat2$ingredients,data = dat2)
summary(aov(model2))
## Df Sum Sq Mean Sq F value Pr(>F)
## dat2$batch 4 15.44 3.86 1.235 0.347618
## dat2$days 4 12.24 3.06 0.979 0.455014
## dat2$ingredients 4 141.44 35.36 11.309 0.000488 ***
## Residuals 12 37.52 3.13
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+ The p-value is 0.347618 which is greater than our alpha, 0.05. Therefore I fail to reject the null hypothesis. This means that there is no difference among batch for given known nuisance variability of days and ingredients.