This is a valid Latin Square. Every ingredient (A, B, C, D, E) occurs exactly once per Batch and exactly once per Day.
Latin Square model equation:\[x_{ijk} = \mu + \tau_{i} + \beta_{j}+\alpha_{k}+\epsilon_{ijk}\]where
\(\mu\)=Grand Mean
\(\tau_{i}\)= Effects for treatment
\(\beta_{j}\)= Block Effect 1
\(\alpha_{k}\)= Block Effect 2
\(\epsilon_{ijk}\)= Random Error
Hypothesis: \[H_0:\ \mu_A = \mu_B = \mu_C = \mu_D= \mu_E \]\[ H_1:\ \text{At least one } \mu_i \text{ differs from the others}\]
reaction <- 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)
day<-as.factor(c(1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5))
batch<-as.factor(c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5))
ingredient<-as.factor(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"))
anova1 <- aov(reaction ~ ingredient + batch + day)
summary(anova1)
## Df Sum Sq Mean Sq F value Pr(>F)
## ingredient 4 141.44 35.36 11.309 0.000488 ***
## batch 4 15.44 3.86 1.235 0.347618
## day 4 12.24 3.06 0.979 0.455014
## Residuals 12 37.52 3.13
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Since the p value of 0.000488 is less than 0.05, therefore reject H0. There is significant evidence to conclude that at least one ingredient has a different effect on the mean reaction time. The p value of batch and day are 0.347618 and 0.455014 both are greater than 0.05, which indicate that these blocks do not have an significant impact on the observation.