Question 1
Test Hypothesis
Ho: \(\mu_1 = \mu_2 = \mu_3 = \mu_4\) - Null Hypothesis
Ha: At least 1 differs - Alternative Hypothesis
\(\alpha\) = 0.15
Linear Effects
\(y_{ij} = \mu + \tau_i + \beta_i + \epsilon_{ij}\)
#install.packages("GAD")
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))
bolt<-c(seq(1,5),seq(1,5),seq(1,5),seq(1,5))
obs<-c(73, 68, 74, 71, 67, 73, 67, 75, 72, 70, 75, 68, 78, 73, 68, 73, 71, 75, 75, 69)
chemical<-as.fixed(chemical)
bolt<-as.fixed(bolt)
model<-lm(obs~chemical+bolt)
gad(model)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## chemical 3 12.95 4.317 2.3761 0.1211
## bolt 4 157.00 39.250 21.6055 2.059e-05 ***
## Residual 12 21.80 1.817
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the result fo is 2.3761 with a corresponding p-value of 0.1211 is significantly lesser than \(\alpha\) = 0.15. Therefore we reject Ho that the means are equal, and conclude that none of the means are different.
Question 2
Test Hypothesis
Ho: \(\mu_1 = \mu_2 = \mu_3 = \mu_4\) - Null Hypothesis
Ha: At least 1 differs - Alternative Hypothesis
\(\alpha\) = 0.15
Linear Effects
\(y_{ij} = \mu + \tau_i + \epsilon_{ij}\)
chemical2<-c(rep(1,5), rep(2,5), rep(3,5), rep(4,5))
replications<-c(73, 68, 74, 71, 67, 73, 67, 75, 72, 70, 75, 68, 78, 73, 68, 73, 71, 75, 75, 69)
chemical2<-as.fixed(chemical2)
model2<-lm(replications~chemical2)
gad(model2)
## Analysis of Variance Table
##
## Response: replications
## Df Sum Sq Mean Sq F value Pr(>F)
## chemical2 3 12.95 4.3167 0.3863 0.7644
## Residual 16 178.80 11.1750
From the result fo is 0.3863 with a corresponding p-value of 0.7644 is significantly greater than \(\alpha\) = 0.15. Therefore we fail to reject Ho that the means are equal, and conclude that none of the means are different.
Question 3
After running both experiments, we can conclude that the nuisance factor is significant in experiment 1 because we used blocking which has an effect on the mean square error by reducing it and increasing the F statistic value. However in experiment 2 when there was no blocking effect the mean square error is high with a low F statistic value
library(GAD)
chemical<-c(rep(1,5), rep(2,5), rep(3,5), rep(4,5))
bolt<-c(seq(1,5),seq(1,5),seq(1,5),seq(1,5))
obs<-c(73, 68, 74, 71, 67, 73, 67, 75, 72, 70, 75, 68, 78, 73, 68, 73, 71, 75, 75, 69)
chemical<-as.fixed(chemical)
bolt<-as.fixed(bolt)
model<-lm(obs~chemical+bolt)
gad(model)
chemical2<-c(rep(1,5), rep(2,5), rep(3,5), rep(4,5))
replications<-c(73, 68, 74, 71, 67, 73, 67, 75, 72, 70, 75, 68, 78, 73, 68, 73, 71, 75, 75, 69)
chemical2<-as.fixed(chemical2)
model2<-lm(replications~chemical2)
gad(model2)