Problem 5.2
\(H_{0}\): All row treatments are equal, \(\tau_{i}\) = 0
\(H_{1}\): At least one \(\tau_{i}\) \(\neq\) 0
\(H_{0}\): All column treatments are equal, \(\beta_{j}\) = 0
\(H_{1}\): At least one \(\beta_{j}\) \(\neq\) 0
\(H_{0}\): (\(\tau \beta_{ij}\)) = 0 for all i,j
\(H_{1}\): At least one (\(\tau \beta_{ij}\)) \(\neq\) 0
MSA <- 0.0002
SSB <- 180.378
SSAB <- 8.479
SSE <- 158.797
SST <- 347.653
a <- 2
b <- 3/(a-1)+1
n <- 8/a/b+1
SSA <- MSA*(a-1)
MSB <- SSB/(b-1)
MSAB <- round(SSAB/((a-1)*(b-1)),3)
MSE <- round(SSE/(a*b*(n-1)),3)
FoA <- round(MSA/MSE,5)
FoB <- round(MSB/MSE,3)
FoAB <- round(MSAB/MSE,3)
ANOVA <- as.data.frame(matrix(c("A","B","Interaction","Error","Total",a-1,b-1,
(a-1)*(b-1),a*b*(n-1),a*b*n-1,SSA,SSB,SSAB,SSE,
SST,MSA,MSB,MSAB,
MSE,"N/A",FoA,FoB,FoAB,
"N/A","N/A",">0.05",">0.05",0.932,"N/A","N/A"),5,6))
colnames(ANOVA) <- c("Source","DF","SS","MS","Fo","P")
ANOVA
## Source DF SS MS Fo P
## 1 A 1 2e-04 2e-04 1e-05 >0.05
## 2 B 3 180.378 60.126 3.029 >0.05
## 3 Interaction 3 8.479 2.826 0.142 0.932
## 4 Error 8 158.797 19.85 N/A N/A
## 5 Total 15 347.653 N/A N/A N/A
(b) 4 levels were used for Factor B
(c) 2 replicates were performed
(d) The p-value of the interaction is 0.932, nearly 1. From this we can conclude that there is no interaction between the two factors, at any level of significance.
Problem 5.9
\(H_{0}\): All row treatments are equal, \(\tau_{i}\) = 0
\(H_{1}\): At least one \(\tau_{i}\) \(\neq\) 0
\(H_{0}\): All column treatments are equal, \(\beta_{j}\) = 0
\(H_{1}\): At least one \(\beta_{j}\) \(\neq\) 0
\(H_{0}\): (\(\tau \beta_{ij}\)) = 0 for all i,j
\(H_{1}\): At least one (\(\tau \beta_{ij}\)) \(\neq\) 0
dat <- t(matrix(c(2.70,2.45,2.60,2.75,2.78,2.49,2.72,2.86,2.83,2.85,
2.86,2.94,2.86,2.80,2.87,2.88),4,4))
# Factor A = Drill Speed
# Factor B = Feed Rate
a <- 2 # Number of levels in Factor A
b <- 4 # Number of levels in Factor B
n <- 2 # Number of replicates
yi..2 <- sum(dat[1:2,])^2+sum(dat[3:4,])^2 # Square of total of all observations
# under ith level of Factor A
SSA <- ((1/b/n)*yi..2)-(sum(dat)^2/(a*b*n)) # Sum of Squares for Factor A
SSA <- round(SSA,4)
y.j.2 <- sum(dat[,1])^2+sum(dat[,2])^2+sum(dat[,3])^2+sum(dat[,4])^2 # Square of
# total of all observations under jth level of Factor B
SSB <- ((1/a/n)*y.j.2)-(sum(dat)^2/(a*b*n)) # Sum of Squares for Factor B
SSB <- round(SSB,4)
yij2 <- 0 # Square of total of all observations in ijth cell
for (i in 1:4)
{
yij2 <- yij2 + (sum(dat[1:2,i]))^2 + sum((dat[3:4,i]))^2
}
SSAB <- (1/n*yij2)-(sum(dat)^2/(a*b*n))-SSA-SSB # Sum of squares for
# Interaction Effect
SSAB <- round(SSAB,4)
SST <- sum(dat^2)-(sum(dat)^2/(a*b*n)) # Sum of Squares for Total
SST <- round(SST,4)
SSE <- SST-SSA-SSB-SSAB ## Sum of Square for Error
SSE <- round(SSE,4)
MSA <- SSA/(a-1) # Mean Square for Factor A
MSA <- round(MSA,4)
MSB <- SSB/(b-1) # Mean Square for Factor B
MSB <- round(MSB,4)
MSAB <- SSAB/((a-1)*(b-1)) # Mean Square for Interaction Effect
MSAB <- round(MSAB,4)
MSE <- SSE/(a*b*(n-1)) # Mean Square Error
MSE <- round(MSE,4)
FoA <- MSA/MSE # F statistic for Factor A
FoB <- MSB/MSE # F statistic for Factor B
FoB <- round(FoB,4)
FoAB <- MSAB/MSE # F statistic for Interaction Effect
FoAB <- round(FoAB,4)
ANOVA <- as.data.frame(matrix(c("A","B","AB","Error","Total",SSA,SSB,SSAB,SSE,
SST,a-1,b-1,(a-1)*(b-1),a*b*(n-1),a*b*n-1,MSA,MSB,MSAB,
MSE,"N/A",FoA,FoB,FoAB,
"N/A","N/A"),5,5))
colnames(ANOVA) <- c("Source of Variation","Sum of Squares","DF","Mean Square",
"Fo")
ANOVA # This is the results of the Analysis of Variance (ANOVA)
## Source of Variation Sum of Squares DF Mean Square Fo
## 1 A 0.1482 1 0.1482 57
## 2 B 0.0925 3 0.0308 11.8462
## 3 AB 0.0419 3 0.014 5.3846
## 4 Error 0.0208 8 0.0026 N/A
## 5 Total 0.3034 15 N/A N/A
From Appendix Table IV of Montgomery, \(F_{0.05,3,8}\) = 4.07.The F statistic of the Interaction (AB) is 5.36. Because 5.38>4.07, this implies that the p-value is less than 0.05 and that at a significance level of 0.05, there is a significant interaction between factor A and factor B.
R Code
MSA <- 0.0002
SSB <- 180.378
SSAB <- 8.479
SSE <- 158.797
SST <- 347.653
a <- 2
b <- 3/(a-1)+1
n <- 8/a/b+1
SSA <- MSA*(a-1)
MSB <- SSB/(b-1)
MSAB <- round(SSAB/((a-1)*(b-1)),3)
MSE <- round(SSE/(a*b*(n-1)),3)
FoA <- round(MSA/MSE,5)
FoB <- round(MSB/MSE,3)
FoAB <- round(MSAB/MSE,3)
ANOVA <- as.data.frame(matrix(c("A","B","Interaction","Error","Total",a-1,b-1,
(a-1)*(b-1),a*b*(n-1),a*b*n-1,SSA,SSB,SSAB,SSE,
SST,MSA,MSB,MSAB,
MSE,"N/A",FoA,FoB,FoAB,
"N/A","N/A",">0.05",">0.05",0.932,"N/A","N/A"),5,6))
colnames(ANOVA) <- c("Source","DF","SS","MS","Fo","P")
ANOVA
dat <- t(matrix(c(2.70,2.45,2.60,2.75,2.78,2.49,2.72,2.86,2.83,2.85,
2.86,2.94,2.86,2.80,2.87,2.88),4,4))
# Factor A = Drill Speed
# Factor B = Feed Rate
a <- 2 # Number of levels in Factor A
b <- 4 # Number of levels in Factor B
n <- 2 # Number of replicates
yi..2 <- sum(dat[1:2,])^2+sum(dat[3:4,])^2 # Square of total of all observations
# under ith level of Factor A
SSA <- ((1/b/n)*yi..2)-(sum(dat)^2/(a*b*n)) # Sum of Squares for Factor A
SSA <- round(SSA,4)
y.j.2 <- sum(dat[,1])^2+sum(dat[,2])^2+sum(dat[,3])^2+sum(dat[,4])^2 # Square of
# total of all observations under jth level of Factor B
SSB <- ((1/a/n)*y.j.2)-(sum(dat)^2/(a*b*n)) # Sum of Squares for Factor B
SSB <- round(SSB,4)
yij2 <- 0 # Square of total of all observations in ijth cell
for (i in 1:4)
{
yij2 <- yij2 + (sum(dat[1:2,i]))^2 + sum((dat[3:4,i]))^2
}
SSAB <- (1/n*yij2)-(sum(dat)^2/(a*b*n))-SSA-SSB # Sum of squares for
# Interaction Effect
SSAB <- round(SSAB,4)
SST <- sum(dat^2)-(sum(dat)^2/(a*b*n)) # Sum of Squares for Total
SST <- round(SST,4)
SSE <- SST-SSA-SSB-SSAB ## Sum of Square for Error
SSE <- round(SSE,4)
MSA <- SSA/(a-1) # Mean Square for Factor A
MSA <- round(MSA,4)
MSB <- SSB/(b-1) # Mean Square for Factor B
MSB <- round(MSB,4)
MSAB <- SSAB/((a-1)*(b-1)) # Mean Square for Interaction Effect
MSAB <- round(MSAB,4)
MSE <- SSE/(a*b*(n-1)) # Mean Square Error
MSE <- round(MSE,4)
FoA <- MSA/MSE # F statistic for Factor A
FoB <- MSB/MSE # F statistic for Factor B
FoB <- round(FoB,4)
FoAB <- MSAB/MSE # F statistic for Interaction Effect
FoAB <- round(FoAB,4)
ANOVA <- as.data.frame(matrix(c("A","B","AB","Error","Total",SSA,SSB,SSAB,SSE,
SST,a-1,b-1,(a-1)*(b-1),a*b*(n-1),a*b*n-1,MSA,MSB,MSAB,
MSE,"N/A",FoA,FoB,FoAB,
"N/A","N/A"),5,5))
colnames(ANOVA) <- c("Source of Variation","Sum of Squares","DF","Mean Square",
"Fo")
ANOVA # This is the results of the Analysis of Variance (ANOVA)