An article in Quality Progress (May 2011, pp. 42–48) describes the use of factorial experiments to improve a silver powder production process. This product is used in conductive pastes to manufacture a wide variety of products ranging from silicon wafers to elastic membrane switches. We consider powder density (g/cm2)(g/cm2) as the response variable and critical characteristics of this product. The data is shown below.
df1<-read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv")
df1
## Ammonium StirRate Temperature Density
## 1 2 100 8 14.68
## 2 2 100 8 15.18
## 3 30 100 8 15.12
## 4 30 100 8 17.48
## 5 2 150 8 7.54
## 6 2 150 8 6.66
## 7 30 150 8 12.46
## 8 30 150 8 12.62
## 9 2 100 40 10.95
## 10 2 100 40 17.68
## 11 30 100 40 12.65
## 12 30 100 40 15.96
## 13 2 150 40 8.03
## 14 2 150 40 8.84
## 15 30 150 40 14.96
## 16 30 150 40 14.96
Assume Ammonium, Stir Rate, and Temperature are factors with fixed effects, each with two levels, and the design is replicated twice.
Write the model equation for a full 2^3 factorial model
\[y_{ijkl}=\mu+\alpha_i+\beta_j+\gamma_k+\alpha\beta_{ij}+\alpha\gamma_{ik}+\beta\gamma_{jk}+\alpha\beta\gamma_{ijk}+\epsilon_{ijkl}\] Where: \[\alpha=\text{Effect of Ammonium}\]
\[\beta=\text{Effect of Stir Rate}\]
\[\gamma=\text{Effect of Temperature}\]
What factors are deemed significant, using α=.05 as a guide. Report final p-values of significant factors (and interaction plots if necessary). Show all interactions in your answer, commenting which factors are dropped and why.
Three factor interaction test
library(GAD)
df1$Ammonium<-as.fixed(df1$Ammonium)
df1$StirRate<-as.fixed(df1$StirRate)
df1$Temperature<-as.fixed(df1$Temperature)
model1<-aov(Density~Ammonium*StirRate*Temperature,data=df1)
GAD::gad(model1)
## $anova
## Analysis of Variance Table
##
## Response: Density
## Df Sum Sq Mean Sq F value Pr(>F)
## Ammonium 1 44.389 44.389 11.1803 0.010175 *
## StirRate 1 70.686 70.686 17.8037 0.002918 **
## Temperature 1 0.328 0.328 0.0826 0.781170
## Ammonium:StirRate 1 28.117 28.117 7.0817 0.028754 *
## Ammonium:Temperature 1 0.022 0.022 0.0055 0.942808
## StirRate:Temperature 1 10.128 10.128 2.5510 0.148890
## Ammonium:StirRate:Temperature 1 1.519 1.519 0.3826 0.553412
## Residuals 8 31.762 3.970
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The p-value of the three factor interaction is 0.553412 which is greater than the alpha = 0.05; therefore, the three factor interaction can be dropped from the model in the next iteration.
Two factor interaction tests
model2<-aov(Density~Ammonium*StirRate+Ammonium*Temperature+StirRate*Temperature,data=df1)
GAD::gad(model2)
## $anova
## Analysis of Variance Table
##
## Response: Density
## Df Sum Sq Mean Sq F value Pr(>F)
## Ammonium 1 44.389 44.389 12.0037 0.007109 **
## StirRate 1 70.686 70.686 19.1150 0.001792 **
## Temperature 1 0.328 0.328 0.0886 0.772681
## Ammonium:StirRate 1 28.117 28.117 7.6033 0.022206 *
## Ammonium:Temperature 1 0.022 0.022 0.0059 0.940538
## StirRate:Temperature 1 10.128 10.128 2.7389 0.132317
## Residuals 9 33.281 3.698
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The p-value of the two factor interaction between Ammonium & Temperature is 0.940538 which is greater than alpha = 0.05; therefore, this two factor interaction will be dropped from the model in the next iteration. Of the three two factor interactions this one was removed first because it is the most insignificant (highest p-value).
Two factor interaction tests without Ammonium:Temperature interaction
## two factor int removed ammonium * temp
model3<-aov(Density~Ammonium*StirRate+StirRate*Temperature,data=df1)
GAD::gad(model3)
## $anova
## Analysis of Variance Table
##
## Response: Density
## Df Sum Sq Mean Sq F value Pr(>F)
## Ammonium 1 44.389 44.389 13.3287 0.0044560 **
## StirRate 1 70.686 70.686 21.2250 0.0009696 ***
## Temperature 1 0.328 0.328 0.0984 0.7601850
## Ammonium:StirRate 1 28.117 28.117 8.4426 0.0156821 *
## StirRate:Temperature 1 10.128 10.128 3.0412 0.1117751
## Residuals 10 33.303 3.330
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The p-value of the two factor interaction between StirRate & Temperature is 0.1117751 which is greater than alpha = 0.05; therefore, this two factor interaction will be dropped from the model in the next iteration. Of the two remaining two factor interactions this one was removed because it is the most insignificant (highest p-value).
Two factor interaction test on Ammonium:StirRate
model4<-aov(Density~Ammonium+StirRate+Temperature+Ammonium*StirRate,data=df1)
GAD::gad(model4)
## $anova
## Analysis of Variance Table
##
## Response: Density
## Df Sum Sq Mean Sq F value Pr(>F)
## Ammonium 1 44.389 44.389 11.2425 0.006443 **
## StirRate 1 70.686 70.686 17.9028 0.001410 **
## Temperature 1 0.328 0.328 0.0830 0.778613
## Ammonium:StirRate 1 28.117 28.117 7.1211 0.021851 *
## Residuals 11 43.431 3.948
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The p-value of the two factor interaction between Ammonium & StirRate is 0.021851 which is less than alpha = 0.05; therefore, there is sufficient evidence that there is a significant interaction effect between Ammonium and StirRate. Since we have a significant two factor interaction, the main effects of this experiment will not be test for significance.
Interaction Plot between Ammonium & Stirrate
interaction.plot(x.factor = df1$StirRate, trace.factor = df1$Ammonium,
response = df1$Density, fun = mean,
trace.label = "NH4 %", ylab = "Mean Density",
xlab = "Stir Rate, RPM", col = c("red","blue"))
The interaction plot above illustrates the interaction effects of Ammonia and stir rate. Since the two lines are not parallel this is an indication of an interaction between the two effects, the effect of stir rate depends on the ammonia level.
At 30% ammonium, the density drops roughly 1.5 g/cm3 from 100 rpm to 150 rpm.
At 2% ammonium, the density drops 6.5 g/cm3 from 100 rpm to 150 rpm.
The concentration of ammonium effects the sensitivity of the powder density to stir rate revolutions per minute.
A horticultural researcher wants to investigate how three controllable factors affect tomato yield in a greenhouse environment. You will use R and the agricolae package to create the experimental layout for this study.
| Factor | Description | Levels |
|---|---|---|
| A | Fertilizer Type | A₁ = Organic compost, A₂ = Chemical fertilizer |
| B | Irrigation Frequency | B₁ = Once per day, B₂ = Twice per day |
| C | Temperature Setting | C₁ = 22°C, C₂ = 28°C |
The experimenter wants to run a full factorial design (2³ = 8 treatments) with three replications arranged in a randomized complete block design (RCBD) to control for variation between blocks (e.g., differences among greenhouse benches). Use the design.ab() function from the agricolae package to create a 2³ factorial design with a unique seed. Display the layout with $book.
library(agricolae)
design2<-design.ab(trt = c(2,2,2),r = 3, design = "rcbd", seed = 67)
design2$book
## plots block A B C
## 1 101 1 2 1 1
## 2 102 1 1 1 2
## 3 103 1 1 2 2
## 4 104 1 2 2 1
## 5 105 1 1 1 1
## 6 106 1 2 1 2
## 7 107 1 2 2 2
## 8 108 1 1 2 1
## 9 109 2 1 2 2
## 10 110 2 2 1 1
## 11 111 2 2 1 2
## 12 112 2 1 1 2
## 13 113 2 2 2 1
## 14 114 2 2 2 2
## 15 115 2 1 1 1
## 16 116 2 1 2 1
## 17 117 3 2 2 2
## 18 118 3 1 1 2
## 19 119 3 1 2 1
## 20 120 3 2 1 2
## 21 121 3 2 2 1
## 22 122 3 1 2 2
## 23 123 3 2 1 1
## 24 124 3 1 1 1
# Question 1
## data
df1<-read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv")
df1
## three factor interaction test
library(GAD)
df1$Ammonium<-as.fixed(df1$Ammonium)
df1$StirRate<-as.fixed(df1$StirRate)
df1$Temperature<-as.fixed(df1$Temperature)
model1<-aov(Density~Ammonium*StirRate*Temperature,data=df1)
GAD::gad(model1)
## two factor interaction tests
model2<-aov(Density~Ammonium*StirRate+Ammonium*Temperature+StirRate*Temperature,data=df1)
GAD::gad(model2)
model3<-aov(Density~Ammonium*StirRate+StirRate*Temperature,data=df1)
GAD::gad(model3)
model4<-aov(Density~Ammonium+StirRate+Temperature+Ammonium*StirRate,data=df1)
GAD::gad(model4)
## Interaction Plot
interaction.plot(x.factor = df1$StirRate, trace.factor = df1$Ammonium,
response = df1$Density, fun = mean,
trace.label = "NH4 %", ylab = "Mean Density",
xlab = "Stir Rate, RPM", col = c("red","blue"))
# Question 2
library(agricolae)
design2<-design.ab(trt = c(2,2,2),r = 3, design = "rcbd", seed = 67)
design2$book