Introduction

In this analysis, we use the FrF2 package in R to create and analyze factorial designs with resolution III and IV. We will also explore the relationships between factors and their interactions using visualizations like Half Normal plots and Main Effects plots.


Setup and Initialization

install.packages(“FrF2”)

library(FrF2)
## Warning: package 'FrF2' was built under R version 4.4.2
## Loading required package: DoE.base
## Loading required package: grid
## Loading required package: conf.design
## Registered S3 method overwritten by 'DoE.base':
##   method           from       
##   factorize.factor conf.design
## 
## Attaching package: 'DoE.base'
## The following objects are masked from 'package:stats':
## 
##     aov, lm
## The following object is masked from 'package:graphics':
## 
##     plot.design
## The following object is masked from 'package:base':
## 
##     lengths

Set up a resolution III design with 6 factors

des.res3 <- FrF2(nfactors = 6, resolution = 3, randomize = TRUE)
des.res3
##    A  B  C  D  E  F
## 1  1 -1 -1 -1 -1  1
## 2  1  1 -1  1 -1 -1
## 3 -1 -1 -1  1  1  1
## 4 -1  1  1 -1 -1  1
## 5 -1  1 -1 -1  1 -1
## 6 -1 -1  1  1 -1 -1
## 7  1  1  1  1  1  1
## 8  1 -1  1 -1  1 -1
## class=design, type= FrF2

Display aliased relationship

aliasprint(des.res3)
## $legend
## [1] A=A B=B C=C D=D E=E F=F
## 
## $main
## [1] A=BD=CE B=AD=CF C=AE=BF D=AB=EF E=AC=DF F=BC=DE
## 
## $fi2
## [1] AF=BE=CD

Add response data to the design

response <- c(30, 46, 46, 33, 210, 140, 262, 120)
des.resp <- add.response(des.res3, response)
summary(des.resp)
## Call:
## FrF2(nfactors = 6, resolution = 3, randomize = TRUE)
## 
## Experimental design of type  FrF2 
## 8  runs
## 
## Factor settings (scale ends):
##    A  B  C  D  E  F
## 1 -1 -1 -1 -1 -1 -1
## 2  1  1  1  1  1  1
## 
## Responses:
## [1] response
## 
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D E=E F=F
## 
## $generators
## [1] D=AB E=AC F=BC
## 
## 
## Alias structure:
## $main
## [1] A=BD=CE B=AD=CF C=AE=BF D=AB=EF E=AC=DF F=BC=DE
## 
## $fi2
## [1] AF=BE=CD
## 
## 
## The design itself:
##    A  B  C  D  E  F response
## 1  1 -1 -1 -1 -1  1       30
## 2  1  1 -1  1 -1 -1       46
## 3 -1 -1 -1  1  1  1       46
## 4 -1  1  1 -1 -1  1       33
## 5 -1  1 -1 -1  1 -1      210
## 6 -1 -1  1  1 -1 -1      140
## 7  1  1  1  1  1  1      262
## 8  1 -1  1 -1  1 -1      120
## class=design, type= FrF2

Generate Half Normal Plot

par(mar = c(5, 5, 5, 5)) # Adjust margins to avoid errors
DanielPlot(des.resp, half = TRUE)

Generate Main Effects Plot with alias information

MEPlot(des.resp, show.alias = TRUE)

Fold over the design

folded_design <- fold.design(des.res3, column = 1)
folded_design
##     A  B  C     fold  D  E  F
## 1   1 -1 -1 original -1 -1  1
## 2   1  1 -1 original  1 -1 -1
## 3  -1 -1 -1 original  1  1  1
## 4  -1  1  1 original -1 -1  1
## 5  -1  1 -1 original -1  1 -1
## 6  -1 -1  1 original  1 -1 -1
## 7   1  1  1 original  1  1  1
## 8   1 -1  1 original -1  1 -1
## 9  -1 -1 -1   mirror -1 -1  1
## 10 -1  1 -1   mirror  1 -1 -1
## 11  1 -1 -1   mirror  1  1  1
## 12  1  1  1   mirror -1 -1  1
## 13  1  1 -1   mirror -1  1 -1
## 14  1 -1  1   mirror  1 -1 -1
## 15 -1  1  1   mirror  1  1  1
## 16 -1 -1  1   mirror -1  1 -1
## class=design, type= FrF2.folded

Set up a resolution IV design with 6 factors

des.res4 <- FrF2(nfactors = 6, resolution = 4, randomize = FALSE)
des.res4
##     A  B  C  D  E  F
## 1  -1 -1 -1 -1 -1 -1
## 2   1 -1 -1 -1  1  1
## 3  -1  1 -1 -1  1  1
## 4   1  1 -1 -1 -1 -1
## 5  -1 -1  1 -1  1 -1
## 6   1 -1  1 -1 -1  1
## 7  -1  1  1 -1 -1  1
## 8   1  1  1 -1  1 -1
## 9  -1 -1 -1  1 -1  1
## 10  1 -1 -1  1  1 -1
## 11 -1  1 -1  1  1 -1
## 12  1  1 -1  1 -1  1
## 13 -1 -1  1  1  1  1
## 14  1 -1  1  1 -1 -1
## 15 -1  1  1  1 -1 -1
## 16  1  1  1  1  1  1
## class=design, type= FrF2

Display aliased relationships

aliasprint(des.res4)
## $legend
## [1] A=A B=B C=C D=D E=E F=F
## 
## $main
## character(0)
## 
## $fi2
## [1] AB=CE=DF AC=BE    AD=BF    AE=BC    AF=BD    CD=EF    CF=DE

Add response data to the design

response <- c(6, 10, 32, 60, 4, 15, 26, 60, 8, 12, 34, 60, 16, 5, 37, 52)
des.resp <- add.response(des.res4, response)
summary(des.resp)
## Call:
## FrF2(nfactors = 6, resolution = 4, randomize = FALSE)
## 
## Experimental design of type  FrF2 
## 16  runs
## 
## Factor settings (scale ends):
##    A  B  C  D  E  F
## 1 -1 -1 -1 -1 -1 -1
## 2  1  1  1  1  1  1
## 
## Responses:
## [1] response
## 
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D E=E F=F
## 
## $generators
## [1] E=ABC F=ABD
## 
## 
## Alias structure:
## $fi2
## [1] AB=CE=DF AC=BE    AD=BF    AE=BC    AF=BD    CD=EF    CF=DE   
## 
## 
## The design itself:
##     A  B  C  D  E  F response
## 1  -1 -1 -1 -1 -1 -1        6
## 2   1 -1 -1 -1  1  1       10
## 3  -1  1 -1 -1  1  1       32
## 4   1  1 -1 -1 -1 -1       60
## 5  -1 -1  1 -1  1 -1        4
## 6   1 -1  1 -1 -1  1       15
## 7  -1  1  1 -1 -1  1       26
## 8   1  1  1 -1  1 -1       60
## 9  -1 -1 -1  1 -1  1        8
## 10  1 -1 -1  1  1 -1       12
## 11 -1  1 -1  1  1 -1       34
## 12  1  1 -1  1 -1  1       60
## 13 -1 -1  1  1  1  1       16
## 14  1 -1  1  1 -1 -1        5
## 15 -1  1  1  1 -1 -1       37
## 16  1  1  1  1  1  1       52
## class=design, type= FrF2

Generate Half Normal Plot

par(mar = c(5, 5, 5, 5)) # Adjust margins
DanielPlot(des.resp, half = TRUE)

Generate Main Effects Plot

MEPlot(des.resp, show.alias = TRUE)