4.3 : Chemical and Bolt Block Design

Hypothesis:

\(H_o: \tau_i = 0\) for all \(i\)

\(H_a: \tau_i \neq 0\) for some \(i\)

obs<-c(73,68,74,71,67,
       73,67,75,72,70,
       75,68,78,73,68,
       73,71,75,75,69)
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

+ The p-value is 0.1211 which is greater than our alpha, 0.05. Therefore I fail to reject the null hypothesis. I say that there is not a difference in at least one of the chemicals.

4.16: Chemical and Bolt Block Design Patameters

\[ \tau_i = y_{i.} - y{..} \\ y{..} = 71.75 \\ \tau_1 = 70.6 - 71.75 = -1.15 \\ \tau_2 = 71.4 - 71.75 = -0.35 \\ \tau_3 = 72.4 - 71.75 = 0.65 \\ \tau_4 = 72.6 - 71.75 = 0.85 \]

\[ \beta_j = y_{.j} - y{..} \\ y{..} = 71.75 \\ \beta_1 = 73.5 - 71.75 = 1.75 \\ \beta_2 = 68.5 - 71.75 = -3.25 \\ \beta_3 = 75.5 - 71.75 = 3.75 \\ \beta_4 = 72.75 - 71.75 = 1 \\ \beta_5 = 68.5 - 71.75 = -3.25 \]

4.22 Batches and Days Latin Square

\(H_o: \tau_i = 0\) for all \(i\)

\(H_a: \tau_i \neq 0\) for some \(i\)

batch <- c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
days <- c(rep(seq(1,5),5))
ingredients <- 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")
obs2 <- 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)
dat2 <- cbind(batch,days,ingredients,obs2)
dat2 <- as.data.frame(dat2)
dat2$batch <- as.fixed(dat2$batch)
dat2$Day <- as.fixed(dat2$days)
dat2$ingredients <- as.fixed(dat2$ingredients)
model2 <- lm(dat2$obs2~dat2$batch+dat2$days+dat2$ingredients,data = dat2)
summary(aov(model2))
##                  Df Sum Sq Mean Sq F value   Pr(>F)    
## dat2$batch        4  15.44    3.86   1.235 0.347618    
## dat2$days         4  12.24    3.06   0.979 0.455014    
## dat2$ingredients  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
+ The p-value is 0.347618 which is greater than our alpha, 0.05. Therefore I fail to reject the null hypothesis. This means that there is no difference among batch for given known nuisance variability of days and ingredients.