Generates a 2^k-p fractional factorial design.
Usage
fracDesign(
k = 3,
p = 0,
gen = NULL,
replicates = 1,
blocks = 1,
centerCube = 0,
random.seed = 1234
)Arguments
- k
Numeric value giving the number of factors. By default
kis set to `3`.- p
Numeric integer between `0` and `7`. p is giving the number of additional factors in the response surface design by aliasing effects. A 2^k-p factorial design will be generated and the generators of the standard designs available in fracChoose() will be used. By default p is set to `0`. Any other value will cause the function to omit the argument gen given by the user and replace it by the one out of the table of standard designs (see:
fracChoose). Replicates and blocks can be set anyway!- gen
One or more defining relations for a fractional factorial design, for example:
`C=AB`. By default gen is set toNULL.- replicates
Numeric value giving the number of replicates per factor combination. By default
replicatesis set to `1`.- blocks
Numeric value giving the number of blocks. By default blocks is set to `1`.
- centerCube
Numeric value giving the number of center points within the 2^k design. By default
centerCubeis set to `0`.- random.seed
Seed for randomization of the design
Value
The function fracDesign returns an object of class facDesign.c.
Examples
#Example 1
#Returns a 2^4-1 fractional factorial design. Factor D will be aliased with
vp.frac = fracDesign(k = 4, gen = "D=ABC")
#the three-way-interaction ABC (i.e. I = ABCD)
vp.frac$.response(rnorm(2^(4-1)))
# summary of the fractional factorial design
vp.frac$summary()
#> Information about the factors:
#>
#> A B C D
#> low -1 -1 -1 -1
#> high 1 1 1 1
#> name A B C D
#> unit
#> type numeric numeric numeric numeric
#> -----------
#> StandOrder RunOrder Block A B C D rnorm.2..4...1..
#> 7 7 1 1 -1 1 1 -1 0.03572991
#> 2 2 2 1 1 -1 -1 1 0.11297506
#> 6 6 3 1 1 -1 1 -1 1.42855203
#> 1 1 4 1 -1 -1 -1 -1 0.98340378
#> 4 4 5 1 1 1 -1 -1 -0.62245679
#> 3 3 6 1 -1 1 -1 1 -0.73153600
#> 8 8 7 1 1 1 1 1 -0.51666972
#> 5 5 8 1 -1 -1 1 1 -1.75073344
#>
#> ---------
#>
#> Defining relations:
#> I = ABCD Columns: 1 2 3 4
#>
#> Resolution: IV
#>
#Example 2
#Returns a full factorial design with 3 replications per factor combination and 4 center points
vp.rep = fracDesign(k = 3, replicates = 3, centerCube = 4)
#Summary of the replicated fractional factorial design
vp.rep$summary()
#> Information about the factors:
#>
#> A B C
#> low -1 -1 -1
#> high 1 1 1
#> name A B C
#> unit
#> type numeric numeric numeric
#> -----------
#> StandOrder RunOrder Block A B C y
#> 27 27 1 1 0 0 0 NA
#> 13 13 2 1 -1 -1 1 NA
#> 24 24 3 1 1 1 1 NA
#> 12 12 4 1 1 1 -1 NA
#> 5 5 5 1 -1 -1 1 NA
#> 10 10 6 1 1 -1 -1 NA
#> 14 14 7 1 1 -1 1 NA
#> 19 19 8 1 -1 1 -1 NA
#> 8 8 9 1 1 1 1 NA
#> 16 16 10 1 1 1 1 NA
#> 20 20 11 1 1 1 -1 NA
#> 6 6 12 1 1 -1 1 NA
#> 23 23 13 1 -1 1 1 NA
#> 17 17 14 1 -1 -1 -1 NA
#> 7 7 15 1 -1 1 1 NA
#> 2 2 16 1 1 -1 -1 NA
#> 18 18 17 1 1 -1 -1 NA
#> 28 28 18 1 0 0 0 NA
#> 15 15 19 1 -1 1 1 NA
#> 22 22 20 1 1 -1 1 NA
#> 21 21 21 1 -1 -1 1 NA
#> 4 4 22 1 1 1 -1 NA
#> 25 25 23 1 0 0 0 NA
#> 9 9 24 1 -1 -1 -1 NA
#> 26 26 25 1 0 0 0 NA
#> 3 3 26 1 -1 1 -1 NA
#> 11 11 27 1 -1 1 -1 NA
#> 1 1 28 1 -1 -1 -1 NA