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 ( $ 0.05) and draw appropriate conclusions.
| Bolt | |||
| Chemical | 1 | 2 | 3 |
| 1 | 73 | 68 | 74 |
| 2 | 73 | 67 | 75 |
| 3 | 75 | 68 | 78 |
| 4 | 73 | 71 | 75 |
Solution
#data reading
Readings<-c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
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.
Bolt<-c(seq(1,5),seq(1,5),seq(1,5),seq(1,5))
Bolt<-as.fixed(Bolt)
Chem<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5))
Chem<-as.fixed(Chem)
#Bloc design test
model<-lm(Readings~Chem+Bolt)
gad(model)
## Analysis of Variance Table
##
## Response: Readings
## Df Sum Sq Mean Sq F value Pr(>F)
## Chem 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
P = 0.1211
Sig level = 0.05
We do not have sufficient data to reject the Null hypothesis. So we can conclude that the choice of chemical agent has any effect on given data.
Solution
τi=y¯i.−y¯..
AND
βj=y.j¯−y¯..
G.Mean<-mean(Readings)
print(G.Mean)
## [1] 71.75
chemicaltype1 <- c(73, 68, 74, 71, 67)
chemicaltype2 <- c(73, 67, 75, 72, 70)
chemicaltype3 <- c(75, 68, 78, 73, 68)
chemicaltype4 <- c(73, 71, 75, 75, 69)
#Averages
A1.<-mean(chemicaltype1)
A2.<-mean(chemicaltype2)
A3.<-mean(chemicaltype3)
A4.<-mean(chemicaltype4)
τi
τi1<-A1.-G.Mean
τi2<-A2.-G.Mean
τi3<-A3.-G.Mean
τi4<-A4.-G.Mean
cat(τi1,τi2,τi3,τi4)
## -1.15 -0.35 0.65 0.85
Boltype1<-c(73,73,75,73)
Boltype2<-c(68,67,68,71)
Boltype3<-c(74,75,78,75)
Boltype4<-c(71,72,73,75)
Boltype5<-c(67,70,68,69)
A.1<-mean(Boltype1)
A.2<-mean(Boltype2)
A.3<-mean(Boltype3)
A.4<-mean(Boltype4)
A.5<-mean(Boltype5)
βi
βi1<-A.1-G.Mean
βi2<-A.2-G.Mean
βi3<-A.3-G.Mean
βi4<-A.4-G.Mean
βi5<-A.5-G.Mean
cat(βi1,βi2,βi3,βi4,βi5)
## 1.75 -3.25 3.75 1 -3.25
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 1.5 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 α�= 0.05 and draw conclusions.
| Day | |||
| Batch | 1 | 2 | 3 |
| 1 | A=8 | B=7 | D=1 |
| 2 | C=11 | E=2 | A=7 |
| 3 | B=4 | A=9 | C=10 |
| 4 | D=6 | C=8 | E=6 |
| 5 | E=4 | D=2 | B=3 |
Solution
Readings <- 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)
Batchtype <- 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)
Elements <- c(1,2,4,3,5,3,5,1,4,2,2,1,3,5,4,4,3,5,2,1,5,4,2,1,3)
Batchtype <- as.factor(Batchtype)
Day <- c(rep(seq(1,5),5))
Day <- as.factor(Readings)
Elements <- as.factor(Elements)
Data <- data.frame(Readings, Batchtype, Day, Elements)
str(Data)
## 'data.frame': 25 obs. of 4 variables:
## $ Readings : num 8 7 1 7 3 11 2 7 3 8 ...
## $ Batchtype: Factor w/ 5 levels "1","2","3","4",..: 1 1 1 1 1 2 2 2 2 2 ...
## $ Day : Factor w/ 11 levels "1","2","3","4",..: 8 7 1 7 3 11 2 7 3 8 ...
## $ Elements : Factor w/ 5 levels "1","2","3","4",..: 1 2 4 3 5 3 5 1 4 2 ...
model<-aov(Readings~Elements +Batchtype+Day,data=Data)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## Elements 4 141.44 35.36 3.000e+30 <2e-16 ***
## Batchtype 4 15.44 3.86 3.274e+29 <2e-16 ***
## Day 10 49.76 4.98 4.221e+29 <2e-16 ***
## Residuals 6 0.00 0.00
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
P = 0.000488
Sig level = 0.05
We reject the null hypothesis.
#4.3
#data reading
Readings<-c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
library(GAD)
Bolt<-c(seq(1,5),seq(1,5),seq(1,5),seq(1,5))
Bolt<-as.fixed(Bolt)
Chem<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5))
Chem<-as.fixed(Chem)
#Bloc design test
model<-lm(Readings~Chem+Bolt)
gad(model)
#4.16
G.Mean<-mean(Readings)
print(G.Mean)
chemicaltype1 <- c(73, 68, 74, 71, 67)
chemicaltype2 <- c(73, 67, 75, 72, 70)
chemicaltype3 <- c(75, 68, 78, 73, 68)
chemicaltype4 <- c(73, 71, 75, 75, 69)
#Averages
A1.<-mean(chemicaltype1)
A2.<-mean(chemicaltype2)
A3.<-mean(chemicaltype3)
A4.<-mean(chemicaltype4)
τi1<-A1.-G.Mean
τi2<-A2.-G.Mean
τi3<-A3.-G.Mean
τi4<-A4.-G.Mean
cat(τi1,τi2,τi3,τi4)
Boltype1<-c(73,73,75,73)
Boltype2<-c(68,67,68,71)
Boltype3<-c(74,75,78,75)
Boltype4<-c(71,72,73,75)
Boltype5<-c(67,70,68,69)
A.1<-mean(Boltype1)
A.2<-mean(Boltype2)
A.3<-mean(Boltype3)
A.4<-mean(Boltype4)
A.5<-mean(Boltype5)
βi1<-A.1-G.Mean
βi2<-A.2-G.Mean
βi3<-A.3-G.Mean
βi4<-A.4-G.Mean
βi5<-A.5-G.Mean
cat(βi1,βi2,βi3,βi4,βi5)
#4.22
Readings <- 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)
Elements <- c(1,2,4,3,5,3,5,1,4,2,2,1,3,5,4,4,3,5,2,1,5,4,2,1,3)
Batch <- as.factor(Batch)
Day <- c(rep(seq(1,5),5))
Day <- as.factor(Readings)
Elements <- as.factor(Elements)
Data <- data.frame(Readings, Batch, Day, Elements)
str(Data)
model<-aov(Readings~Elements+Batch+Day,data=Data)
summary(model)