4.3

Ho=µ1-µ2=0

Ha=µ1-µ2 not equal to 0

dat<-c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
chemical<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5))
chemical<-as.fixed(chemical)
bolt<-c(rep(seq(1,5),4))
bolt<-as.fixed(bolt)
model<-lm(dat~chemical+bolt)
gad(model)

Here we can see that the p value is greater than 0.05 i.e. alpha hence we failed to reject the null hypothesis

4.16

τ1<-mean(73,68,74,71,67)-mean(dat)
τ2<-mean(73,67,75,72,70)-mean(dat)
τ3<-mean(75,68,78,73,68)-mean(dat)
τ4<-mean(73,71,75,75,69)-mean(dat)
ß1<-mean(73,73,75,73)-mean(dat)
ß2<-mean(68,67,68,71)-mean(dat)
ß3<-mean(74,75,78,75)-mean(dat)
ß4<-mean(71,72,73,75)-mean(dat)
ß5<-mean(67,70,68,69)-mean(dat)

4.22

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)
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")
ingredient<-as.factor(ingredient)
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)
aov.model<-aov(obs~batch+day+ingredient)
summary(aov.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 P is 0.000488 which is lower than alpha hence we fail to reject the null hpothesis