As we know it has fixed effects hence we can write our hypothesis as,
Null Hypothesis:
\(H_o : \tau_i=0\) for all i
Alternative Hypothesis:
\(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))
Day <- c(rep(seq(1,5),5))
ingred <- 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")
obs <- 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)
dat <- cbind(batch,Day,ingred,obs)
dat <- as.data.frame(dat)
dat$batch <- as.fixed(dat$batch)
dat$Day <- as.fixed(dat$Day)
dat$ingred <- as.fixed(dat$ingred)
model3 <- lm(dat$obs~dat$batch+dat$Day+dat$ingred,data = dat)
anova(model3)
## Analysis of Variance Table
##
## Response: dat$obs
## Df Sum Sq Mean Sq F value Pr(>F)
## dat$batch 4 15.44 3.860 1.2345 0.3476182
## dat$Day 4 12.24 3.060 0.9787 0.4550143
## dat$ingred 4 141.44 35.360 11.3092 0.0004877 ***
## Residuals 12 37.52 3.127
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Answer 1) Yes it is a valid latin square because it has 2 sources of nuisance variability. And we can also see that each latin letter occur only once in each column and each row which is an necessary condition for a valid latin square
Answer 2) Following is the model equation
\(y_{ijk} = \mu + \tau_i + \beta_j + \alpha_k + \epsilon_{ijk}\)
Answer 3) As we can see from anova test on Latin Square model , it gave p value of 0.3476 , which is greater than 0.05 , which means we fail to reject Null Hypothesis and state there is no difference among batch for given known nuisance variability of Days and ingredients. As we blocked both of them.
And of the p value of Day = 0.455 > 0.05 , it shows that blocking this was a good decision as it is significant if checked with confidence interval of 95%
For P value of ingredients = 0.0004877 which is smaller than 0.05 , which shows that nuisance variability given by this was not significant. But we still blocked it as it was a known source of nuisance. We know statisticians do not go backward in their calculations, even if it was not significant we will live with it , as we already blocked it. The main reason of blocking in first place was, as it was also a source of known nuisance variability