5.2

a.

MS_A <- 0.0002
SS_B <- 180.378
SS_Interaction <- 8.479
SS_Error <- 158.797
SS_Total <- 347.653

DF_A <- 1
DF_Interaction <- 3
DF_Error <- 8
DF_Total <- 15
DF_B <- 3

SS_A <- MS_A * DF_A
MS_B <- SS_B / DF_B
MS_Interaction <- SS_Interaction / DF_Interaction
MS_Error <- SS_Error / DF_Error
MS_Total <- SS_Total / DF_Total


F_A <- MS_A / MS_Error
F_B <- MS_B / MS_Error
F_Interaction <- MS_Interaction / MS_Error

P_A <- pf(F_A, DF_A, DF_Error, lower.tail = FALSE)
P_B <- pf(F_B, DF_B, DF_Error, lower.tail = FALSE)

b.

Levels in B = DF_B + 1 = 4

c.

DF_Error= I*J*(K-1)=8

I=2, J=4

K=2

d.

None of the factors have significant effects on the observations at 95% level.

5.4

a.

feedrate <- c(rep(0.2,3),rep(0.25,3),rep(0.3,3),rep(0.2,3),rep(0.25,3),rep(0.3,3),rep(0.2,3),rep(0.25,3),rep(0.3,3),rep(0.2,3),rep(0.25,3),rep(0.3,3))
depth <- c(rep(0.15,9),rep(0.18,9),rep(0.20,9),rep(0.25,9))
obs <- c(74,64,60,92,86,88,99,98,102,79,68,73,98,104,88,104,99,95,82,88,92,99,108,95,108,110,99,99,104,96,104,110,99,114,111,107)
depth <- as.factor(depth)
feedrate <- as.factor(feedrate)
dat <- data.frame(depth,feedrate,obs)
model <- aov(obs~depth+feedrate+depth*feedrate, data = dat)
summary(model)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## depth           3 2125.1   708.4  24.663 1.65e-07 ***
## feedrate        2 3160.5  1580.2  55.018 1.09e-09 ***
## depth:feedrate  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

Both factors and their interaction have significant effects at 0.05 level.

b.

plot(model)

The data seem to be normally distributed and the variances appear to be constant.

c.

means <- aggregate(obs ~ feedrate, data = dat, mean)
sd <- aggregate(obs ~ feedrate, data = dat, sd)
print(means)
##   feedrate       obs
## 1      0.2  81.58333
## 2     0.25  97.58333
## 3      0.3 103.83333
print(sd)
##   feedrate       obs
## 1      0.2 14.336592
## 2     0.25  8.005207
## 3      0.3  6.072791

d.

The p-values for feed rate, depth and their interaction are respectively 1.65e-07,1.09e-09 and, 0.018.

5.9

Feed_rate<-c(rep(0.015,4),rep(0.030,4),rep(0.045,4),rep(0.060,4))
Drill_speed<-c(125,125,200,200,125,125,200,200,125,125,200,200,125,125,200,200)
obs<-c(2.7,2.78,2.83,2.86,2.45,2.49,2.85,2.8,2.6,2.72,2.86,2.87,2.75,2.86,2.94,2.88)

data<-data.frame(Feed_rate,Drill_speed,obs)
data$Feed_rate <- as.factor(data$Feed_rate)
data$Drill_speed <- as.factor(data$Drill_speed)
model <- aov(obs~Feed_rate+Drill_speed+Feed_rate*Drill_speed,data = data)
summary(model)
##                       Df  Sum Sq Mean Sq F value   Pr(>F)    
## Feed_rate              3 0.09250 0.03083  11.859  0.00258 ** 
## Drill_speed            1 0.14823 0.14823  57.010 6.61e-05 ***
## Feed_rate:Drill_speed  3 0.04187 0.01396   5.369  0.02557 *  
## Residuals              8 0.02080 0.00260                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model)

Both factors and their interaction significantly affect the observations at 95% level.

5.34

feedrate <- c(rep(0.2,3),rep(0.25,3),rep(0.3,3),rep(0.2,3),rep(0.25,3),rep(0.3,3),rep(0.2,3),rep(0.25,3),rep(0.3,3),rep(0.2,3),rep(0.25,3),rep(0.3,3))
depth <- c(rep(0.15,9),rep(0.18,9),rep(0.20,9),rep(0.25,9))
obs <- c(74,64,60,92,86,88,99,98,102,79,68,73,98,104,88,104,99,95,82,88,92,99,108,95,108,110,99,99,104,96,104,110,99,114,111,107)
depth <- as.factor(depth)
feedrate <- as.factor(feedrate)

block <- c(seq(1,3),seq(1,3),seq(1,3),seq(1,3),seq(1,3),seq(1,3),seq(1,3),seq(1,3),seq(1,3),seq(1,3),seq(1,3),seq(1,3))
block <- as.factor(block)
dat1 <- data.frame(block,depth,feedrate,obs)
model1 <- aov(obs~block+depth+feedrate+depth*feedrate,data = dat1)
summary(model1)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## block           2  180.7    90.3   3.907  0.03532 *  
## depth           3 2125.1   708.4  30.637 4.89e-08 ***
## feedrate        2 3160.5  1580.2  68.346 3.64e-10 ***
## depth:feedrate  6  557.1    92.8   4.015  0.00726 ** 
## Residuals      22  508.7    23.1                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Introducing the block reduced their p-values, therefore it appears to be useful.

13.5

library(GAD)
pos <- c(rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3))
temp <- c(rep(800,6),rep(825,6),rep(850,6))
obs <- c(570,565,583,528,547,521,1063,1080,1043,988,1026,1004,565,510,590,526,538,532)
pos <- as.random(pos)
temp <- as.fixed(temp)
dat2 <- data.frame(pos,temp,obs)
model2 <- aov(obs~pos*temp)
gad(model2)
## $anova
## Analysis of Variance Table
## 
## Response: obs
##           Df Sum Sq Mean Sq  F value    Pr(>F)    
## pos        1   7160    7160   15.998 0.0017624 ** 
## temp       2 945342  472671 1155.518 0.0008647 ***
## pos:temp   2    818     409    0.914 0.4271101    
## Residuals 12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Position and temperature both significantly affect the observations, but their interaction does not.

13.6

library(GAD)
part <- c(rep(1,6),rep(2,6),rep(3,6),rep(4,6),rep(5,6),rep(6,6),rep(7,6),rep(8,6),rep(9,6),rep(10,6))
operator <- c(rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3))
obs <- c(50,49,50,50,48,51,52,52,51,51,51,51,53,50,50,54,52,51,49,51,50,48,50,51,48,49,48,48,49,48,52,50,50,52,50,50,51,51,51,51,50,50,52,50,49,53,48,50,50,51,50,51,48,49,47,46,49,46,47,48)
part <- as.random(part)
operator <- as.fixed(operator)
dat3 <- data.frame(part,operator,obs)
model3 <- aov(obs~operator*part)
gad(model3)
## $anova
## Analysis of Variance Table
## 
## Response: obs
##               Df Sum Sq Mean Sq F value    Pr(>F)    
## operator       1  0.417  0.4167  0.6923    0.4269    
## part           9 99.017 11.0019  7.3346 3.216e-06 ***
## operator:part  9  5.417  0.6019  0.4012    0.9270    
## Residuals     40 60.000  1.5000                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Only the part significantly affect the observations.