\[ H_0: \mu_1= \mu_2 = \mu_3 =\mu_4 = \mu \\H_a: \text{At least one }\mu_i\text{ differs from }\mu \\ \alpha = .15 \] This null Hypothesis that is being tested is that the means of the populations are the same and the alternative hypothesis is that at least one population’s mean differs from the others. This can also be written in the following way using the information that \(\mu-\mu_i=\tau_i\) \[ H_0: \tau_i= 0 \text{ for all }i \\H_a: \tau_i\neq 0\text{ for some }i \] The following is the linear effects model. Beta is the linear effect that is coming from the block.
\[ y_{ij}=\mu+\tau_i+\beta_j+\epsilon_{ij} \]
#install.packages('GAD')
library(GAD)
obs<-c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
chem<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5))
bolts<-c(rep(seq(1,5),4))
chem<-as.fixed(chem)
bolts<-as.fixed(bolts)
model<-lm(obs~chem+bolts)
gad(model)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## chem 3 12.95 4.317 2.3761 0.1211
## bolts 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
The p value is 0.12 which is smaller that the aplha=0.15 so we reject Null Hypothesis. We have evidence to suggest that the means of the populations are significantly different. We can also verify that our assumption that the block is significant is correct because the p value for that is .00002.
Assume now that she didn’t block on Bolt and rather ran the experiment at a completely randomized design on random pieces of cloth, resulting in the following data. Analyze the data from this experiment (use α=0.15) and draw appropriate conclusions. Be sure to state the linear effects model and hypotheses being tested.
\[ H_0: \mu_1= \mu_2 = \mu_3 =\mu_4 = \mu \\H_a: \text{At least one }\mu_i\text{ differs from }\mu \\ \alpha = .15 \] This null Hypothesis that is being tested is that the means of the populations are the same and the alternative hypothesis is that at least one population’s mean differs from the others. This can also be written in the following way using the information that \(\mu-\mu_i=\tau_i\) \[ H_0: \tau_i= 0 \text{ for all }i \\H_a: \tau_i\neq 0\text{ for some }i \] The following is the linear effects model.
\[ y_{i}=\mu+\tau_i+\epsilon_{i} \]
library(GAD)
obs1<-c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
model1<-lm(obs1~chem)
gad(model1)
## Analysis of Variance Table
##
## Response: obs1
## Df Sum Sq Mean Sq F value Pr(>F)
## chem 3 12.95 4.3167 0.3863 0.7644
## Residual 16 178.80 11.1750
The P value .764 is larger than alpha=0.15 so, we fail to reject Null Hypothesis. We do not have evidence to suggest that the means of the two populations are different.
#Problem 3 The key distinction between the findings in the two experiments (questions 1 and 2) lies in the choice of experimental design. In the first experiment, a randomized block design accounting for variability between cloth bolts led to the rejection of the null hypothesis, indicating a significant effect of chemical agents. This implies that the cloth bolts represent a significant source of variability. Conversely, the second experiment, using a completely randomized design without considering bolt variability, failed to reject the null hypothesis, suggesting that variability between bolts was not significant in this setup. This underscores the vital role of experimental design in addressing nuisance variability and impacting hypothesis testing outcomes.
#install.packages('GAD')
library(GAD)
obs<-c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
chem<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5))
bolts<-c(rep(seq(1,5),4))
chem<-as.fixed(chem)
bolts<-as.fixed(bolts)
model<-lm(obs~chem+bolts)
gad(model)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## chem 3 12.95 4.317 2.3761 0.1211
## bolts 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
#The p is smaller that the aplha=0.15 so we reject Null Hypothesis
#question 2
library(GAD)
obs1<-c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
model1<-lm(obs1~chem)
gad(model1)
## Analysis of Variance Table
##
## Response: obs1
## Df Sum Sq Mean Sq F value Pr(>F)
## chem 3 12.95 4.3167 0.3863 0.7644
## Residual 16 178.80 11.1750
# The P is larger than alpha=0.15 so, we fail to reject Null Hypothesis