library(GAD)
chemical is a factor (4 levels), bolts is observed (n=4).
chemical<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))
chemical
## [1] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4
obs<-c(73,68,74,71,
73,67,75,72,
75,68,78,73,
73,71,75,75)
obs
## [1] 73 68 74 71 73 67 75 72 75 68 78 73 73 71 75 75
chemical<-as.fixed(chemical)
#“as.fixed(chemical)” was used for blocking within the code.
model<-lm(obs~chemical)
gad(model)
## $anova
## Analysis of Variance Table
##
## Response: obs
## 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
solution is a factor (4 levels), bolts is observed (n=4) and sequencing is in 4s.
solution<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))
solution
## [1] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4
bolts<-c(seq(1,4),seq(1,4),seq(1,4),seq(1,4))
bolts
## [1] 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
obs<-c(73,68,74,71,
73,67,75,72,
75,68,78,73,
73,71,75,75)
obs
## [1] 73 68 74 71 73 67 75 72 75 68 78 73 73 71 75 75
solution<-as.random(solution)
bolts<-as.random(bolts)
model<-lm(obs~solution+bolts)
gad(model)
## $anova
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## solution 3 14.187 4.729 2.7349 0.1057217
## bolts 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
#“as.random(bolts)” was used for without blocking within the code.
chemical<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))
chemical
obs<-c(73,68,74,71,
73,67,75,72,
75,68,78,73,
73,71,75,75)
obs
chemical<-as.fixed(chemical)
model<-lm(obs~chemical)
gad(model)
solution<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))
solution
bolts<-c(seq(1,4),seq(1,4),seq(1,4),seq(1,4))
bolts
obs<-c(73,68,74,71,
73,67,75,72,
75,68,78,73,
73,71,75,75)
obs
solution<-as.random(solution)
bolts<-as.random(bolts)
model<-lm(obs~solution+bolts)
gad(model)
Comment :
P value is 0.105<0.15 hence we reject \(H_O\).