Latin Squares
The effect of five different ingredients (A, B, C, D, E) on the reaction time of a chemical process is being studied. Each batch of new material is only large enough to permit five runs to be made. Furthermore, each run requires approximately 1.5 hours, so only five runs can be made in one day. The experimenter decides to run the experiment as a Latin square so that day and batch effects may be systematically controlled. She obtains the data that follow.
| Day 1 | Day 2 | Day 3 | Day 4 | Day 5 | |
|---|---|---|---|---|---|
| Batch 1 | A=8 | B=7 | D=1 | C=7 | E=8 |
| Batch 2 | C=11 | E=2 | A=7 | D=3 | B=8 |
| Batch 3 | B=4 | A=9 | C=10 | E=1 | D=5 |
| Batch 4 | D=6 | C=8 | E=6 | B=6 | A=10 |
| Batch 5 | E=4 | D=2 | B=3 | A=8 | C=8 |
Is this a valid Latin Square? (explain)
Yes, this is a valid Latin Square. Each row AND column both contain each treatment (denoted by Latin letters) only once. This provides orthogonality to the experiment. Also, it appears that the samples are taken in a pre-determined random order (not just sequentially, A,B,C,D,E)
Write the model equation:
\[x_{ijk} = \mu\ +\ \tau_i\ +\ \beta_j\ +\ \alpha_k\ +\ \epsilon_{ijk}\] Where \[x=an\ individual\ observation\ \mu=mean\ of\ all\ observations\] \[\tau=effect\ of\ the\ treatment,\ \beta=effect\ of\ first\ block\ factor\] \[\alpha=effect\ of\ second\ block\ factor\ and\ \epsilon=\ error\]
Analyze the data from this experiment (use α=0.05) and draw conclusions about the factor of interest. (Note: Use aov() instead of gad() for Latin Square Designs, be sure all blocks are recognized as factors)
#set up the data
observation <- 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))
treatment <- 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(observation~treatment+batch+day)
summary(anova1)
## Df Sum Sq Mean Sq F value Pr(>F)
## treatment 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
Based on the results of the anova table, treatment has a p-value of .000488 so at the \(\alpha = .05\) level we reject the null and conclude that treatment has an effect on observation. The p-values for batch and day, .3476 and .455 respectively, would indicate that these blocks do not have an impact on the observation at the alpha = .05 level
anova_treat <- aov(observation~treatment)
summary(anova_treat)
## Df Sum Sq Mean Sq F value Pr(>F)
## treatment 4 141.4 35.36 10.85 7.67e-05 ***
## Residuals 20 65.2 3.26
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova_batch <- aov(observation~batch)
summary(anova_batch)
## Df Sum Sq Mean Sq F value Pr(>F)
## batch 4 15.44 3.86 0.404 0.804
## Residuals 20 191.20 9.56
anova_day <- aov(observation~day)
summary(anova_day)
## Df Sum Sq Mean Sq F value Pr(>F)
## day 4 12.24 3.06 0.315 0.865
## Residuals 20 194.40 9.72
Based on the results of the anova tests above, we can reaffirm our conclusions that treatment has an effect on observations while day and batch do not