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 a= 0.05) and draw appropriate conclusions.
chem1 <- c(73, 68, 74, 71, 67)
chem2 <- c(73, 67, 75, 72, 70)
chem3 <- c(75 ,68 ,78 ,73 ,68)
chem4 <- c(73, 71, 75, 75, 69)
dafr <- stack(data.frame(chem1,chem2,chem3,chem4))
dafr$bolt <- rep(seq(1,5),4)
library(GAD)
dafr$ind <- as.fixed(dafr$ind)
dafr$bolt <- as.fixed(dafr$bolt)
Our linear model effects equation is \(X_{ij}=\mu+\tau_i+\beta_j+\epsilon_{ij}\) where we are testing to see if \(\tau_i\) (the effect of different chemicals) is equal to 0 or not.
We will perform a Randomized Complete Block Design test, with bolt type being blocked(since we are considering bolt type to be a significant source of nuisance variability), and testing chemical types. Our official hypothesis is that the means between the grouped chemical types are the same versus they are not.
Ho: \(\mu_1=\mu_2=\mu_3=\mu_4=\mu\)
Ha: \(\mu_i\neq\mu\) for some i$
or
Ho: \(\tau_i=0\)
Ho: \(\tau_i\neq0\)
model <- lm(values~ind+bolt,dafr)
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
Our p-value is much less than our given alpha value of .05 so therefore we reject the null hypothesis and state there is a difference between the average strength of the cloth given the chemical used.
Assuming that chemical types and bolts are fixed, estimate the model parameters \(\tau_i\) and \(\beta_j\) in Problem 4.3.3
To find \(\tau_i\)(our error given by the treatments(chemicals)): =\(y_{i.}-y_{..}\)
Our estimated \(\tau_i\)s then would be:
\(\tau_1\)=-1.15
\(\tau_2\)=-0.35
\(\tau_3\)=0.65
\(\tau_4\)=0.85
To find \(\beta_i\)(our error given by the blocks(bolts)): =\(y_{.j}-y_{..}\)
Our estimated \(\tau_i\) then would be:
\(\beta_1\)=1.75
\(\beta_2\)=-3.25
\(\beta_3\)=3.75
\(\beta_4\)=1
\(\beta_5\)=-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 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 a=0.05) and draw conclusions.
We will test the factors to see if any of them are significant as to the outcome of the reaction time.
Ho: \(\mu_1=\mu_2=\mu_3=\mu_4=\mu_5\)
Ha: \(\mu_i\neq\mu\) for some i
batch1 <- c( 8, 7, 1, 7, 3)
batch2 <- c( 11 ,2 , 7 , 3 , 8)
batch3 <- c(4 ,9 ,10 , 1, 5)
batch4 <- c(6 ,8 ,6 , 6, 10)
batch5 <- c(4 ,2, 3 , 8 , 8)
dafr <- stack(data.frame(batch1,batch2,batch3,batch4,batch5))
dafr$day <- as.fixed(rep(seq(1,5),5))
dafr$ing <- as.fixed(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'))
summary(aov(values~ind+day+ing,dafr))
## Df Sum Sq Mean Sq F value Pr(>F)
## ind 4 15.44 3.86 1.235 0.347618
## day 4 12.24 3.06 0.979 0.455014
## ing 4 141.44 35.36 11.309 0.000488 ***
## Residuals 12 37.52 3.13
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
We can see from the above results that ingredients is significant, while day and batch (shown as ind) is not, since ingredients is the only elements to be shown as having a pvlaue below our alpha of .05.
All code Used:
chem1 <- c(73, 68, 74, 71, 67)
chem2 <- c(73, 67, 75, 72, 70)
chem3 <- c(75 ,68 ,78 ,73 ,68)
chem4 <- c(73, 71, 75, 75, 69)
dafr <- stack(data.frame(chem1,chem2,chem3,chem4))
dafr$bolt <- rep(seq(1,5),4)
library(GAD)
dafr$ind <- as.fixed(dafr$ind)
dafr$bolt <- as.fixed(dafr$bolt)
model <- lm(values~ind+bolt,dafr)
gad(model)
batch1 <- c( 8, 7, 1, 7, 3)
batch2 <- c( 11 ,2 , 7 , 3 , 8)
batch3 <- c(4 ,9 ,10 , 1, 5)
batch4 <- c(6 ,8 ,6 , 6, 10)
batch5 <- c(4 ,2, 3 , 8 , 8)
dafr <- stack(data.frame(batch1,batch2,batch3,batch4,batch5))
dafr$day <- as.fixed(rep(seq(1,5),5))
dafr$ing <- as.fixed(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'))
summary(aov(values~ind+day+ing,dafr))