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.

type1 <-    c(8,    7   ,1,7    ,3)
type2 <-    c(11,2  ,7  ,3  ,8)
type3 <-    c(4,    9,10,1  ,5)
type4   <- c(6, 8   ,6  ,6,10)
type5 <-    c(4,    2,  3   ,8,8)
letters <- 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')
dafr <- data.frame(type1,type2,type3,type4,type5)
dafr <- stack(dafr)
days <- c(rep(seq(1,5),5))
dafr$letters <- as.factor(letters)
dafr$days <- as.factor(days)

1.

Is this a valid Latin Square? (explain)

Yes, because each Letter appears once per row and once per column.

2.

Write the model equation

\(X_{ij}=\mu+\tau_i+\beta_j+\alpha_i+\epsilon_{ij}\)

Where beta and alpha represent our error explained by blocks.

3.

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)

We will perform a ANOVA test to see if our mean reaction time changes based on these factors. Our null hypothesis is that the mean between each reaction type is equal, and our alternative hypothesis is that there is a difference bewtween the means.

Ho: \(\mu_1=\mu_2=\mu_3=\mu_4=\mu_5\)

Ha: \(\mu_i\neq\mu\) for some i

summary(aov(values~ind+days+letters,dafr))
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## ind          4  15.44    3.86   1.235 0.347618    
## days         4  12.24    3.06   0.979 0.455014    
## letters      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

Our conclusions based on this test, is that the Batch (shown as ind) is not significant to the reaction time, they Days the expirement was conducted on was not significnt to the reaction time, and the ingredients are statistically significant to the reaction time.

The ingredients used is the only factor to have a pvalue below our alpha of .05.

All Code Used:

type1 <-    c(8,    7   ,1,7    ,3)
type2 <-    c(11,2  ,7  ,3  ,8)
type3 <-    c(4,    9,10,1  ,5)
type4   <- c(6, 8   ,6  ,6,10)
type5 <-    c(4,    2,  3   ,8,8)
letters <- 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')
dafr <- data.frame(type1,type2,type3,type4,type5)
dafr <- stack(dafr)
days <- c(rep(seq(1,5),5))
dafr$letters <- as.factor(letters)
dafr$days <- as.factor(days)

summary(aov(values~ind+days+letters,dafr))