Problem 4.3
A chemist wishes to test the effect of four chemical agents on the strength of a particular type of cloth. Because there might be variability from one bolt to another, the chemist decides to use a randomized block design, with the bolts of cloth considered as blocks. She selects five bolts and applies all four chemicals in random order to each bolt. The resulting tensile strengths follow. Analyze the data from this experiment (use alpha 0.05) and draw appropriate conclusions
Entering the data
chemical1<-c(73,68,74,71,67)
chemical2<-c(73,67,75,72,70)
chemical3<-c(75,68,78,73,68)
chemical4<-c(73,71,75,75,69)
dat1<-data.frame(chemical1,chemical2,chemical3,chemical4)
dat2<-stack(dat1)
library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
dat2$ind<-as.fixed(dat2$ind)
dat2$Bolt<-c(rep(seq(1,5),4))
dat2$Bolt<-as.fixed(dat2$Bolt)
Linear model effects equation
Y_{i,j} = \mu + \tau _{i} + \beta _{j} + \epsilon _{i,j}
Hypothesis Testing
Null Hypothesis: \tau _{i} = 0
Alternate Hypothesis: \tau _{i} \neq 0
model<-lm(values~ind+Bolt,dat2)
gad(model)
## Analysis of Variance Table
##
## Response: values
## Df Sum Sq Mean Sq F value Pr(>F)
## ind 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
Conclusion
Since the p value (0.1211) is greater than alpha (0.05) therefore we fail to reject our null hypothesis and conclude that there is no significant effect of different chemical agents on the mean strength.
Problem 4.16
Assuming that chemical types and bolts are fixed,estimate the model parameters i and j in Problem 4.3.
We can calculate means in excel as it will be easier to that over there.
grand_mean<-(71.75)
Average of Chemical Types
mean_chemical1<-(70.6)
mean_chemical2<-(71.4)
mean_chemical3<-(72.4)
mean_chemical4<-(72.6)
Average of Bolt Types
mean_bolt1<-(73.5)
mean_bolt2<-(68.5)
mean_bolt3<-(75.5)
mean_bolt4<-(72.75)
mean_bolt5<-(68.5)
Calculating τi
τ1<-(mean_chemical1-grand_mean)
τ2<-(mean_chemical2-grand_mean)
τ3<-(mean_chemical3-grand_mean)
τ4<-(mean_chemical4-grand_mean)
Calculating βj
β1<-(mean_bolt1-grand_mean)
β2<-(mean_bolt2-grand_mean)
β3<-(mean_bolt3-grand_mean)
β4<-(mean_bolt4-grand_mean)
β5<-(mean_bolt5-grand_mean)
Problem 4.22
The effect of five different ingredients (A, B, C, D, E) on the reaction time of a chemical process is being studied. Each batch of new material is only large enough to permit five runs to be made. Furthermore, each run requires approximately hours, so only five runs can be made in one day. The experimenter decides to run the experiment as a Latin square so that day and batch effects may be systematically controlled. She obtains the data that follow. Analyze the data from this experiment (use alpha 0.05) and draw conclusions.
Observations<-c(8,7,1,7,3,11,2,7,3,8,4,9,10,1,5,6,8,6,6,10,4,2,3,8,8)
Batch<-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)
Day<-c(rep(seq(1,5),5))
Ingredient<-c('A','B','D','C','E','C','E','A','D','B','B','A','C','E','D','D','C','E','B','A','E','D','B','A','C')
Batch<-as.factor(Batch)
Day<-as.factor(Day)
Ingredient<-as.factor(Ingredient)
dat3<-data.frame(Observations,Batch,Day,Ingredient)
Our Data is now arranged in Orthogonal Latin Square
Linear model effects equation
Y_{i,j,k} = \mu + \tau _{i} + \beta _{j} + \alpha _{k} + \epsilon _{i,j,k}
Hypothesis
Null Hypothesis: τi = 0
Alternate Hypothesis: τi≠0
aov.model<-aov(Observations~Ingredient+Batch+Day,data=dat3)
summary(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## Ingredient 4 141.44 35.36 11.309 0.000488 ***
## Batch 4 15.44 3.86 1.235 0.347618
## Day 4 12.24 3.06 0.979 0.455014
## Residuals 12 37.52 3.13
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Conclusion
From the anova test we clearly see that the p value of 0.000488 is much smaller than alpha of 0.05, therefore we reject the null hypothesis and conclude that there is significant effect of ingredients on the mean reaction time of chemical processes.