Question 1

Introduction

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 may be downloaded from here: https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv

# Load Data from provided URL
url <- "https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv"
dat <- read.csv(url)


#Convert independent variables to factors
dat$StirRate<-as.factor(dat$StirRate)
dat$Temperature<-as.factor(dat$Temperature)
dat$Ammonium<-as.factor(dat$Ammonium)

Model Equation

the model equation for this experiment is:

\[Y_{ijkm}=\mu+\alpha_i + \beta_j + \gamma_k + \alpha\beta_{ij} + \alpha\gamma_{ik} + \beta\gamma_{jk} + \alpha\beta\gamma_{ijk} + \epsilon_{ijkm}\] Where:

\[\mu: \text{ overall mean}\] \[\alpha_i: \text{ effect of Ammonium}\] \[\beta_j: \text{ effect of Stir Rate}\] \[\gamma_k: \text{ effect of Temperature}\] \[(\alpha\beta)_{ij}: \text{ Ammonium-Stir Rate interaction}\] \[(\alpha\gamma)_{ik}: \text{ Ammonium-Temperature interaction}\] \[(\beta\gamma)_{jk}: \text{Stir Rate-Temperature interaction}\] \[(\alpha\beta\gamma)_{ijk}: \text{ three-way interaction}\] \[\epsilon_{ijkm}: \text{random error}\]

Model of Data

We will fit this data to a model and look at the significant factors.

#Create the model
model<-aov(Density~Ammonium*StirRate*Temperature, data=dat)
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

Ammonium X Stir Rate Interaction Plot

#Ammonium X StirRate Interaction Plot
interaction.plot(dat$StirRate,dat$Ammonium, dat$Density, 
                 xlab = " Stir Rate (RPM)",
                 ylab="Density", 
                 col=c("Blue","Green")
                 )

Ammonium X Temperature Interaction Plot

#Ammonium X Temperature Interaction Plot
interaction.plot(dat$Temperature,dat$Ammonium, dat$Density, 
                 xlab = "Temperature (°C)",
                 ylab="Density", 
                 col=c("Green","Red")
                 )

Stir Rate X Temperature Interaction Plot

#StirRate X Temperature Interaction Plot
interaction.plot(dat$Temperature,dat$StirRate, dat$Density, 
                 xlab = "Temperature (°C)",
                 ylab="Density", 
                 col=c("Orange","Blue")
                 )

From the summary of the model and using a significance level of \(\alpha=0.05\), we can conclude that since the StirRate (p-value = 0.01018) and Ammonium (p-value=0.00292) p=values are less than 0.05, then those two factors are statistically significant. Temperature is not a significant factor. The interactions are not significant since none cross each other.

Question 2

Introduction

A full factorial experiment was conducted to determine whether either firing temperature or furnace position affects the baked density of a carbon anode.

library(GAD)
library(mirt)

#Load data and define factors
Temperature <- as.fixed(rep(c(800, 825, 850), each = 6))
Position <- as.fixed(rep(c(1, 2), each = 3, times = 3))
Density <- c(
              570, 1063, 565, 565, 1080, 510, 
              583, 1043, 590, 528, 988, 526, 
              547, 1026, 538, 521, 1004, 532
              )

AnovaData<-data.frame(Temperature, Position, Density)
#AnovaData$Temperature<-as.fixed(AnovaData$Temperature)
#AnovaData$Position<-as.fixed(AnovaData$Position)

Part A

model<-lm(Density~Temperature+Position+Temperature*Position, data=AnovaData)
gad(model)
## $anova
## Analysis of Variance Table
## 
## Response: Density
##                      Df Sum Sq Mean Sq F value Pr(>F)
## Temperature           2   2853    1426  0.0180 0.9822
## Position              1   4080    4080  0.0515 0.8242
## Temperature:Position  2   1760     880  0.0111 0.9890
## Residuals            12 949998   79167

Assuming that both the temperature and position are fixed, the p-values for Temperature and Position are .9822 and .8242, respectively. If we use an \(\alpha=0.05\), then neither factors or interaction are significant.

Part B

#Reload Data as random
Temperature <- as.random(rep(c(800, 825, 850), each = 6))
Position <- as.random(rep(c(1, 2), each = 3, times = 3))
Density <- c(
              570, 1063, 565, 565, 1080, 510, 
              583, 1043, 590, 528, 988, 526, 
              547, 1026, 538, 521, 1004, 532
              )

#Create Data Frame
AnovaData<-data.frame(Temperature, Position, Density)

#Create Model and GAD
model<-lm(Density~Temperature+Position+Temperature*Position, data=AnovaData)
gad(model)
## $anova
## Analysis of Variance Table
## 
## Response: Density
##                      Df Sum Sq Mean Sq F value Pr(>F)
## Temperature           2   2853    1426  1.6208 0.3816
## Position              1   4080    4080  4.6361 0.1642
## Temperature:Position  2   1760     880  0.0111 0.9890
## Residuals            12 949998   79167

Assuming that both the temperature and position are random, the p-values for Temperature and Position are .3816 and .1642, respectively.If we use an \(\alpha=0.05\), then neither factors or interaction are significant.

Part C

#Reload Data as random/fixed
Temperature<- as.random(rep(c(800, 825, 850), each = 6))
Position<- as.fixed(rep(c(1, 2), each = 3, times = 3))
Density<- c(
              570, 1063, 565, 565, 1080, 510, 
              583, 1043, 590, 528, 988, 526, 
              547, 1026, 538, 521, 1004, 532
              )

#Create Data Frame
AnovaData<-data.frame(Temperature, Position, Density)

#Create Model and GAD
model<-lm(Density~Temperature+Position+Temperature*Position, data=AnovaData)
gad(model)
## $anova
## Analysis of Variance Table
## 
## Response: Density
##                      Df Sum Sq Mean Sq F value Pr(>F)
## Temperature           2   2853    1426  0.0180 0.9822
## Position              1   4080    4080  4.6361 0.1642
## Temperature:Position  2   1760     880  0.0111 0.9890
## Residuals            12 949998   79167

Assuming that both the temperature and position are random, the p-values for Temperature and Position are .9822 and .1642, respectively.If we use an \(\alpha=0.05\), then neither factors or interaction are significant.

Part D

In each of the three scenarios, the p-value for the interaction are identical (.9890). When switching from fixed to random, the p-values for Temperature and Position change, but are never significant.

knitr::opts_chunk$set(echo=TRUE, warning=FALSE, message=FALSE)
# Load Data from provided URL
url <- "https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv"
dat <- read.csv(url)


#Convert independent variables to factors
dat$StirRate<-as.factor(dat$StirRate)
dat$Temperature<-as.factor(dat$Temperature)
dat$Ammonium<-as.factor(dat$Ammonium)


#Create the model
model<-aov(Density~Ammonium*StirRate*Temperature, data=dat)
summary(model)






#Ammonium X StirRate Interaction Plot
interaction.plot(dat$StirRate,dat$Ammonium, dat$Density, 
                 xlab = " Stir Rate (RPM)",
                 ylab="Density", 
                 col=c("Blue","Green")
                 )
#Ammonium X Temperature Interaction Plot
interaction.plot(dat$Temperature,dat$Ammonium, dat$Density, 
                 xlab = "Temperature (°C)",
                 ylab="Density", 
                 col=c("Green","Red")
                 )
#StirRate X Temperature Interaction Plot
interaction.plot(dat$Temperature,dat$StirRate, dat$Density, 
                 xlab = "Temperature (°C)",
                 ylab="Density", 
                 col=c("Orange","Blue")
                 )
library(GAD)
library(mirt)

#Load data and define factors
Temperature <- as.fixed(rep(c(800, 825, 850), each = 6))
Position <- as.fixed(rep(c(1, 2), each = 3, times = 3))
Density <- c(
              570, 1063, 565, 565, 1080, 510, 
              583, 1043, 590, 528, 988, 526, 
              547, 1026, 538, 521, 1004, 532
              )

AnovaData<-data.frame(Temperature, Position, Density)
#AnovaData$Temperature<-as.fixed(AnovaData$Temperature)
#AnovaData$Position<-as.fixed(AnovaData$Position)

model<-lm(Density~Temperature+Position+Temperature*Position, data=AnovaData)
gad(model)
#Reload Data as random
Temperature <- as.random(rep(c(800, 825, 850), each = 6))
Position <- as.random(rep(c(1, 2), each = 3, times = 3))
Density <- c(
              570, 1063, 565, 565, 1080, 510, 
              583, 1043, 590, 528, 988, 526, 
              547, 1026, 538, 521, 1004, 532
              )

#Create Data Frame
AnovaData<-data.frame(Temperature, Position, Density)

#Create Model and GAD
model<-lm(Density~Temperature+Position+Temperature*Position, data=AnovaData)
gad(model)

#Reload Data as random/fixed
Temperature<- as.random(rep(c(800, 825, 850), each = 6))
Position<- as.fixed(rep(c(1, 2), each = 3, times = 3))
Density<- c(
              570, 1063, 565, 565, 1080, 510, 
              583, 1043, 590, 528, 988, 526, 
              547, 1026, 538, 521, 1004, 532
              )

#Create Data Frame
AnovaData<-data.frame(Temperature, Position, Density)

#Create Model and GAD
model<-lm(Density~Temperature+Position+Temperature*Position, data=AnovaData)
gad(model)