The above experiment has 2 blocks (nuisence variables) and none of the occur more than once in each row and each column.
The model equation is :
\[ X_{ijk} = \mu + \tau_{i} + \beta_{j} + \gamma_{k} + \epsilon_{ijk} \]
where
\(\mu\) = Grand mean
\(\tau_{i}\) = Effect of treatment for ‘i’
\(\beta_{j}\) = Block effect 1
\(\gamma_{k}\) = Block effect 2
\(\epsilon_{ijk}\) = random error
reading and manipulating the data:
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)
batch = c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
batch = as.factor(batch)
day = c(rep(seq(1,5),5))
day = as.factor(day)
ingredients = c(1,2,4,3,5,3,5,1,4,2,2,1,3,5,4,4,3,5,2,1,5,4,2,1,3)
ingredients = as.factor(ingredients)
dat = data.frame(obs,batch,day,ingredients)
Analysing the data:
model = aov(obs ~ batch + day + ingredients, data = dat)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## batch 4 15.44 3.86 1.235 0.347618
## day 4 12.24 3.06 0.979 0.455014
## 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
From the analysis we can see that the p value of ingredients is 0.000488 < 0.05( \(\alpha\)). So, we reject the null hypothesis and conclude that five different ingredients have significant effect on the reaction time of the chemical process being studied.
Source code:
#reading and manipulating the data:
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)
batch = c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
batch = as.factor(batch)
day = c(rep(seq(1,5),5))
day = as.factor(day)
ingredients = c(1,2,4,3,5,3,5,1,4,2,2,1,3,5,4,4,3,5,2,1,5,4,2,1,3)
ingredients = as.factor(ingredients)
dat = data.frame(obs,batch,day,ingredients)
#Analysing the data:
model = aov(obs ~ batch + day + ingredients, data = dat)
summary(model)
#From the analysis we can see that the p value of ingredients is 0.000488 < 0.05( $\alpha$). So, we reject the null hypothesis and conclude that five different ingredients have significant effect on the reaction time of the chemical process being studied.