library(FrF2)
## 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)
response<-FrF2(nfactors=4,resolution=4,randomize=FALSE)
observations<-c(7.037,16.867,13.867,17.273,11.846,4.368,9.360,15.653)
response <- add.response(response,observations)
DanielPlot(response,half=TRUE)
MEPlot(response,show.alias=TRUE)
response<-FrF2(nfactors=6,resolution=5,randomize=FALSE,blocks=2,nruns=16)
## Warning in FrF2(nfactors = 6, resolution = 5, randomize = FALSE, blocks = 2, :
## resolution is ignored, if nruns is given.
summary(response)
## Call:
## FrF2(nfactors = 6, resolution = 5, randomize = FALSE, blocks = 2,
## nruns = 16)
##
## 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 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 for design itself`
## [1] E=ABC F=ABD
##
## $`block generators`
## [1] ACD
##
##
## Alias structure:
## $fi2
## [1] AB=CE=DF AC=BE AD=BF AE=BC AF=BD CD=EF CF=DE
##
## Aliased with block main effects:
## [1] none
##
## The design itself:
## run.no run.no.std.rp Blocks A B C D E F
## 1 1 1.1.1 1 -1 -1 -1 -1 -1 -1
## 2 2 4.1.2 1 -1 -1 1 1 1 1
## 3 3 5.1.3 1 -1 1 -1 -1 1 1
## 4 4 8.1.4 1 -1 1 1 1 -1 -1
## 5 5 10.1.5 1 1 -1 -1 1 1 -1
## 6 6 11.1.6 1 1 -1 1 -1 -1 1
## 7 7 14.1.7 1 1 1 -1 1 -1 1
## 8 8 15.1.8 1 1 1 1 -1 1 -1
## run.no run.no.std.rp Blocks A B C D E F
## 9 9 2.2.1 2 -1 -1 -1 1 -1 1
## 10 10 3.2.2 2 -1 -1 1 -1 1 -1
## 11 11 6.2.3 2 -1 1 -1 1 1 -1
## 12 12 7.2.4 2 -1 1 1 -1 -1 1
## 13 13 9.2.5 2 1 -1 -1 -1 1 1
## 14 14 12.2.6 2 1 -1 1 1 -1 -1
## 15 15 13.2.7 2 1 1 -1 -1 -1 -1
## 16 16 16.2.8 2 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
response<-FrF2(nfactors=7,resolution=3,randomize=FALSE,blocks=4,nruns=32)
## Warning in FrF2(nfactors = 7, resolution = 3, randomize = FALSE, blocks = 4, :
## resolution is ignored, if nruns is given.
summary(response)
## Call:
## FrF2(nfactors = 7, resolution = 3, randomize = FALSE, blocks = 4,
## nruns = 32)
##
## Experimental design of type FrF2.blocked
## 32 runs
## blocked design with 4 blocks of size 8
##
## Factor settings (scale ends):
## A B C D E F G
## 1 -1 -1 -1 -1 -1 -1 -1
## 2 1 1 1 1 1 1 1
##
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D E=E F=F G=G
##
## $`generators for design itself`
## [1] F=ABC G=ABD
##
## $`block generators`
## [1] ACD ABE
##
##
## Alias structure:
## $fi2
## [1] AB=CF=DG AC=BF AD=BG AF=BC AG=BD CD=FG CG=DF
##
## Aliased with block main effects:
## [1] none
##
## The design itself:
## 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
response<- FrF2(nfactors = 6,nruns = 16,generators = c("ABC","ACD"), randomize = FALSE)
summary(response)
## Call:
## FrF2(nfactors = 6, nruns = 16, generators = c("ABC", "ACD"),
## randomize = FALSE)
##
## Experimental design of type FrF2.generators
## 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=ACD
##
##
## Alias structure:
## $fi2
## [1] AB=CE AC=BE=DF AD=CF AE=BC AF=CD BD=EF BF=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.generators
aliasprint(response)
## $legend
## [1] A=A B=B C=C D=D E=E F=F
##
## $main
## character(0)
##
## $fi2
## [1] AB=CE AC=BE=DF AD=CF AE=BC AF=CD BD=EF BF=DE
fact <- 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.0110,0.0065,0.0155,0.0093,
0.0128,0.0066,0.0043,0.0081,0.0047,0.0258,0.0090,0.0250,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.0040,0.0147,0.0092,0.0226,0.0077,0.0060,0.0028,0.0158,0.0101,0.0126,0.0145,0.0110,
0.0185,0.0020,0.0050,0.0030,0.0089,0.0296,0.0086,0.0169,0.0069,0.0045,0.0028,0.0159,0.0158,0.0071,0.0145,0.013)
a1 <- rep(response$A,4)
b2 <- rep(response$B,4)
c3 <- rep(response$C,4)
d4 <- rep(response$D,4)
e5 <- rep(response$E,4)
f6 <- rep(response$F,4)
model <- aov(fact~a1*b2*c3*d4*e5*f6)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## a1 1 0.0002410 0.0002410 27.726 3.24e-06 ***
## b2 1 0.0000052 0.0000052 0.595 0.44413
## c3 1 0.0005006 0.0005006 57.591 9.26e-10 ***
## d4 1 0.0000328 0.0000328 3.770 0.05805 .
## e5 1 0.0001911 0.0001911 21.987 2.30e-05 ***
## f6 1 0.0009626 0.0009626 110.727 4.65e-14 ***
## a1:b2 1 0.0000581 0.0000581 6.688 0.01279 *
## a1:c3 1 0.0000797 0.0000797 9.163 0.00396 **
## b2:c3 1 0.0000522 0.0000522 6.005 0.01796 *
## a1:d4 1 0.0000243 0.0000243 2.790 0.10135
## b2:d4 1 0.0000842 0.0000842 9.684 0.00313 **
## c3:d4 1 0.0000628 0.0000628 7.225 0.00985 **
## d4:e5 1 0.0000086 0.0000086 0.984 0.32614
## a1:b2:d4 1 0.0000000 0.0000000 0.004 0.95292
## b2:c3:d4 1 0.0000487 0.0000487 5.597 0.02208 *
## Residuals 48 0.0004173 0.0000087
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
std <- c(24.418,20.976,4.083,25.025,22.410,63.639,16.029,39.42,26.725,50.341,7.681,20.083,31.12,29.51,6.75,17.45)
experiment <- aov(std~A*B*C*D*E*F,data = response)
halfnormal(experiment,ME.partial = TRUE)
##
## The following effects are completely aliased:
## [1] A:E B:E C:E A:F B:F C:F
## [7] D:F E:F A:B:C A:C:D A:B:E A:C:E
## [13] B:C:E A:D:E B:D:E C:D:E A:B:F A:C:F
## [19] B:C:F A:D:F B:D:F C:D:F A:E:F B:E:F
## [25] C:E:F D:E:F A:B:C:D A:B:C:E A:B:D:E A:C:D:E
## [31] B:C:D:E A:B:C:F A:B:D:F A:C:D:F B:C:D:F A:B:E:F
## [37] A:C:E:F B:C:E:F A:D:E:F B:D:E:F C:D:E:F A:B:C:D:E
## [43] A:B:C:D:F A:B:C:E:F A:B:D:E:F A:C:D:E:F B:C:D:E:F A:B:C:D:E:F
##
## Significant effects (alpha=0.05, Lenth method):
## [1] B1 A1
## In 2^6 design 1/4 fraction is used. ## Process Variables A,C,E,F affect average camber ## process variables A and B affect the variability in camber measurements.
response <- FrF2(nfactors = 4, nruns = 8, randomize = FALSE)
M1 <- c(8,10,12,7,13,6,5,11)
expe<- add.response(response,M1)
summary(expe)
## Call:
## FrF2(nfactors = 4, nruns = 8, 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] M1
##
## 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 M1
## 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
A <- rep(c(-1,1),4)
B <- rep(c(rep(-1,2),rep(1,2)),2)
C <- c(rep(-1,4),rep(1,4))
D <- A*B*C
model <- aov(M1~A*B*C*D)
coef(model)
## (Intercept) A B C D A:B
## 9.00 -0.50 -0.25 -0.25 2.50 0.75
## A:C B:C
## 0.25 -0.50
N <- FrF2(nfactors = 5,nruns = 8,generators = c("-ABC","BC"), randomize = FALSE)
N
## A B C D E
## 1 -1 -1 -1 1 1
## 2 1 -1 -1 -1 1
## 3 -1 1 -1 -1 -1
## 4 1 1 -1 1 -1
## 5 -1 -1 1 -1 -1
## 6 1 -1 1 1 -1
## 7 -1 1 1 1 1
## 8 1 1 1 -1 1
## class=design, type= FrF2.generators
summary(N)
## Call:
## FrF2(nfactors = 5, nruns = 8, generators = c("-ABC", "BC"), randomize = FALSE)
##
## Experimental design of type FrF2.generators
## 8 runs
##
## 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
## [1] D=-ABC E=BC
##
##
## Alias structure:
## $main
## [1] A=-DE B=CE C=BE D=-AE E=-AD=BC
##
## $fi2
## [1] AB=-CD AC=-BD
##
##
## The design itself:
## A B C D E
## 1 -1 -1 -1 1 1
## 2 1 -1 -1 -1 1
## 3 -1 1 -1 -1 -1
## 4 1 1 -1 1 -1
## 5 -1 -1 1 -1 -1
## 6 1 -1 1 1 -1
## 7 -1 1 1 1 1
## 8 1 1 1 -1 1
## class=design, type= FrF2.generators
N1 <-fold.design(N)
aliasprint(N1)
## $legend
## [1] A=A B=B C=C D=fold E=D F=E
##
## $main
## character(0)
##
## $fi2
## [1] AB=-CE AC=-BE AD=EF AE=-BC=DF AF=DE BD=-CF BF=-CD
response<-FrF2(nfactors=7,resolution=3,randomize=FALSE)
fold.design(response, columns = 1)
## 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
design.info(response)$aliased$main
## [1] "A=BD=CE=FG" "B=AD=CF=EG" "C=AE=BF=DG" "D=AB=CG=EF" "E=AC=BG=DF"
## [6] "F=AG=BC=DE" "G=AF=BE=CD"