This report captures work done for the individual homework for Week 10. R code along with the results are provided. The required homework problems were taken from “Design and Analysis of Experiments 8th Edition”:
   1) 5.4
   2) 5.34
   3) 13.5
   3) 13.6


Problem 1 (5.4)

An engineer suspects that the surface finish of a metal part is influenced by the feed rate and the depth of cut. He selects three feed rates and four depths of cut. He then conducts a factorial experiment and obtains the following data: [as shown in book]. (a) Analyze the data and draw conclusions. Use \(\alpha\) = 0.05. (d) Find the P-values for the tests in part (a). THESE ARE SHOWN IN THE ANOVA TABLE BELOW.

Setting things up:

# setup Libraries
library(knitr)
library(dplyr)
library(tidyr)
library(GAD)
library(tinytex)
library(ggplot2)
library(ggfortify)
# READ IN FILE
setwd("D:/R Files/")
dat <- read.csv("D:/R Files/5-4.csv",header=TRUE)

# SET UP DATA TYPES
dat$Feed.Rate <- as.fixed(dat$Feed.Rate)
dat$Depth.of.Cut <- as.fixed(dat$Depth.of.Cut)
Response <- dat$Surface.Finish


The Linear Effects for this Model are:

\(\quad y_{ijk}\) = \(\mu\) + \(\alpha_i\) + \(\beta_j\) + \(\alpha \beta_{ij}\) \(\epsilon_{ijk}\)

Where:


\(\quad \alpha_i\) is the main effect of the \(\ i^{th}\) treatment of Feed Rate used


\(\quad \beta_j\) is the main effect of the \(\ j^{th}\) treatment of Depth of Cut


\(\quad \alpha \beta_{ij}\) is the interaction effect of the \(\ ij^{th}\) treatment of Feed Rate * Depth of Cut, and


\(\quad \epsilon_{ijk}\) is the random error term.

The Hypotheses we will test are:

Feed Rate Main Effect:


\(\quad H_0\) : \(\alpha_i\) = 0 \(\forall\) i


\(\quad H_a\) : \(\alpha_i \neq\) 0 for at least one \(\ i\)

Depth of Cut Main Effect:


\(\quad H_0\) : \(\beta_j\) = 0 \(\forall\) j


\(\quad H_a\) : \(\beta_j \neq\) 0 for at least one \(\ j\)

Feed Rate * Depth of Cut Interaction Effect:


\(\quad H_0\) : \(\alpha \beta_{ij}\) = 0 \(\forall\) ij


\(\quad H_a\) : \(\alpha \beta_{ij} \neq\) 0 for at least one \(\ ij\)


\(\quad\)at a significance level of \(\alpha\) = 0.05


# SET UP model
model<-aov(Response~dat$Feed.Rate+dat$Depth.of.Cut+dat$Feed.Rate*dat$Depth.of.Cut)
#run model through GAD
GAD::gad(model)
## Analysis of Variance Table
## 
## Response: Response
##                                Df  Sum Sq Mean Sq F value    Pr(>F)    
## dat$Feed.Rate                   2 3160.50 1580.25 55.0184 1.086e-09 ***
## dat$Depth.of.Cut                3 2125.11  708.37 24.6628 1.652e-07 ***
## dat$Feed.Rate:dat$Depth.of.Cut  6  557.06   92.84  3.2324   0.01797 *  
## Residual                       24  689.33   28.72                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

We evaluate the hypothesis for the interaction effect first and find that it to be at a p-value of 0.018 which is not significant to an \(\alpha\) of 0.05. Therefore, we look at the main effects and find that both Feed Rate and Depth of Cut are significant, with p-values of <0.001 each.

  1. Prepare appropriate residual plots and comment on the model’s adequacy.

We can see from the plots below that the residual are normal-ish and show constant variation.

autoplot(model)

  1. Obtain point estimates of the mean surface finish at each feed rate.
dat %>%                                        # Specify data frame
  group_by(Feed.Rate) %>%                         # Specify group indicator
  summarise_at(vars(Surface.Finish),              # Specify column
               list(name = mean))               # Specify function
## # A tibble: 3 x 2
##   Feed.Rate  name
##   <fct>     <dbl>
## 1 0.2        81.6
## 2 0.25       97.6
## 3 0.3       104.

Problem 2 (5.34)

Reconsider the experiment in 5.4. Suppose that this experiment had been conducted in three blocks, with each replicate a block. Assume that the observations in the data table are given in order, that is, the first observation in each cell comes from the first replicate, and so on. Reanalyze the data as a factorial experiment in blocks and estimate the variance component for blocks. Does it appear that blocking was useful in this experiment?

#blocks <- rep(1:3, each=12)
#dat2 <- cbind(dat,blocks)
#model2<-aov(Response~dat2$Feed.Rate+dat2$Depth.of.Cut+ dat2$blocks+ dat$Feed.Rate*dat$Depth.of.Cut)
#GAD::gad(model2)

I wasn’t able to get the above code to run because it was flagged as an unbalanced design. Running this in Minitab, the block returns back with a P-value of 0.112 which is not significant to a alpha of 0.05. The estimated variance using REML for the block is 4.36. —-

Problem 3 (13.5)

Suppose that in Problem 5.13 the furnace positions were randomly selected, resulting in a mixed model experiment. Reanalyze the data from this experiment under this new assumption. Estimate the appropriate model components using the ANVOA method.

The appropriate model components are shown in the ANOVA table below. The interaction effect is not significant at a p-value of 0.427 so we can examine the main effects that are both significant with p-values of less than 0.002 and an alpha level of 0.05.

# Set up Variables

Position <- rep(c(1,2),times=9)
Temperature <- rep(c(rep(800,2),rep(825,2),rep(850,2)),3)
BakedDensity <- c(570,528,1063,988,565,526,565,547,1080,1026,510,538,583,521,1043,1004,590,532)
dat13 <- as.data.frame(cbind(Position,Temperature,BakedDensity))

# SET UP DATA TYPES
Position <- as.random(Position)
Temperature <- as.fixed(Temperature)

# SET UP model
model13<-aov(BakedDensity~Position+Temperature+Position*Temperature)
#run model through GAD
GAD::gad(model13)
## Analysis of Variance Table
## 
## Response: BakedDensity
##                      Df Sum Sq Mean Sq  F value    Pr(>F)    
## Position              1   7160    7160   15.998 0.0017624 ** 
## Temperature           2 945342  472671 1155.518 0.0008647 ***
## Position:Temperature  2    818     409    0.914 0.4271101    
## Residual             12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Problem 4 (13.6)

Reanalyze the measurement systems experiment in Problem 13.1, assuming that operators are a fixed factor. Estimate the appropriate model components using the ANOVA method.

The appropriate model components are shown in the ANOVA table below. The interaction effect is not significant at a p-value of 0.927 so we can examine the main effects. The Operator is not significant with a p-value of 0.427, but the PartNumber is with a p-value of below 0.001 compared to an alpha of 0.05.

# Set up Variables
dat131 <- read.csv("D:/R Files/131.csv",header=TRUE)

PartNumber <- dat131$PartNumber
Operator <- dat131$Operator
Measurement <- dat131$Measurement
Result <- dat131$Result

# SET UP DATA TYPES
Operator <- as.fixed(Operator)
PartNumber <- as.random(PartNumber)


# SET UP model
model131<-aov(Result~Operator+PartNumber+Operator*PartNumber)
#run model through GAD
GAD::gad(model131)
## Analysis of Variance Table
## 
## Response: Result
##                     Df Sum Sq Mean Sq F value    Pr(>F)    
## Operator             1  0.417  0.4167  0.6923    0.4269    
## PartNumber           9 99.017 11.0019  7.3346 3.216e-06 ***
## Operator:PartNumber  9  5.417  0.6019  0.4012    0.9270    
## Residual            40 60.000  1.5000                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1