library(FrF2)
## Warning: package 'FrF2' was built under R version 4.1.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
library(DoE.base)
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.
des.res4<-FrF2(nfactors=4,resolution=4,randomize=FALSE)
des.res4
## A B C D
## 1 -1 -1 -1 -1
## 2 1 -1 -1 1
## 3 -1 1 -1 1
## 4 1 1 -1 -1
## 5 -1 -1 1 1
## 6 1 -1 1 -1
## 7 -1 1 1 -1
## 8 1 1 1 1
## class=design, type= FrF2
response<-c(7.037,16.867,13.876,17.273,11.846,4.368,9.36,15.653)
des.resp4<-add.response(des.res4,response)
des.resp4
## A B C D response
## 1 -1 -1 -1 -1 7.037
## 2 1 -1 -1 1 16.867
## 3 -1 1 -1 1 13.876
## 4 1 1 -1 -1 17.273
## 5 -1 -1 1 1 11.846
## 6 1 -1 1 -1 4.368
## 7 -1 1 1 -1 9.360
## 8 1 1 1 1 15.653
## class=design, type= FrF2
aliasprint(des.resp4)
## $legend
## [1] A=A B=B C=C D=D
##
## $main
## character(0)
##
## $fi2
## [1] AB=CD AC=BD AD=BC
summary(des.resp4)
## Call:
## FrF2(nfactors = 4, resolution = 4, randomize = FALSE)
##
## Experimental design of type FrF2
## 8 runs
##
## Factor settings (scale ends):
## A B C D
## 1 -1 -1 -1 -1
## 2 1 1 1 1
##
## Responses:
## [1] response
##
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D
##
## $generators
## [1] D=ABC
##
##
## Alias structure:
## $fi2
## [1] AB=CD AC=BD AD=BC
##
##
## The design itself:
## A B C D response
## 1 -1 -1 -1 -1 7.037
## 2 1 -1 -1 1 16.867
## 3 -1 1 -1 1 13.876
## 4 1 1 -1 -1 17.273
## 5 -1 -1 1 1 11.846
## 6 1 -1 1 -1 4.368
## 7 -1 1 1 -1 9.360
## 8 1 1 1 1 15.653
## class=design, type= FrF2
DanielPlot(des.resp4)
des.res5<-FrF2(nruns = 16, nfactors=5,resolution=5,randomize=FALSE,blocks = 2)
## Warning in FrF2(nruns = 16, nfactors = 5, resolution = 5, randomize = FALSE, :
## resolution is ignored, if nruns is given.
des.res5
## run.no run.no.std.rp Blocks A B C D E
## 1 1 1.1.1 1 -1 -1 -1 -1 -1
## 2 2 3.1.2 1 -1 -1 1 -1 1
## 3 3 6.1.3 1 -1 1 -1 1 1
## 4 4 8.1.4 1 -1 1 1 1 -1
## 5 5 10.1.5 1 1 -1 -1 1 1
## 6 6 12.1.6 1 1 -1 1 1 -1
## 7 7 13.1.7 1 1 1 -1 -1 -1
## 8 8 15.1.8 1 1 1 1 -1 1
## run.no run.no.std.rp Blocks A B C D E
## 9 9 2.2.1 2 -1 -1 -1 1 -1
## 10 10 4.2.2 2 -1 -1 1 1 1
## 11 11 5.2.3 2 -1 1 -1 -1 1
## 12 12 7.2.4 2 -1 1 1 -1 -1
## 13 13 9.2.5 2 1 -1 -1 -1 1
## 14 14 11.2.6 2 1 -1 1 -1 -1
## 15 15 14.2.7 2 1 1 -1 1 -1
## 16 16 16.2.8 2 1 1 1 1 1
## class=design, type= FrF2.blocked
## NOTE: columns run.no and run.no.std.rp are annotation,
## not part of the data frame
aliasprint(des.res5)
## $legend
## [1] A=A B=B C=C D=D E=E
##
## $main
## character(0)
##
## $fi2
## [1] AB=CE AC=BE AE=BC
summary(des.res5)
## Call:
## FrF2(nruns = 16, nfactors = 5, resolution = 5, randomize = FALSE,
## blocks = 2)
##
## Experimental design of type FrF2.blocked
## 16 runs
## blocked design with 2 blocks of size 8
##
## Factor settings (scale ends):
## A B C D E
## 1 -1 -1 -1 -1 -1
## 2 1 1 1 1 1
##
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D E=E
##
## $`generators for design itself`
## [1] E=ABC
##
## $`block generators`
## [1] ABD
##
##
## Alias structure:
## $fi2
## [1] AB=CE AC=BE AE=BC
##
## Aliased with block main effects:
## [1] none
##
## The design itself:
## run.no run.no.std.rp Blocks A B C D E
## 1 1 1.1.1 1 -1 -1 -1 -1 -1
## 2 2 3.1.2 1 -1 -1 1 -1 1
## 3 3 6.1.3 1 -1 1 -1 1 1
## 4 4 8.1.4 1 -1 1 1 1 -1
## 5 5 10.1.5 1 1 -1 -1 1 1
## 6 6 12.1.6 1 1 -1 1 1 -1
## 7 7 13.1.7 1 1 1 -1 -1 -1
## 8 8 15.1.8 1 1 1 1 -1 1
## run.no run.no.std.rp Blocks A B C D E
## 9 9 2.2.1 2 -1 -1 -1 1 -1
## 10 10 4.2.2 2 -1 -1 1 1 1
## 11 11 5.2.3 2 -1 1 -1 -1 1
## 12 12 7.2.4 2 -1 1 1 -1 -1
## 13 13 9.2.5 2 1 -1 -1 -1 1
## 14 14 11.2.6 2 1 -1 1 -1 -1
## 15 15 14.2.7 2 1 1 -1 1 -1
## 16 16 16.2.8 2 1 1 1 1 1
## class=design, type= FrF2.blocked
## NOTE: columns run.no and run.no.std.rp are annotation,
## not part of the data frame
#8.25
des.res7<-FrF2(nruns = 32, nfactors=7,resolution=4,randomize=FALSE,blocks = 4)
## Warning in FrF2(nruns = 32, nfactors = 7, resolution = 4, randomize = FALSE, :
## resolution is ignored, if nruns is given.
des.res7
## run.no run.no.std.rp Blocks A B C D E F G
## 1 1 1.1.1 1 -1 -1 -1 -1 -1 -1 -1
## 2 2 7.1.2 1 -1 -1 1 1 -1 1 1
## 3 3 10.1.3 1 -1 1 -1 -1 1 1 1
## 4 4 16.1.4 1 -1 1 1 1 1 -1 -1
## 5 5 20.1.5 1 1 -1 -1 1 1 1 -1
## 6 6 22.1.6 1 1 -1 1 -1 1 -1 1
## 7 7 27.1.7 1 1 1 -1 1 -1 -1 1
## 8 8 29.1.8 1 1 1 1 -1 -1 1 -1
## run.no run.no.std.rp Blocks A B C D E F G
## 9 9 2.2.1 2 -1 -1 -1 -1 1 -1 -1
## 10 10 8.2.2 2 -1 -1 1 1 1 1 1
## 11 11 9.2.3 2 -1 1 -1 -1 -1 1 1
## 12 12 15.2.4 2 -1 1 1 1 -1 -1 -1
## 13 13 19.2.5 2 1 -1 -1 1 -1 1 -1
## 14 14 21.2.6 2 1 -1 1 -1 -1 -1 1
## 15 15 28.2.7 2 1 1 -1 1 1 -1 1
## 16 16 30.2.8 2 1 1 1 -1 1 1 -1
## run.no run.no.std.rp Blocks A B C D E F G
## 17 17 3.3.1 3 -1 -1 -1 1 -1 -1 1
## 18 18 5.3.2 3 -1 -1 1 -1 -1 1 -1
## 19 19 12.3.3 3 -1 1 -1 1 1 1 -1
## 20 20 14.3.4 3 -1 1 1 -1 1 -1 1
## 21 21 18.3.5 3 1 -1 -1 -1 1 1 1
## 22 22 24.3.6 3 1 -1 1 1 1 -1 -1
## 23 23 25.3.7 3 1 1 -1 -1 -1 -1 -1
## 24 24 31.3.8 3 1 1 1 1 -1 1 1
## run.no run.no.std.rp Blocks A B C D E F G
## 25 25 4.4.1 4 -1 -1 -1 1 1 -1 1
## 26 26 6.4.2 4 -1 -1 1 -1 1 1 -1
## 27 27 11.4.3 4 -1 1 -1 1 -1 1 -1
## 28 28 13.4.4 4 -1 1 1 -1 -1 -1 1
## 29 29 17.4.5 4 1 -1 -1 -1 -1 1 1
## 30 30 23.4.6 4 1 -1 1 1 -1 -1 -1
## 31 31 26.4.7 4 1 1 -1 -1 1 -1 -1
## 32 32 32.4.8 4 1 1 1 1 1 1 1
## class=design, type= FrF2.blocked
## NOTE: columns run.no and run.no.std.rp are annotation,
## not part of the data frame
aliasprint(des.res7)
## $legend
## [1] A=A B=B C=C D=D E=E F=F G=G
##
## $main
## character(0)
##
## $fi2
## [1] AB=CF=DG AC=BF AD=BG AF=BC AG=BD CD=FG CG=DF
library(FrF2)
library(DoE.base)
library(GAD)
des.res6<-FrF2(nfactors=6,resolution=4,randomize=FALSE)
aliasprint(des.res6) # Here we can see the alias relationship
## $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
summary(des.res6)
## 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
##
## 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
## 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
Lamtemp<-c("-1","1","-1","1","-1","1","-1","1","-1","1","-1","1","-1","1","-1","1")
Lamtemp1<-as.fixed(Lamtemp)
Lamtime<-c(rep(c("-1","-1","1","1"),4))
Lamtime1<-as.fixed(Lamtime)
LamPressure<-c(rep(c("-1","-1","-1","-1","1","1","1","1"),2))
LamPressure1<-as.fixed(LamPressure)
Firetemp<-c("-1","-1","-1","-1","-1","-1","-1","-1","1","1","1","1","1","1","1","1")
Firetemp1<-as.fixed(Firetemp)
Firetime<-c(rep(c("-1","1","1","-1","1","-1","-1","1"),2))
Firetime1<-as.fixed(Firetime)
Firedewpoint<-c(rep(c("-1","1","-1","1","1","-1","1","-1"),2))
Firedewpoint1<-as.fixed(Firedewpoint)
Response<-c(0.0167,0.0062,0.0041,0.0073,0.0047,0.0219,0.0121,0.0255,0.0032,0.0078,0.0043,0.0186,0.011,0.0065,0.0155,0.0093,0.0128,0.0066,0.0043,0.0081,0.0047,0.0258,0.009,0.025,0.0023,0.0158,0.0027,0.0137,0.0086,0.0109,0.0158,0.0124,0.0149,0.0044,0.0042,0.0039,0.004,0.0147,0.0092,0.0226,0.0077,0.006,0.0028,0.0158,0.0101,0.0126,0.0145,0.011,0.0185,0.002,0.005,0.003,0.0089,0.0296,0.0086,0.0169,0.0069,0.0045,0.0028,0.0159,0.0158,0.0071,0.0145,0.0133)
Total<-c(629,192,176,223,223,920,389,900,201,341,126,640,455,371,603,460)
Mean<-c(157.25,48,44,55.75,55.75,230,97.25,225,50.25,85.25,31.5,160,113.75,92.75,150.75,115)
Stddeviation<-c(24.418,20.976,4.083,25.025,22.41,63.639,16.029,39.42,26.725,50.341,7.681,20.083,31.12,29.51,6.75,17.45
)
dat2<-data.frame(Lamtemp1,Lamtime1,LamPressure1,Firetemp1,Firetime1,Firedewpoint1,Response,Total,Mean,Stddeviation)
model<-aov(Response~Lamtemp1*Lamtime1*LamPressure1*Firetemp1*Firetime1*Firedewpoint1, data = dat2)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## Lamtemp1 1 0.0002422 0.0002422 27.793 3.17e-06 ***
## Lamtime1 1 0.0000053 0.0000053 0.614 0.43725
## LamPressure1 1 0.0005023 0.0005023 57.644 9.14e-10 ***
## Firetemp1 1 0.0000323 0.0000323 3.712 0.05995 .
## Firetime1 1 0.0001901 0.0001901 21.815 2.45e-05 ***
## Firedewpoint1 1 0.0000803 0.0000803 9.218 0.00387 **
## Lamtemp1:Lamtime1 1 0.0000587 0.0000587 6.738 0.01249 *
## Lamtime1:LamPressure1 1 0.0000527 0.0000527 6.053 0.01754 *
## Lamtemp1:Firetemp1 1 0.0000239 0.0000239 2.741 0.10431
## Lamtime1:Firetemp1 1 0.0000849 0.0000849 9.739 0.00305 **
## LamPressure1:Firetemp1 1 0.0000622 0.0000622 7.139 0.01027 *
## Firetemp1:Firetime1 1 0.0000088 0.0000088 1.007 0.32062
## Firetemp1:Firedewpoint1 1 0.0009602 0.0009602 110.192 5.05e-14 ***
## Lamtemp1:Lamtime1:Firetemp1 1 0.0000000 0.0000000 0.005 0.94291
## Lamtime1:LamPressure1:Firetemp1 1 0.0000481 0.0000481 5.523 0.02293 *
## Residuals 48 0.0004183 0.0000087
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
dat3<-data.frame(Lamtemp1,Lamtime1,LamPressure1,Firetemp1,Firetime1,Firedewpoint1,Stddeviation)
model1<-aov(Stddeviation~Lamtemp1*Lamtime1*LamPressure1*Firetemp1*Firetime1*Firedewpoint1, data = dat3)
DanielPlot(model1)
MEPlot(model1,show.alias=TRUE)
library(FrF2)
des.res8.4<-FrF2(nfactors=4,resolution=4,randomize=FALSE)
des.res8.4
## A B C D
## 1 -1 -1 -1 -1
## 2 1 -1 -1 1
## 3 -1 1 -1 1
## 4 1 1 -1 -1
## 5 -1 -1 1 1
## 6 1 -1 1 -1
## 7 -1 1 1 -1
## 8 1 1 1 1
## class=design, type= FrF2
aliasprint(des.res8.4)
## $legend
## [1] A=A B=B C=C D=D
##
## $main
## character(0)
##
## $fi2
## [1] AB=CD AC=BD AD=BC
response<- c(8,10,12,7,13,6,5,11)
des.res8.41<-add.response(des.res8.4,response)
summary(des.res8.41)
## Call:
## FrF2(nfactors = 4, resolution = 4, randomize = FALSE)
##
## Experimental design of type FrF2
## 8 runs
##
## Factor settings (scale ends):
## A B C D
## 1 -1 -1 -1 -1
## 2 1 1 1 1
##
## Responses:
## [1] response
##
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D
##
## $generators
## [1] D=ABC
##
##
## Alias structure:
## $fi2
## [1] AB=CD AC=BD AD=BC
##
##
## The design itself:
## A B C D response
## 1 -1 -1 -1 -1 8
## 2 1 -1 -1 1 10
## 3 -1 1 -1 1 12
## 4 1 1 -1 -1 7
## 5 -1 -1 1 1 13
## 6 1 -1 1 -1 6
## 7 -1 1 1 -1 5
## 8 1 1 1 1 11
## class=design, type= FrF2
library(FrF2)
des.res860<-FrF2(nfactors=7,resolution=3,randomize=FALSE)
des.res860
## A B C D E F G
## 1 -1 -1 -1 1 1 1 -1
## 2 1 -1 -1 -1 -1 1 1
## 3 -1 1 -1 -1 1 -1 1
## 4 1 1 -1 1 -1 -1 -1
## 5 -1 -1 1 1 -1 -1 1
## 6 1 -1 1 -1 1 -1 -1
## 7 -1 1 1 -1 -1 1 -1
## 8 1 1 1 1 1 1 1
## class=design, type= FrF2
des.res861<-fold.design(des.res860,column=1)
des.res861
## A B C fold D E F G
## 1 -1 -1 -1 original 1 1 1 -1
## 2 1 -1 -1 original -1 -1 1 1
## 3 -1 1 -1 original -1 1 -1 1
## 4 1 1 -1 original 1 -1 -1 -1
## 5 -1 -1 1 original 1 -1 -1 1
## 6 1 -1 1 original -1 1 -1 -1
## 7 -1 1 1 original -1 -1 1 -1
## 8 1 1 1 original 1 1 1 1
## 9 1 -1 -1 mirror 1 1 1 -1
## 10 -1 -1 -1 mirror -1 -1 1 1
## 11 1 1 -1 mirror -1 1 -1 1
## 12 -1 1 -1 mirror 1 -1 -1 -1
## 13 1 -1 1 mirror 1 -1 -1 1
## 14 -1 -1 1 mirror -1 1 -1 -1
## 15 1 1 1 mirror -1 -1 1 -1
## 16 -1 1 1 mirror 1 1 1 1
## class=design, type= FrF2.folded
aliasprint(des.res861)
## $legend
## [1] A=A B=B C=C D=fold E=D F=E G=F H=G
##
## $main
## [1] B=CG=FH C=BG=EH E=CH=FG F=BH=EG G=BC=EF H=BF=CE
##
## $fi2
## [1] AB=-DE AC=-DF AD=-BE=-CF=-GH AE=-BD AF=-CD
## [6] AG=-DH AH=-DG
summary(des.res861)
## Multi-step-call:
## [[1]]
## FrF2(nfactors = 7, resolution = 3, randomize = FALSE)
##
## $fold
## [1] 1
##
##
## Experimental design of type FrF2.folded
## 16 runs
##
## Factor settings (scale ends):
## A B C fold D E F G
## 1 -1 -1 -1 original -1 -1 -1 -1
## 2 1 1 1 mirror 1 1 1 1
##
## Design generating information:
## $legend
## [1] A=A B=B C=C D=fold E=D F=E G=F H=G
##
##
## Alias structure:
## $main
## [1] B=CG=FH C=BG=EH E=CH=FG F=BH=EG G=BC=EF H=BF=CE
##
## $fi2
## [1] AB=-DE AC=-DF AD=-BE=-CF=-GH AE=-BD AF=-CD
## [6] AG=-DH AH=-DG
##
##
## The design itself:
## A B C fold D E F G
## 1 -1 -1 -1 original 1 1 1 -1
## 2 1 -1 -1 original -1 -1 1 1
## 3 -1 1 -1 original -1 1 -1 1
## 4 1 1 -1 original 1 -1 -1 -1
## 5 -1 -1 1 original 1 -1 -1 1
## 6 1 -1 1 original -1 1 -1 -1
## 7 -1 1 1 original -1 -1 1 -1
## 8 1 1 1 original 1 1 1 1
## 9 1 -1 -1 mirror 1 1 1 -1
## 10 -1 -1 -1 mirror -1 -1 1 1
## 11 1 1 -1 mirror -1 1 -1 1
## 12 -1 1 -1 mirror 1 -1 -1 -1
## 13 1 -1 1 mirror 1 -1 -1 1
## 14 -1 -1 1 mirror -1 1 -1 -1
## 15 1 1 1 mirror -1 -1 1 -1
## 16 -1 1 1 mirror 1 1 1 1
## class=design, type= FrF2.folded