1 Problems

  1. 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. Assume Ammonium, Stir Rate, and Temperature are factors with fixed effects, each with two levels, and the design is replicated twice.
  1. Write the model equation for a full 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: \(\mu\) is the overall mean.

\(\alpha_i\) is the main effect of Ammonium (\(i = 1, 2\)).

\(\beta_j\) is the main effect of Stir Rate (\(j = 1, 2\)).

\(\gamma_k\) is the main effect of Temperature (\(k = 1, 2\)).

\(\alpha\beta_{ij}, \alpha\gamma_{ik}, \beta\gamma_{jk}\) are the two-factor interactions.

\(\alpha\beta\gamma_{ijk}\) is the three-factor interaction.

\(\epsilon_{ijkl}\) is the random error component, \(\epsilon_{ijkl} \sim N(0, \sigma^2)\).

  1. What factors are deemed significant, using < = 0.05 as a guide. Report final p-values of significant factors (and interaction plots if necessary).
# Data
url <- "https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv"
df <- read.csv(url)

# Variables to factors
df$Ammonium <- as.factor(df$Ammonium)
df$StirRate <- as.factor(df$StirRate)
df$Temperature <- as.factor(df$Temperature)

# Fit the full factorial ANOVA model
model <- aov(Density ~ Ammonium * StirRate * Temperature, data = df)
summary(model)
##                               Df Sum Sq Mean Sq F value  Pr(>F)   
## Ammonium                       1  44.39   44.39  11.180 0.01018 * 
## StirRate                       1  70.69   70.69  17.804 0.00292 **
## Temperature                    1   0.33    0.33   0.083 0.78117   
## Ammonium:StirRate              1  28.12   28.12   7.082 0.02875 * 
## Ammonium:Temperature           1   0.02    0.02   0.005 0.94281   
## StirRate:Temperature           1  10.13   10.13   2.551 0.14889   
## Ammonium:StirRate:Temperature  1   1.52    1.52   0.383 0.55341   
## Residuals                      8  31.76    3.97                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  • Significant Main Effects: Ammonium (p = 0.01018) and Stir Rate (p = 0.00292).
  • Significant Interaction: Ammonium vs Stir Rate (p = 0.02875).
  • Non-Significant Factors: Temperature and all higher-order interactions involving Temperature (p > 0.05).
  1. A full factorial experiment was conducted to determine whether either firing temperature or furnace position affects the baked density of a carbon anode. (hint: use expand.table() in R to help generate the dataframe and use the package GAD to account for fixed and random effects in the ANOVA model).
# Data
density <- c(
  570, 565, 583,  
  1063, 1080, 1043, 
  565, 510, 590,  
  528, 547, 521,  
  988, 1026, 1004, 
  526, 538, 532   
)

position <- as.factor(rep(1:2, each = 9))
temperature <- as.factor(rep(rep(c(800, 825, 850), each = 3), 2))

df <- data.frame(position, temperature, density)
  1. Assume that both Temperature and Position are fixed effects. Report p-values
library(GAD)
pos_fixed <- as.fixed(df$position)
temp_fixed <- as.fixed(df$temperature)

model_fixed <- gad(aov(density ~ pos_fixed * temp_fixed, data = df))
print(model_fixed)
## $anova
## Analysis of Variance Table
## 
## Response: density
##                      Df Sum Sq Mean Sq  F value   Pr(>F)    
## pos_fixed             1   7160    7160   15.998 0.001762 ** 
## temp_fixed            2 945342  472671 1056.117 3.25e-14 ***
## pos_fixed:temp_fixed  2    818     409    0.914 0.427110    
## Residuals            12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  • Position: p = 0.001762, Significant.
  • Temperature: p = 3.25e-14, Highly Significant.
  • Position vs Temperature: p = 0.427110, Not significant.
  1. Assume that both Temperature and Position are random effects. Report p-values
library(GAD)
pos_rand <- as.random(df$position)
temp_rand <- as.random(df$temperature)

model_random <- gad(aov(density ~ pos_rand * temp_rand, data = df))
print(model_random)
## $anova
## Analysis of Variance Table
## 
## Response: density
##                    Df Sum Sq Mean Sq  F value    Pr(>F)    
## pos_rand            1   7160    7160   17.504 0.0526583 .  
## temp_rand           2 945342  472671 1155.518 0.0008647 ***
## pos_rand:temp_rand  2    818     409    0.914 0.4271101    
## Residuals          12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  • Position: p = 0.05266, Marginally significant.
  • Temperature: p = 0.00087, Significant.
  • Position vs Temperature: p = 0.42711, Not significant.
  1. Assume the Position effect is fixed and the Temperature effect is random. Report p-values
library(GAD)
pos_fixed <- as.fixed(df$position)
temp_rand <- as.random(df$temperature)

model_mix <- gad(aov(density ~ pos_fixed * temp_rand, data = df))
print(model_mix)
## $anova
## Analysis of Variance Table
## 
## Response: density
##                     Df Sum Sq Mean Sq  F value   Pr(>F)    
## pos_fixed            1   7160    7160   17.504  0.05266 .  
## temp_rand            2 945342  472671 1056.117 3.25e-14 ***
## pos_fixed:temp_rand  2    818     409    0.914  0.42711    
## Residuals           12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  • Position (Fixed): p = 0.05266, Marginally significant.
  • Temperature (Random): p = 3.25e-14, Highly Significant.
  • Position vs Temperature: p = 0.42711, Not significant.
  1. Comment on similarities and/or differences between the p-values in parts a,b,c. 

Alternative A (Both Fixed): Position (p = 0.00176) and Temperature (p = 3.25e-14) are significant and interaction is not significant (p = 0.427).

Alternative B (Both Random): Temperature is significant (p = 0.00087) and Position is marginally non-significant (p = 0.0527), and interaction is not significant (p = 0.427).

Alternative C (Position Fixed, Temperature Random): Position is marginally non-significant (p = 0.0527); Temperature is highly significant (p < 0.0001); interaction is not significant (p = 0.427).

Comparison: Changing factor between fixed and random effects alters the Expected Mean Squares (EMS) denominators. The interaction uses mean square error (MSE), while main effects in random/mixed use the interaction mean square (MSAB), because of that the p-values is altered.

The p-value for the interaction (Position vs Temperature) remains the same (p = 0.42711) across all options, because of the factorial designs interaction effect is always tested against the mean square error (MSE).

2 Complete R Code

knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message = FALSE)

# Data 1
url <- "https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv"
df <- read.csv(url)

# Variables to factors
df$Ammonium <- as.factor(df$Ammonium)
df$StirRate <- as.factor(df$StirRate)
df$Temperature <- as.factor(df$Temperature)

# Fit the full factorial ANOVA model
model <- aov(Density ~ Ammonium * StirRate * Temperature, data = df)
summary(model)

# Data 2
density <- c(
  570, 565, 583,  
  1063, 1080, 1043, 
  565, 510, 590,  
  528, 547, 521,  
  988, 1026, 1004, 
  526, 538, 532   
)

position <- as.factor(rep(1:2, each = 9))
temperature <- as.factor(rep(rep(c(800, 825, 850), each = 3), 2))

df <- data.frame(position, temperature, density)

#a
library(GAD)
pos_fixed <- as.fixed(df$position)
temp_fixed <- as.fixed(df$temperature)

model_fixed <- gad(aov(density ~ pos_fixed * temp_fixed, data = df))
print(model_fixed)

#b
library(GAD)
pos_rand <- as.random(df$position)
temp_rand <- as.random(df$temperature)

model_random <- gad(aov(density ~ pos_rand * temp_rand, data = df))
print(model_random)

#c
library(GAD)
pos_fixed <- as.fixed(df$position)
temp_rand <- as.random(df$temperature)

model_mix <- gad(aov(density ~ pos_fixed * temp_rand, data = df))
print(model_mix)