\[ H_0: \mu_{1} = \mu_{2} = \mu_{3} = \mu_{4} \]
\[ H_a = Atleast\:one\: \mu_{i} \:differ \]
\[ Y_{i,j} = \mu + \tau_{i} + \beta_{j} + \epsilon_{i,j} \]
Where,
\(\mu\) = Grand mean
\(\tau_{i}\) = fixed effect of chemical \(i\)
\(\beta_{i}\) = random effect of bolt \(j\)
\(\epsilon_{i,j}\) = random error
library(GAD)
observations <- c(73,68,74,71,73,67,75,72,75,68,78,73,73,71,75,75)
chemical <- c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))
bolt <- c(rep(seq(1,4),4))
chemical <- as.fixed(chemical)
bolt <- as.random(bolt)
analysis <- lm(observations~chemical+bolt)
gad(analysis)
## $anova
## Analysis of Variance Table
##
## Response: observations
## Df Sum Sq Mean Sq F value Pr(>F)
## chemical 3 14.187 4.729 2.7349 0.1057217
## bolt 3 104.188 34.729 20.0843 0.0002515 ***
## Residuals 9 15.563 1.729
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Conclusion:-
Since the p value is less than 0.15, we reject the null hypothesis.
\[ H_0: \mu_{1} = \mu_{2} = \mu_{3} = \mu_{4} \]
Alternative hypothesis:-
\[ H_a = Atleast\:one\: \mu_{i} \:differ \]
\[ Y_{i,j} = \mu + \tau_{i} + \epsilon_{i,j} \]
Where,
\(\mu\) = Grand mean
\(\tau_{i}\) = fixed effect of chemical \(i\)
\(\epsilon_{i,j}\) = random error
analysis2 <- lm(observations~chemical)
gad(analysis2)
## $anova
## Analysis of Variance Table
##
## Response: observations
## Df Sum Sq Mean Sq F value Pr(>F)
## chemical 3 14.187 4.7292 0.4739 0.7062
## Residuals 12 119.750 9.9792
Conclusion:-
Since the p value is greater than 0.15, we fail to reject the null hypothesis.
When bolts were treated as blocks, the block effect was highly significant, indicating large variability between bolts. Accounting for this nuisance variability reduced the residual error substantially and allowed detection of significant differences among chemicals (p value = 0.106 < 0.15).
When blocking was removed, the bolt variability was absorbed into the error term, inflating error variance and making the chemical effect appear non-significant (p-value= 0.706).
So that, the bolt of cloth represents a significant source of nuisance variability, and blocking was clearly beneficial in this experiment.
#Question 1
library(GAD)
observations <- c(73,68,74,71,73,67,75,72,75,68,78,73,73,71,75,75)
chemical <- c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))
bolt <- c(rep(seq(1,4),4))
chemical <- as.fixed(chemical)
bolt <- as.random(bolt)
analysis <- lm(observations~chemical+bolt)
gad(analysis)
#Question 2:-
# Here we have the same values in the table
analysis2 <- lm(observations~chemical)
gad(analysis2)