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) as the response variable and critical characteristics of this product. The data is shown below.

# Read in the data table for 14.1
dat141<-read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv")
names(dat141)[names(dat141) == "ï..Ammonium"] <- "Ammonium"
dat141
##    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

The data may be downloaded from here: https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv

Assume Ammonium, Stir Rate, and Temperature are factors with fixed effects, each with two levels, and the design is replicated twice.

(a) Write the model equation for a full factorial model

The following equation describes the components of the full factorial model:

(b) What factors are deemed significant, using a=.05 as a guide. Report final p-values of significant factors (and interaction plots if necessary).

The significant factors are:

Because the interaction of Ammonium and StirRate is significant, we must produce an interaction plot for these factors

# change factor variables into factors
dat141$Ammonium <- as.factor(dat141$Ammonium)
dat141$StirRate <- as.factor(dat141$StirRate)
dat141$Temperature <- as.factor(dat141$Temperature)
str(dat141)
## 'data.frame':    16 obs. of  4 variables:
##  $ Ammonium   : Factor w/ 2 levels "2","30": 1 1 2 2 1 1 2 2 1 1 ...
##  $ StirRate   : Factor w/ 2 levels "100","150": 1 1 1 1 2 2 2 2 1 1 ...
##  $ Temperature: Factor w/ 2 levels "8","40": 1 1 1 1 1 1 1 1 2 2 ...
##  $ Density    : num  14.68 15.18 15.12 17.48 7.54 ...
# Apply analysis of variance model
model141 <- lm(Density ~ Ammonium+StirRate+Temperature+Ammonium:StirRate+Ammonium:Temperature+StirRate:Temperature+Ammonium:StirRate:Temperature, dat141)
anova(model141)
## 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
# Produce an interaction plot
interaction.plot(x.factor     = dat141$Ammonium,
                 trace.factor = dat141$StirRate,
                 response     = dat141$Density,
                 fun = mean,
                 type="b",             ### Show plot points as symbols
                 col=c("steelblue","firebrick2"),  ### Colors for levels of trace var.
                 pch=c(19, 17, 15),    ### Symbols for levels of trace var.
                 fixed=TRUE,           ### Order by factor order in data
                 leg.bty = "o")        ### Legend box

2.

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

# Read in the data table for 14.2
dat142<-read.csv("https://raw.githubusercontent.com/forestwhite/RStatistics/main/142Table.csv")
dat142
##    Position Temperature Density
## 1         1         800     570
## 2         1         800     565
## 3         1         800     583
## 4         1         825    1063
## 5         1         825    1080
## 6         1         825    1043
## 7         1         850     565
## 8         1         850     510
## 9         1         850     590
## 10        2         800     528
## 11        2         800     547
## 12        2         800     521
## 13        2         825     988
## 14        2         825    1026
## 15        2         825    1004
## 16        2         850     526
## 17        2         850     538
## 18        2         850     532

(a) Assume that both Temperature and Position are fixed effects. Report p-values

The P-values for each factor and the interaction are:

# designate fixed factors as fixed
library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
Position <- as.fixed(dat142$Position)
Position
##  [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
## Levels: 1 2
Temperature <- as.fixed(dat142$Temperature)
Temperature
##  [1] 800 800 800 825 825 825 850 850 850 800 800 800 825 825 825 850 850 850
## Levels: 800 825 850
# Apply analysis of variance model
model142 <- lm(dat142$Density ~ Position+Temperature+Position*Temperature)
gad(model142)
## Analysis of Variance Table
## 
## Response: dat142$Density
##                      Df Sum Sq Mean Sq  F value   Pr(>F)    
## Position              1   7160    7160   15.998 0.001762 ** 
## Temperature           2 945342  472671 1056.117 3.25e-14 ***
## Position:Temperature  2    818     409    0.914 0.427110    
## Residual             12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(b) Assume that both Temperature and Position are random effects. Report p-values

The P-values for each factor and the interaction are:

# designate random factors as random
library(GAD)
Position <- as.random(dat142$Position)
Position
##  [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
## Levels: 1 2
Temperature <- as.random(dat142$Temperature)
Temperature
##  [1] 800 800 800 825 825 825 850 850 850 800 800 800 825 825 825 850 850 850
## Levels: 800 825 850
# Apply analysis of variance model
model142 <- lm(dat142$Density ~ Position+Temperature+Position*Temperature)
gad(model142)
## Analysis of Variance Table
## 
## Response: dat142$Density
##                      Df Sum Sq Mean Sq  F value    Pr(>F)    
## Position              1   7160    7160   17.504 0.0526583 .  
## Temperature           2 945342  472671 1155.518 0.0008647 ***
## Position:Temperature  2    818     409    0.914 0.4271101    
## Residual             12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(c) Assume the Position effect is fixed and the Temperature effect is random. Report p-values

The P-values for each factor and the interaction are:

# designate fixed factors as fixed
library(GAD)
Position <- as.fixed(dat142$Position)
Position
##  [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
## Levels: 1 2
# designate random factors as random
Temperature <- as.random(dat142$Temperature)
Temperature
##  [1] 800 800 800 825 825 825 850 850 850 800 800 800 825 825 825 850 850 850
## Levels: 800 825 850
# Apply analysis of variance model
model142 <- lm(dat142$Density ~ Position+Temperature+Position*Temperature)
gad(model142)
## Analysis of Variance Table
## 
## Response: dat142$Density
##                      Df Sum Sq Mean Sq  F value   Pr(>F)    
## Position              1   7160    7160   17.504  0.05266 .  
## Temperature           2 945342  472671 1056.117 3.25e-14 ***
## Position:Temperature  2    818     409    0.914  0.42711    
## Residual             12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(d) Comment on similarities and/or differences between the p-values in parts a,b,c.

The p-values for the interaction stays consistent across parts a, b, and c at a value of 0.427. Interestingly, the p-value for Temperature is the same for parts a and c (in a Temperature is fixed, in c it is random), while it increases in part b (when Temperature is random). The same phenomenon occurs for Position, which has a similar p-value in parts b and c (in part b Position is random, in part c Position is fixed), while it is smaller in part a.

The Temperature variable in all cases is significant, whether it was a random or fixed effect.

The Position variable was significant when it was a fixed effect (part a) and the temperature is a fixed effect but not when it was a random effect (part b) nor when the temperature is a random effect (part c).

The interaction between Temperature and Position is not significant in any case.

The p-values for random factors on their own were generally less definitely significant and less precise than fixed factors, which is reasonable considering random effects are compared to the interaction while fixed effects are compared to error. The p-values for the interactions of the factors was nearly identical whether the factors were random or fixed, which also follows from interactions always being compared to error.

Complete Code

Here we display the complete R code used in this analysis.

# Read in the data table for 14.1
dat141<-read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv")
names(dat141)[names(dat141) == "ï..Ammonium"] <- "Ammonium"
dat141

# change factor variables into factors
dat141$Ammonium <- as.factor(dat141$Ammonium)
dat141$StirRate <- as.factor(dat141$StirRate)
dat141$Temperature <- as.factor(dat141$Temperature)
str(dat141)

# Apply analysis of variance model
model141 <- lm(Density ~ Ammonium+StirRate+Temperature+Ammonium:StirRate+Ammonium:Temperature+StirRate:Temperature+Ammonium:StirRate:Temperature, dat141)
anova(model141)

# Produce an interaction plot
interaction.plot(x.factor     = dat141$Ammonium,
                 trace.factor = dat141$StirRate,
                 response     = dat141$Density,
                 fun = mean,
                 type="b",             ### Show plot points as symbols
                 col=c("steelblue","firebrick2"),  ### Colors for levels of trace var.
                 pch=c(19, 17, 15),    ### Symbols for levels of trace var.
                 fixed=TRUE,           ### Order by factor order in data
                 leg.bty = "o")        ### Legend box

# Read in the data table for 14.2
dat142<-read.csv("https://raw.githubusercontent.com/forestwhite/RStatistics/main/142Table.csv")
dat142

# designate fixed factors as fixed
library(GAD)
Position <- as.fixed(dat142$Position)
Position
Temperature <- as.fixed(dat142$Temperature)
Temperature

# Apply analysis of variance model
model142 <- lm(dat142$Density ~ Position+Temperature+Position*Temperature)
gad(model142)

# designate random factors as random
library(GAD)
Position <- as.random(dat142$Position)
Position
Temperature <- as.random(dat142$Temperature)
Temperature

# Apply analysis of variance model
model142 <- lm(dat142$Density ~ Position+Temperature+Position*Temperature)
gad(model142)

# designate fixed factors as fixed
library(GAD)
Position <- as.fixed(dat142$Position)
Position
# designate random factors as random
Temperature <- as.random(dat142$Temperature)
Temperature

# Apply analysis of variance model
model142 <- lm(dat142$Density ~ Position+Temperature+Position*Temperature)
gad(model142)