4.3

\(H_0:\tau_i=0\)

\(H_1:\tau_i\neq0\)

chemical<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5))
chemical <- as.factor(chemical)
bolt<-c(seq(1,5),seq(1,5),seq(1,5),seq(1,5))
bolt <- as.factor(bolt)
ob <- c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
dat <- data.frame(ob,chemical,bolt)
model <- aov(ob~chemical+bolt,data = dat)
summary(model)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## chemical     3  12.95    4.32   2.376    0.121    
## bolt         4 157.00   39.25  21.606 2.06e-05 ***
## Residuals   12  21.80    1.82                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

As evident from these results we can’t reject the null hypothesis with \(\alpha=0.05\) therefore we can’t say that there is a significant difference between these chemicals.

4.16

Linear equation model:

\(X_{ij}=\mu+\tau_i+\beta{j}+\epsilon_{ij}\)

In the question 4.3, \(\tau_i\) is the effect of the treatments (chemical).

\(\mu=\dfrac{35}{20},\tau_1=\dfrac{-23}{20},\tau_2=\dfrac{-7}{20},\tau_3=\dfrac{13}{20}\) \(\tau_4=\dfrac{17}{20},\beta_1=\dfrac{35}{20},\beta_2=\dfrac{-65}{20},\beta_3=\dfrac{75}{20},\) \(\beta_4=\dfrac{20}{20},\beta_5=\dfrac{-65}{20}\)

4.22

\(H_0:\tau_i=0\)

\(H_1:\tau_i\neq0\)

Batch <- c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
day <- c(seq(1,5),seq(1,5),seq(1,5),seq(1,5),seq(1,5))
ingredient <- 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)
Batch <- as.factor(Batch)
day <- as.factor(day)
ingredient <- as.factor(ingredient)
data <- data.frame(obs,Batch,day,ingredient)
model <- aov(obs~Batch+day+ingredient,data = data)
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    
## ingredient   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

As the resulted p-value for our factor of interest (ingredient) is 0.000488 and lower than our specified \(\alpha\) (0.05), we reject the null hypothesis and conclude that the choice of ingredient has a significant effect on the reaction time.