As described previously, this study analyzes data from birth weights of children in North Carolina in 2001. In this experiment, there are two 2-level factors and two 3-level factors; thus, the full factorial design is \(2^2\) * \(3^2\). Gender of the baby (sex) has two levels: male (1) or female (2). Mother smoking status (smoke) has two levels: yes (1) or no (2). The race of the mom (race) has three level: white (1), black (2), or other (3). Completed weeks of gestations (weeks) has 3 levels: pre-mature (<=36), ~full term (37-40), and past full term (>40). The dependent variable is the birth weight (weight) of the baby in ounces.
Exploratory analysis will first be conducted. Taguchi design will be used to validate the results found previously using fractional factorial design.
Randomization: As there was no control over randomization in data collection or assignment to treatments, the data will be randomized without replacement for analysis.
Replication: This study contains replicates as different mothers had children for the same duration of gestation, of the same race, babies of the same gender, and same mother smoking status.
Blocking: Blocking is used to reduce the variability of a sample. No blocking was used with this dataset. The effect of all factors is studied.
Week levels
## [1] "<=36" "37-40" ">40"
Race levels
## [1] "1" "2" "3"
Smoke levels
## [1] "1" "0"
Sex levels
## [1] "1" "2"
Taguchi Design
Taguchi designs are appropriate for datasets with 3-50 factors, few interactions between factors, and when only a few of the factors have significant effects.
A Taguchi design was first conducted for the dataset assuming the 2 factor 2-level and 3 factor 2-level model.
library(qualityTools)
## Warning: package 'qualityTools' was built under R version 3.3.2
## Loading required package: Rsolnp
## Warning: package 'Rsolnp' was built under R version 3.3.2
## Loading required package: MASS
##
## Attaching package: 'qualityTools'
## The following object is masked from 'package:stats':
##
## sigma
taguchiChoose(factors1=2, level1=2, factors2=2, level2=3)
## 2 factors on 2 levels and 2 factors on 3 levels with 0 desired interactions to be estimated
##
## Possible Designs:
##
## L36_2_3_a L36_2_3_b
##
## Use taguchiDesign("L36_2_3_a") or different to create a taguchi design object
design1 <- taguchiDesign("L36_2_3_a")
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
design1
## StandOrder RunOrder Replicate A B C D E F G H J K L M N O P Q R S T U V
## 1 11 1 1 1 2 1 2 2 1 2 2 1 1 2 2 2 1 3 2 1 3 1 3 2
## 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2
## 3 7 3 1 1 1 2 2 2 1 1 1 2 2 2 1 1 2 3 1 2 3 3 1 2
## 4 35 4 1 2 2 1 1 2 1 2 1 2 2 1 2 1 2 3 1 3 1 2 3 3
## 5 1 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
## 6 13 6 1 1 2 2 1 2 2 1 2 1 2 1 1 2 3 1 3 2 1 3 3 2
## 7 32 7 1 2 2 1 2 1 2 1 1 1 2 2 2 1 1 1 3 1 3 3 2 3
## 8 29 8 1 2 2 2 1 1 1 1 2 2 1 2 2 1 3 3 3 2 2 1 3 1
## 9 34 9 1 2 2 1 1 2 1 2 1 2 2 1 1 3 1 2 3 2 3 1 2 2
## 10 14 10 1 1 2 2 1 2 2 1 2 1 2 1 2 3 1 2 1 3 2 1 1 3
## 11 10 11 1 1 2 1 2 2 1 2 2 1 1 2 1 1 3 2 1 3 2 3 2 1
## 12 19 12 1 2 1 2 2 1 1 2 2 1 2 1 1 2 1 3 3 3 1 2 2 1
## 13 23 13 1 2 1 2 1 2 2 2 1 1 1 2 2 3 3 1 1 2 3 2 2 1
## 14 25 14 1 2 1 1 2 2 2 1 2 2 1 1 1 3 2 1 2 3 3 1 3 1
## 15 8 15 1 1 1 2 2 2 1 1 1 2 2 2 2 2 3 1 2 3 1 1 2 3
## 16 30 16 1 2 2 2 1 1 1 1 2 2 1 2 3 2 1 1 1 3 3 2 1 2
## 17 33 17 1 2 2 1 2 1 2 1 1 1 2 2 3 2 2 2 1 2 1 1 3 1
## 18 6 18 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 1 1 1 1 2 2
## 19 18 19 1 1 2 2 2 1 2 2 1 2 1 1 3 1 2 1 3 3 2 1 2 2
## 20 16 20 1 1 2 2 2 1 2 2 1 2 1 1 1 2 3 2 1 1 3 2 3 3
## 21 12 21 1 1 2 1 2 2 1 2 2 1 1 2 3 3 2 1 3 2 1 2 1 3
## 22 27 22 1 2 1 1 2 2 2 1 2 2 1 1 3 2 1 3 1 2 2 3 2 3
## 23 22 23 1 2 1 2 1 2 2 2 1 1 1 2 1 2 2 3 3 1 2 1 1 3
## 24 36 24 1 2 2 1 1 2 1 2 1 2 2 1 3 2 3 1 2 1 2 3 1 1
## 25 28 25 1 2 2 2 1 1 1 1 2 2 1 2 1 3 2 2 2 1 1 3 2 3
## 26 4 26 1 1 1 1 1 1 2 2 2 2 2 2 1 1 1 1 2 2 2 2 3 3
## 27 26 27 1 2 1 1 2 2 2 1 2 2 1 1 2 1 3 2 3 1 1 2 1 2
## 28 21 28 1 2 1 2 2 1 1 2 2 1 2 1 3 1 3 2 2 2 3 1 1 3
## 29 31 29 1 2 2 1 2 1 2 1 1 1 2 2 1 3 3 3 2 3 2 2 1 2
## 30 15 30 1 1 2 2 1 2 2 1 2 1 2 1 3 1 2 3 2 1 3 2 2 1
## 31 17 31 1 1 2 2 2 1 2 2 1 2 1 1 2 3 1 3 2 2 1 3 1 1
## 32 9 32 1 1 1 2 2 2 1 1 1 2 2 2 3 3 1 2 3 1 2 2 3 1
## 33 24 33 1 2 1 2 1 2 2 2 1 1 1 2 3 1 1 2 2 3 1 3 3 2
## 34 3 34 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3
## 35 5 35 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 1 1
## 36 20 36 1 2 1 2 2 1 1 2 2 1 2 1 2 3 2 1 1 1 2 3 3 2
## W X y
## 1 1 3 NA
## 2 2 2 NA
## 3 2 3 NA
## 4 1 2 NA
## 5 1 1 NA
## 6 1 2 NA
## 7 2 2 NA
## 8 2 1 NA
## 9 3 1 NA
## 10 2 3 NA
## 11 3 2 NA
## 12 2 3 NA
## 13 1 3 NA
## 14 2 2 NA
## 15 3 1 NA
## 16 3 2 NA
## 17 3 3 NA
## 18 2 2 NA
## 19 1 3 NA
## 20 2 1 NA
## 21 2 1 NA
## 22 1 1 NA
## 23 3 2 NA
## 24 2 3 NA
## 25 1 3 NA
## 26 3 3 NA
## 27 3 3 NA
## 28 1 2 NA
## 29 1 1 NA
## 30 3 1 NA
## 31 3 2 NA
## 32 1 2 NA
## 33 2 1 NA
## 34 3 3 NA
## 35 1 1 NA
## 36 3 1 NA
A Taguchi design was then conducted for the dataset with the 3-level factors broken down into 2-level factors. Thus, this design is for 6 factors, 2 levels. Using taguchiChoose to get design options, L8_2 was chosen for this study.
#6 factor 2-level
set.seed(17)
taguchiChoose(factors1=6, level1=2)
## 6 factors on 2 levels and 0 factors on 0 levels with 0 desired interactions to be estimated
##
## Possible Designs:
##
## L8_2 L12_2 L16_2 L32_2
##
## Use taguchiDesign("L8_2") or different to create a taguchi design object
design2 <- taguchiDesign("L8_2")
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
## Warning in `[<-`(`*tmp*`, i, value = <S4 object of class
## structure("taguchiFactor", package = "qualityTools")>): implicit list
## embedding of S4 objects is deprecated
design2
## StandOrder RunOrder Replicate A B C D E F G y
## 1 7 1 1 2 2 1 1 2 2 1 NA
## 2 1 2 1 1 1 1 1 1 1 1 NA
## 3 3 3 1 1 2 2 1 1 2 2 NA
## 4 4 4 1 1 2 2 2 2 1 1 NA
## 5 6 5 1 2 1 2 2 1 2 1 NA
## 6 8 6 1 2 2 1 2 1 1 2 NA
## 7 2 7 1 1 1 1 2 2 2 2 NA
## 8 5 8 1 2 1 2 1 2 1 2 NA
Notice the output contains 7 columns, as this Taguchi design can be used for different datasets. As the current dataset has 6 factors, the seventh column will be ignored.
Head of data table
#Load in data using Utils package
library(utils)
setwd("C:/Users/Alexis/Documents/R/win-library/3.3")
df <- read.csv("120316_project3birthweightdata.csv", header = TRUE)
df <- df[complete.cases(df),]
#Show first 3 rows of data table
head(df, 3)
## ID weeks race sex smoke weight
## 1 1 37-40 1 1 0 111
## 2 2 37-40 1 2 0 116
## 3 3 37-40 1 1 0 138
First, exploratory boxplots were conducted to study the individual levels of all factors.
#Boxplot examining levels of each factor for exploratory analysis
boxplotweeks <- boxplot(df$weight~df$weeks, xlab = "Weeks of Gestation", ylab = "Birth Weight", main = "Birth Weight vs. Weeks of Gestation")
boxplotrace <- boxplot(df$weight~df$race, xlab = "Race of mother", ylab = "Birth Weight", main = "Birth Weight vs. Race of Mother")
boxplotsmoke <- boxplot(df$weight~df$smoke, xlab = "Mother Smoking Status", ylab = "Birth Weight", main = "Birth Weight vs. Mother Smoking Status")
boxplotsex <- boxplot(df$weight~df$sex, xlab = "Gender of Baby", ylab = "Birth Weight", main = "Birth Weight vs. Gender of Baby")
Selection of response values for Taguchi Design experiment
df3 <- read.csv("121416_DoE_TaguchiDesign.csv", header = TRUE)
head(df3,8)
## run sex1 smoke1 race1 race2 weeks1 weeks2 sex smoke race weeks
## 1 1 1 1 0 0 1 1 low high high med
## 2 2 0 0 0 0 0 0 high high low high
## 3 3 0 1 1 0 0 1 low low low low
## 4 4 0 1 1 1 1 0 high low high med
## 5 5 1 0 1 1 0 1 low high med med
## 6 6 1 1 0 1 0 0 low low med high
## 7 7 0 0 0 1 1 1 high high med low
## 8 8 1 0 1 0 1 0 high low med med
In both the Taguchi Design matrix as well as the datasheet, 2-level factors were changed to “0” and “1” for low and high levels, respectively. Three-level factors were changed to “0”, “1”, and “2” for low, medium, and high levels, respectively.
vars2 <- cbind.data.frame(df$sex, df$smoke, df$race, df$weeks)
combos2 <- cbind.data.frame(df3$sex, df3$smoke, df3$race, df3$weeks)
vars2[,4] <- as.character(vars2[,4])
vars2[which(vars2[,1]==1),1] <- 0
vars2[which(vars2[,1]==2),1] <- 1
vars2[which(vars2[,2]==0),2] <- 0
vars2[which(vars2[,2]==1),2] <- 1
vars2[which(vars2[,3]==1),3] <- 0
vars2[which(vars2[,3]==2),3] <- 1
vars2[which(vars2[,3]==3),3] <- 2
vars2[which(vars2[,4]=="<=36"),4] <- 0
vars2[which(vars2[,4]=="37-40"),4] <- 1
vars2[which(vars2[,4]==">40"),4] <- 2
combos2[,1] <- as.character(combos2[,1])
combos2[which(combos2[,1]=="low"),1] <- 0
combos2[which(combos2[,1]=="high"),1] <- 1
combos2[,2] <- as.character(combos2[,2])
combos2[which(combos2[,2]=="low"),2] <- 0
combos2[which(combos2[,2]=="high"),2] <- 1
combos2[,3] <- as.character(combos2[,3])
combos2[which(combos2[,3]=="low"),3] <- 0
combos2[which(combos2[,3]=="med"),3] <- 1
combos2[which(combos2[,3]=="high"),3] <- 2
combos2[,4] <- as.character(combos2[,4])
combos2[which(combos2[,4]=="low"),4] <- 0
combos2[which(combos2[,4]=="med"),4] <- 1
combos2[which(combos2[,4]=="high"),4] <- 2
combos2[,1] <- as.numeric(combos2[,1])
combos2[,2] <- as.numeric(combos2[,2])
combos2[,3] <- as.numeric(combos2[,3])
combos2[,4] <- as.numeric(combos2[,4])
## Warning: NAs introduced by coercion
Using a for loop, the Taguchi Design matrix was scanned one row at a time to determine matching level combinations within the dataset. Matching combinations were randomly selected, and data was stored for ANOVA.
good2 <- matrix(0,nrow(combos2))
for (i in 1:nrow(combos2))
{
set.seed(17)
row_i <- combos2[i,]
row_i <- as.numeric(row_i)
indexes <- which(vars2[,1]==row_i[1] & vars2[,2]==row_i[2] & vars2[,3]==row_i[3] & vars2[,4]==row_i[4])
if(length(indexes)>0)
{
temp <- sample(1:length(indexes),size = 1, replace=FALSE)
good2[i] <- indexes[temp]
}
}
After the for loop was used to match levels in the Taguchi Design, the output is shown below in the design matrix table.
ans2 <- df$weight[good2]
ans2 <- c(ans2[1:8])
ans2
## [1] 105 117 20 153 108 126 84 117
response(design2) <- ans2
summary(design2)
## Taguchi SINGLE Design
## Information about the factors:
##
## A B C D E F G
## value 1 1 1 1 1 1 1 1
## value 2 2 2 2 2 2 2 2
## name
## unit
## type numeric numeric numeric numeric numeric numeric numeric
##
## -----------
##
## StandOrder RunOrder Replicate A B C D E F G ans2
## 1 7 1 1 2 2 1 1 2 2 1 105
## 2 1 2 1 1 1 1 1 1 1 1 117
## 3 3 3 1 1 2 2 1 1 2 2 20
## 4 4 4 1 1 2 2 2 2 1 1 153
## 5 6 5 1 2 1 2 2 1 2 1 108
## 6 8 6 1 2 2 1 2 1 1 2 126
## 7 2 7 1 1 1 1 2 2 2 2 84
## 8 5 8 1 2 1 2 1 2 1 2 117
##
## -----------
Main Effects
Main effects were then calculated for the 6 factors, listed in a table below.
me_sex <- 1/4 * ((ans2[1] + ans2[5] + ans2[6] + ans2[8]) - (ans2[4] + ans2[2] + ans2[3] + ans2[7]))
me_smoke <- 1/4 * ((ans2[1] + ans2[3] + ans2[4] + ans2[6]) - (ans2[2] + ans2[5] + ans2[7] + ans2[8]))
me_race1 <- 1/4 * ((ans2[3] + ans2[4] + ans2[5] + ans2[8]) - (ans2[1] + ans2[2] + ans2[6] + ans2[7]))
me_race2 <- 1/4 * ((ans2[4] + ans2[5] + ans2[6] + ans2[7]) - (ans2[1] + ans2[2] + ans2[3] + ans2[8]))
me_weeks1 <- 1/4 * ((ans2[1] + ans2[4] + ans2[7] + ans2[8]) - (ans2[2] + ans2[3] + ans2[5] + ans2[6]))
me_weeks2 <- 1/4 * ((ans2[1] + ans2[3] + ans2[5] + ans2[7]) - (ans2[2] + ans2[4] + ans2[6] + ans2[8]))
me <- as.matrix(c(me_sex,me_smoke,me_race1,me_race2,me_weeks1,me_weeks2))
rownames(me) <- c("me_sex","me_smoke","me_race1","me_race2","me_weeks1","me_weeks2")
colnames(me) <- c("effects")
me
## effects
## me_sex 20.5
## me_smoke -5.5
## me_race1 -8.5
## me_race2 28.0
## me_weeks1 22.0
## me_weeks2 -49.0
The seventh plot does not represent this dataset–the Taguchi design contains an extra column; however, there is no seventh factor in this dataset. Ultimately, these results agree with the calculated main effects, that both gender of the baby and weeks of gestation have the greatest effect (demonstrated by the steepest slopes in the plots A, E, and F).
effectPlot(design2, main = "Main Effect Plots", ylab = "birth weight", col = 2)
ANOVA
Selected Factors
Finally, an ANOVA was run based on the main effect data. Based on the main effect calculation and main effect plots, gender of the baby and weeks of gestation were included in the linear model. Both factors had significant effect by ANOVA.
fit <- aov(df$weight~ df$sex + df$weeks)
summary(fit)
## Df Sum Sq Mean Sq F value Pr(>F)
## df$sex 1 2000 2000 5.386 0.0204 *
## df$weeks 2 182888 91444 246.265 <2e-16 ***
## Residuals 1441 535076 371
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
All Factors
However, as the fractional factorial design utilized all factors, this was examined here as well. Again, all factors demonstrated significance. Interestingly, mothers smoking, which does not appear to have a large main effect by the main effect graph or the main effect calculation shows that the effect seen is due to more than that from randomization alone.
fit2 <- aov(df$weight~ df$sex + df$smoke + df$race + df$weeks)
summary(fit2)
## Df Sum Sq Mean Sq F value Pr(>F)
## df$sex 1 2000 2000 5.492 0.01924 *
## df$smoke 1 12597 12597 34.591 5.05e-09 ***
## df$race 1 3177 3177 8.724 0.00319 **
## df$weeks 2 178151 89075 244.599 < 2e-16 ***
## Residuals 1439 524039 364
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Model Adequacy Checking Model adequacy checking was done to determine the legitmacy of the model. The residuals vs. fitted plot shows a uniform distribution of values. The QQ-plot only has some deviation for negative theoretical quantiles (same fit as for all factors) suggesting a relatively good model but one that still could be improved.
plot(fit, which = c(1:2), caption = list("Residuals vs Fitted", "Normal Q-Q"))
Conclusions
Taguchi design is most appropriate for 3 to 50 factors, and this experiment contains 4. Fractional factorial design is most appropriate for only a few factors, where all are significant, and strong interactions are present. These models are similar to the model derived from the fractional factorial design, but they could be improved based on the normal Q-Q plot.
These Taguchi design results suggest mothers smoking and weeks of gestation have the greatest effect on the birth weight of babies. However, the plots did not show an effect for mother smoking while ANOVA displays p-values of E-9. A linear model using all four factors displays similar model accuracy to the two-factor model and exhibits significance for all factors by ANOVA. These results are suggestive that the Taguchi design is less appropriate for this data set. Thus, while both designs display similar results, fractional factorial design is more appropriate, as all factors display significant effects by ANOVA.
No additional commenting was added to the code.