Problem 5.4

\(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
c1 <- c(74,64,60,92,86,88,99,98,102)
c2 <- c(79,68,73,98,104,88,104,99,95)
c3 <- c(82,88,92,99,108,95,108,110,99)
c4 <- c(99,104,96,104,110,99,114,111,107)
response <- c(c1,c2,c3,c4)
# Factor A = Depth
# Factor B = Feed Rate
A <- c(rep(0.15,9),rep(0.18,9),rep(0.20,9),rep(0.25,9))
A <- as.factor(A)
B <- rep(c(rep(0.20,3),rep(0.25,3),rep(0.30,3)),4)
B <- as.factor(B)
data <- cbind(response,A,B)
model <- aov(response~A+B+A*B)
summary(model)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## A            3 2125.1   708.4  24.663 1.65e-07 ***
## B            2 3160.5  1580.2  55.018 1.09e-09 ***
## A:B          6  557.1    92.8   3.232    0.018 *  
## Residuals   24  689.3    28.7                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model)

response <- cbind(c1,c2,c3,c4)
m1 <- round(mean(response[1:3,]),2) # point estimate of mean surface finish for 
# feed rate 0.20
m2 <- round(mean(response[4:6,]),2) # point estimate of mean surface finish for 
# feed rate 0.25
m3 <- round(mean(response[7:9,]),2) # point estimate of mean surface finish for 
# feed rate 0.30
matrix(c("Feed Rate","0.20","0.25","0.30","Average",m1,m2,m3),4,2)
##      [,1]        [,2]     
## [1,] "Feed Rate" "Average"
## [2,] "0.20"      "81.58"  
## [3,] "0.25"      "97.58"  
## [4,] "0.30"      "103.83"
(a) Factor A and B are significant, as well as their interaction, at a significance level of 0.05.
(b) The data has roughly the same range in the residual plots, therefore the data can be said to have constant variance.
(c) The point estimates are 81.58,97.58,103.83 for feed rates 0.20, 0.25, 0.30, respectively.
(d) The P-values are 1.65e-07,1.09e-09,0.018 for depth, feed rate, and interaction, respectively.

Problem 5.34

library(GAD)
## Warning: package 'GAD' was built under R version 4.0.5
## Loading required package: matrixStats
## Warning: package 'matrixStats' was built under R version 4.0.5
## Loading required package: R.methodsS3
## Warning: package 'R.methodsS3' was built under R version 4.0.3
## R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
block1 <- c(response[1,],response[4,],response[7,])
block2 <- c(response[2,],response[5,],response[8,])
block3 <- c(response[3,],response[6,],response[9,])
obs <- c(block1,block2,block3)
depth <- c(0.15,0.18,0.20,0.25)
depth <- as.fixed(rep(depth,9))
feed <- as.fixed(rep(c(rep(0.20,4),rep(0.25,4),rep(0.30,4)),3))
data2 <- cbind(obs,depth,feed)
model <- lm(obs~depth+feed)
gad(model)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq F value    Pr(>F)    
## depth     3 2125.1  708.37  17.050 1.192e-06 ***
## feed      2 3160.5 1580.25  38.036 5.927e-09 ***
## Residual 30 1246.4   41.55                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sigma_delta <- (1580.25-41.55)/4/3
sigma_delta
## [1] 128.225
The p-values of depth and feed have the same order of magnitude when they are blocked and when they are not blocked, with both being significantly less than 0.05. This means that blocking is not useful in this experiment. \(\sigma_{\delta}^2\) = 128.225

Problem 13.5

\(H_{0}\): \(\sigma_{\tau}^2\) = 0
\(H_{a}\): \(\sigma_{\tau}^2\) \(\neq\) 0
\(H_{0}\): \(\sigma_{\beta}^2\) = 0
\(H_{a}\): \(\sigma_{\beta}^2\) \(\neq\) 0
\(H_{0}\): \(\sigma_{\tau\beta}^2\) = 0
\(H_{a}\): \(\sigma_{\tau\beta}^2\) \(\neq\) 0
c1 <- c(570,565,583,528,547,521)
c2 <- c(1063,1080,1043,988,1026,1004)
c3 <- c(565,510,590,526,538,532)
response <- c(c1,c2,c3)
temp <- as.fixed(c(rep(800,6),rep(825,6),rep(850,6)))
position <- as.random(rep(c(rep(1,3),rep(2,3)),3))
data3 <- cbind(response,position,temp)
model <- (aov(response~position+temp+position*temp))
GAD::gad(model)
## Analysis of Variance Table
## 
## Response: response
##               Df Sum Sq Mean Sq  F value    Pr(>F)    
## position       1   7160    7160   15.998 0.0017624 ** 
## temp           2 945342  472671 1155.518 0.0008647 ***
## position:temp  2    818     409    0.914 0.4271101    
## Residual      12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sigma_hat <- 448 # model component corresponding to error
sigma_hat_tau_beta <- max((409-448)/3,0) # model component corresponding to interaction
sigma_hat_tau <- (7160-448)/(3*3) # model component corresponding to position
sigma_hat
## [1] 448
sigma_hat_tau_beta
## [1] 0
sigma_hat_tau
## [1] 745.7778
The two factors, position and temperature are significant, while their interaction is not significant, at a significance level of 0.05. The model component estimates agree with the ANOVA method. \(\hat \sigma_{\tau\beta}\) = 0, implying that there is no significant interaction between the factors, which agrees with the interaction’s p-value from the ANOVA table.

Problem 13.6

\(H_{0}\): \(\sigma_{\tau}^2\) = 0
\(H_{a}\): \(\sigma_{\tau}^2\) \(\neq\) 0
\(H_{0}\): \(\sigma_{\beta}^2\) = 0
\(H_{a}\): \(\sigma_{\beta}^2\) \(\neq\) 0
\(H_{0}\): \(\sigma_{\tau\beta}^2\) = 0
\(H_{a}\): \(\sigma_{\tau\beta}^2\) \(\neq\) 0
c1 <- c(50,52,53,49,48,52,51,52,50,47)
c2 <- c(49,52,50,51,49,50,51,50,51,46)
c3 <- c(50,51,50,50,48,50,51,49,50,49)
c4 <- c(50,51,54,48,48,52,51,53,51,46)
c5 <- c(48,51,52,50,49,50,50,48,48,47)
c6 <- c(51,51,51,51,48,50,50,50,49,48)
measurements <- c(c1,c2,c3,c4,c5,c6)
operator <- as.factor(c(rep(1,30),rep(2,30)))
part <- as.factor(rep(seq(1,10),6))
data4 <- as.data.frame(cbind(measurements,part,operator))
model <- aov(measurements~part+operator+part*operator)
summary(model)
##               Df Sum Sq Mean Sq F value   Pr(>F)    
## part           9  99.02  11.002   7.335 3.22e-06 ***
## operator       1   0.42   0.417   0.278    0.601    
## part:operator  9   5.42   0.602   0.401    0.927    
## Residuals     40  60.00   1.500                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sigma_hat <- 1.500 # model component corresponding to error
sigma_hat_tau_beta <- max((0.602-1.500)/3,0) # model component corresponding to interaction
sigma_hat_tau <- (11.002-1.500)/(2*3) # model component corresponding to part
sigma_hat
## [1] 1.5
sigma_hat_tau_beta
## [1] 0
sigma_hat_tau
## [1] 1.583667
The two factors, part and operator are significant, while their interaction is not significant, at a significance level of 0.05. The model component estimates agree with the ANOVA method. \(\hat \sigma_{\tau\beta}\) = 0, implying that there is no significant interaction between the factors, which agrees with the interaction’s p-value from the ANOVA table.