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 using a full 2^3 factorial model is:

\[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: \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_{ijkl}: \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

on the intial run of the model, the three-factor interaction has a p-value of 0.553 and is deemed non significant. We will remove this interaction and reevalute the model.

model_reduced1<-aov(Density~Ammonium+StirRate+Temperature+Ammonium:StirRate+Ammonium:Temperature+StirRate:Temperature, data=dat)
summary(model_reduced1)
##                      Df Sum Sq Mean Sq F value  Pr(>F)   
## Ammonium              1  44.39   44.39  12.004 0.00711 **
## StirRate              1  70.69   70.69  19.115 0.00179 **
## Temperature           1   0.33    0.33   0.089 0.77268   
## Ammonium:StirRate     1  28.12   28.12   7.603 0.02221 * 
## Ammonium:Temperature  1   0.02    0.02   0.006 0.94054   
## StirRate:Temperature  1  10.13   10.13   2.739 0.13232   
## Residuals             9  33.28    3.70                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

From reducing the model through elimination of the three-factor interaction, we can conclude that Ammonium and Stir Rate factors are significant while Temperature is not significant. The interaction plots are provided below.

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 interaction plots, we affirm that Ammonium and StirRate are significant and the temperature is not a significant factor.

Question 2

Introduction

A horticultural researcher wants to investigate how three controllable factors affect tomato yield in a greenhouse environment. We start by defining the factors for the experiment.

library(agricolae)


##Define Factors
Fertilizer<-c("Organic Compost","Chemical Fertilizer")
Irrigation<-c("Once per Day", "Twice per Day")
Temperature<-c("22C","28C")

We will then create the experiment using design.ab().

#Create experiment
design<-design.ab(
  trt=c(2,2,2),
  r=3,
  serie=1,
  design="rcbd",
  seed=12349
)

We can now output the experiment design.

#Display Experiment
design$book
##    plots block A B C
## 1     11     1 1 1 1
## 2     12     1 2 1 1
## 3     13     1 1 2 1
## 4     14     1 2 1 2
## 5     15     1 2 2 1
## 6     16     1 2 2 2
## 7     17     1 1 2 2
## 8     18     1 1 1 2
## 9     19     2 2 1 1
## 10    20     2 1 2 1
## 11    21     2 2 2 2
## 12    22     2 2 2 1
## 13    23     2 2 1 2
## 14    24     2 1 2 2
## 15    25     2 1 1 2
## 16    26     2 1 1 1
## 17    27     3 1 2 1
## 18    28     3 2 2 1
## 19    29     3 2 1 1
## 20    30     3 1 1 1
## 21    31     3 1 2 2
## 22    32     3 2 2 2
## 23    33     3 2 1 2
## 24    34     3 1 1 2
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)


model_reduced1<-aov(Density~Ammonium+StirRate+Temperature+Ammonium:StirRate+Ammonium:Temperature+StirRate:Temperature, data=dat)
summary(model_reduced1)
#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(agricolae)


##Define Factors
Fertilizer<-c("Organic Compost","Chemical Fertilizer")
Irrigation<-c("Once per Day", "Twice per Day")
Temperature<-c("22C","28C")
#Create experiment
design<-design.ab(
  trt=c(2,2,2),
  r=3,
  serie=1,
  design="rcbd",
  seed=12349
)

#Display Experiment
design$book