obs<-c(73,68,74,71,67,
73,67,75,72,70,
75,68,78,73,68,
73,71,75,75,69)
qqnorm(obs[1:5])
qqnorm(obs[6:10])
qqnorm(obs[11:15])
qqnorm(obs[16:20])
chem1<-obs[1:5]
chem2<-obs[6:10]
chem3<-obs[11:15]
chem4<-obs[16:20]
boxplot(chem1,chem2,chem3,chem4, main="Boxplot for 4 Chemical Agents", xlab="Chemical",ylab="tensile strength",names =c("1","2","3","4"))
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))
bolt<-as.fixed(bolt)
chemical<-as.fixed(chemical)
model<-lm(obs~chemical+bolt) #lm = linear model
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
i = the chemical agent used in the experiment
obs<-c(73,68,74,71,67,
73,67,75,72,70,
75,68,78,73,68,
73,71,75,75,69)
chem1<-obs[1:5]
chem2<-obs[6:10]
chem3<-obs[11:15]
chem4<-obs[16:20]
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))
bolt<-as.fixed(bolt)
chemical<-as.fixed(chemical)
model<-lm(obs~chemical) #lm = linear model
gad(model)
## 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