The yield of a chemical process is being studied. The two most important variables are thought to be the pressure and the temperature. Three levels of each factor are selected,and a factorial experiment with two replicates is performed. The yield data are as follows:
temp150 <- c(90.4, 90.7, 90.2 ,90.2, 90.6, 90.4)
temp160 <- c(90.1, 90.5, 89.9, 90.3 ,90.6 ,90.1)
temp170 <- c(90.5 ,90.8 ,90.4 ,90.7 ,90.9 ,90.1)
pressure <- rep(c(200,215,230),6)
dafr <- stack(data.frame(temp150,temp160,temp170))
dafr$pressure <- as.factor(pressure)
colnames(dafr) <- c('Yeild','Temp','Pressure')
head(dafr)
## Yeild Temp Pressure
## 1 90.4 temp150 200
## 2 90.7 temp150 215
## 3 90.2 temp150 230
## 4 90.2 temp150 200
## 5 90.6 temp150 215
## 6 90.4 temp150 230
Is there any indication that either factor influences brightness? Use a=0.05.
We will perform an ANOVA test to test if the two factors are significant.
\(H_o:\alpha_i=0\) and \(\beta_{j}=0\) and \(\alpha\beta_{ij}=0\)
\(H_o:\alpha_i\neq0\) and \(\beta_{j}\neq0\) and \(\alpha\beta_{ij}\neq0\)
summary(aov(Yeild~Temp+Pressure+Temp*Pressure,dafr))
## Df Sum Sq Mean Sq F value Pr(>F)
## Temp 2 0.3011 0.1506 8.469 0.008539 **
## Pressure 2 0.7678 0.3839 21.594 0.000367 ***
## Temp:Pressure 4 0.0689 0.0172 0.969 0.470006
## Residuals 9 0.1600 0.0178
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Yes, both p values are below our alpha, therefore we reject the null hypothesis and state that the factors do influence the yeild.
Prepare appropriate residual plots and comment on the model’s adequacy.
plot(aov(Yeild~Temp+Pressure+Temp*Pressure,dafr))
Our residuals and Normality Plot indicate there is nothing strange or assumption breaking about this data set. There is no pattern to the residuals and the normality plot seems to be in a straight line.
Under what conditions would you operate this process?
Because our data is quantitative, we need to account for possible interaction effects, rather than treating it the same way we do qualitative data.
A mechanical engineer is studying the thrust force developed by a drill press. He suspects that the drilling speed and the feed rate of the material are the most important factors. He selects four feed rates and uses a high and low drill speed chosen to represent the extreme operating conditions. He obtains the following results. Analyze the data and draw conclusions. Use a=0.05.
DS125 <- c(2.70, 2.45, 2.60 ,2.75 ,2.78 ,2.49 ,2.72 ,2.86)
DS200 <- c( 2.83 ,2.85, 2.86, 2.94 ,2.86 ,2.80 ,2.87, 2.88)
Feedrate <- rep(c(0.015 ,0.030, 0.045, 0.060),4)
dafr <- stack(data.frame(DS125,DS200))
dafr$feedrate <- as.factor(Feedrate)
colnames(dafr) <- c('Thrust','Drillspeed','Feedrate')
head(dafr)
## Thrust Drillspeed Feedrate
## 1 2.70 DS125 0.015
## 2 2.45 DS125 0.03
## 3 2.60 DS125 0.045
## 4 2.75 DS125 0.06
## 5 2.78 DS125 0.015
## 6 2.49 DS125 0.03
We will perform an Anova test to see if not only our given factors are significant, but also if the two factors interact. More mathematically, we are checking:
\(H_o:\alpha_i=0\) and \(\beta_{j}=0\) and \(\alpha\beta_{ij}=0\)
\(H_o:\alpha_i\neq0\) and \(\beta_{j}\neq0\) and \(\alpha\beta_{ij}\neq0\)
summary(aov(Thrust~Drillspeed+Feedrate+Drillspeed*Feedrate,dafr))
## Df Sum Sq Mean Sq F value Pr(>F)
## Drillspeed 1 0.14822 0.14822 57.010 6.61e-05 ***
## Feedrate 3 0.09250 0.03083 11.859 0.00258 **
## Drillspeed:Feedrate 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
We see here that firstly our interaction effects are significant.(pvalue is below .05). Therfore, we cannot say if the two factors, Feedrate and Drillspeed, are significant on their own, since the interaction effect between them is a part of their current fvalue and pvalue in our ANOVA table.
interaction.plot(dafr$Feedrate,dafr$Drillspeed,dafr$Thrust,xlab='Feed Rate',ylab='Thrust',trace.label = "Drill Speed")
Here we can see from our interaction plot that indeed, our factors are not parallel, and thus have an interaction.
temp150 <- c(90.4, 90.7, 90.2 ,90.2, 90.6, 90.4)
temp160 <- c(90.1, 90.5, 89.9, 90.3 ,90.6 ,90.1)
temp170 <- c(90.5 ,90.8 ,90.4 ,90.7 ,90.9 ,90.1)
pressure <- rep(c(200,215,230),6)
dafr <- stack(data.frame(temp150,temp160,temp170))
dafr$pressure <- as.factor(pressure)
colnames(dafr) <- c('Yeild','Temp','Pressure')
head(dafr)
summary(aov(Yeild~Temp+Pressure+Temp*Pressure,dafr))
plot(aov(Yeild~Temp+Pressure+Temp*Pressure,dafr))
DS125 <- c(2.70, 2.45, 2.60 ,2.75 ,2.78 ,2.49 ,2.72 ,2.86)
DS200 <- c( 2.83 ,2.85, 2.86, 2.94 ,2.86 ,2.80 ,2.87, 2.88)
Feedrate <- rep(c(0.015 ,0.030, 0.045, 0.060),4)
dafr <- stack(data.frame(DS125,DS200))
dafr$feedrate <- as.factor(Feedrate)
colnames(dafr) <- c('Thrust','Drillspeed','Feedrate')
head(dafr)
interaction.plot(dafr$Feedrate,dafr$Drillspeed,dafr$Thrust,xlab='Feed Rate',ylab='Thrust',trace.label = "Drill Speed")