d) Ho: tau_i = 0

Ha: tau_i != 0

#null hypothesis does not affect the strength of the cement. #alternate hypothesis affects the strength of the cement.

meana <- mean(c(3129,3000,2865,2890))
meanb <- mean(c(3200,3300,2975,3150))
meanc <- mean(c(2800,2900,2985,3050))
meand <- mean(c(2600,2700,2600,2765))

#meana=2971 #meanb=3156.25 #meanc+2933.75 #meand=2666.25

grandmean <- mean(c(meana,meanb,meanc,meand))

#grandmean=2931.8

sse_a <- sum((a-meana)^2)
sse_b <- sum((b-meanb)^2)
sse_c <- sum((c-meanc)^2)
sse_d <- sum((d-meand)^2)
sse <- sum(sse_a,sse_b,sse_c,sse_d)
MSE <- sse/12

#sse_a=43103 #sse_b=5548.75 #sse_c=35168.75 #sse_d=19668.75 #sse=153908.3 #mse=12825.69

sstr_a <- sum((meana-grandmean)^2*4)
sstr_b <- sum((meanb-grandmean)^2*4)
sstr_c <- sum((meanc-grandmean)^2*4)
sstr_d <- sum((meand-grandmean)^2*4)
sstr <- sum(sstr_a,sstr_b,sstr_c,sstr_d)
mstr <- sstr/3

#sstr_a=6142.64 #sstr_b=201488.7 #sstr_c=15.01 #sstr_d=282093.76 #sstr=489740.18 #mstr=163246.7

F <- mstr/MSE
qf(0.95,3,12)
## [1] 3.490295

#3.49 is the critical value less than the f statistic 12.73 we reject the null hypothesis #therefore we can say that the mixing of techniques affect the strength of the cement

a <- c(3129,3000,2865,2890)
b <- c(3200,3300,2975,3150)
c <- c(2800,2900,2985,3050)
d <- c(2600,2700,2600,2765)
meana <- mean(c(3129,3000,2865,2890))
meanb <- mean(c(3200,3300,2975,3150))
meanc <- mean(c(2800,2900,2985,3050))
meand <- mean(c(2600,2700,2600,2765))
grandmean <- mean(c(meana,meanb,meanc,meand))
sse_a <- sum((a-meana)^2)
sse_b <- sum((b-meanb)^2)
sse_c <- sum((c-meanc)^2)
sse_d <- sum((d-meand)^2)
sse <- sum(sse_a,sse_b,sse_c,sse_d)
MSE <- sse/12
sstr_a <- sum((meana-grandmean)^2*4)
sstr_b <- sum((meanb-grandmean)^2*4)
sstr_c <- sum((meanc-grandmean)^2*4)
sstr_d <- sum((meand-grandmean)^2*4)
sstr <- sum(sstr_a,sstr_b,sstr_c,sstr_d)
mstr <- sstr/3
F <- mstr/MSE
qf(0.95,3,12)