\(y_{i,j,k} = \mu + \tau_{i} + \beta_{j} + \epsilon _{i,j,k}\)
Where \(\mu\): Population Mean;
\(\tau_{i}\): Treatment effect for
population i;
\(\beta_{j}\) : Block effect for jth
block; \(\epsilon_{i,j,k}\): Error
corresponding to ith population, jth block,and kth number of
replication.
library(GAD)
Obs<- c(73, 68, 74, 71, 67,
73, 67, 75, 72, 70,
75, 68, 78, 73, 68,
73, 71, 75, 75, 69)
Chemical<- c(rep(1:4, each = 5))
Chemical
## [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4
Bolts<- c(rep(seq(1,5),4))
Bolts
## [1] 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
#Q1
Chemical<- as.fixed(Chemical)
Bolts<- as.fixed(Bolts)
model<- lm(Obs~Chemical+Bolts)
model
##
## Call:
## lm(formula = Obs ~ Chemical + Bolts)
##
## Coefficients:
## (Intercept) Chemical2 Chemical3 Chemical4 Bolts2 Bolts3
## 72.35 0.80 1.80 2.00 -5.00 2.00
## Bolts4 Bolts5
## -0.75 -5.00
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
## 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
\(y_{i,j} = \mu + \tau_{i} + \epsilon _{i,j}\)
Where \(\mu\): Population Mean;
\(\tau_{i}\): Treatment effect for
population i;
\(\epsilon_{i,j}\): Error corresponding
to ith population and jth block.
Considering the block effect as insignificant.
model2<- lm(Obs~Chemical)
gad(model2)
## Analysis of Variance Table
##
## Response: Obs
## Df Sum Sq Mean Sq F value Pr(>F)
## Chemical 3 12.95 4.3167 0.3863 0.7644
## Residual 16 178.80 11.1750
In question 1, we considered the block effect significant while performing ANOVA, we got the p-value less than 0.15. Therefore, we rejected null hypothesis, so there is significant difference in chemicals.
Whereas in question 2, we ignored the block effect while performing ANOVA, we got the p-value higher than 0.15. Therefore, we failed to reject the null hypothesis, so there is no significant chemical difference.
We believe that the Bolt of cloth represents significant nuisance variability, as it has forced us to change the judgment to reject the null hypothesis with blocking and failed to reject it without blocking.
library(GAD)
Obs<- c(73, 68, 74, 71, 67,
73, 67, 75, 72, 70,
75, 68, 78, 73, 68,
73, 71, 75, 75, 69)
?rep
Chemical<- c(rep(1:4, each = 5))
Chemical
Bolts<- c(rep(seq(1,5),4))
Bolts
#Q1
Chemical<- as.fixed(Chemical)
Bolts<- as.fixed(Bolts)
model<- lm(Obs~Chemical+Bolts)
model
gad(model)
#Q2
model2<- lm(Obs~Chemical)
gad(model2)