FrF2 {FrF2} | R Documentation |
Regular fractional factorial 2-level designs are provided. Apart from obtaining the usual minimum aberration designs in a fixed number of runs, it is possible to request highest number of free 2-factor interactions instead of minimum aberration or to request the smallest design that fulfills certain requirements (e.g. resolution V with 8 factors).
FrF2(nruns = NULL, nfactors = NULL, factor.names = if (!is.null(nfactors)) { if (nfactors <= 50) Letters[1:nfactors] else paste("F", 1:nfactors, sep = "")} else NULL, default.levels = c(-1, 1), generators = NULL, design = NULL, resolution = NULL, select.catlg=catlg, estimable = NULL, clear = TRUE, res3 = FALSE, max.time = 60, perm.start=NULL, perms = NULL, MaxC2 = FALSE, replications = 1, repeat.only = FALSE, randomize = TRUE, seed = NULL, alias.info = 2, blocks = 1, block.name = "Blocks", bbreps=replications, wbreps=1, alias.block.2fis = FALSE, hard = NULL, check.hard=10, WPs=1,nfac.WP=0, WPfacs=NULL, check.WPs = 10, ...)
nruns |
Number of runs, must be a power of 2, if given.
The number of runs can also be omitted. In that case, if resolution is specified, the function looks for the smallest
design of the requested resolution that accomodates nfactors factors.
If the smallest possible design is a full factorial or not catalogued,
the function stops with an error.
If generators is specified, nruns is required.
If estimable is specified and nruns omitted,
nruns becomes the size of the smallest design that
MIGHT accomodate the effects requested in estimable .
If this run size turns out to be too low, an error is thrown.
In that case, explicitly choose nruns as twice the run size
given in the error message and retry. |
nfactors |
is the number of 2-level factors to be investigated.
It can be omitted, if it is obvious from factor.names ,
a specific catalogued design given in design ,
nruns together with generators , or
estimable .
If estimable is used for determining
the number of factors, it is assumed that the largest main effect position number
occurring in estimable coincides with nfactors .
For blocked designs, block generator columns are not included in nfactors , except if
the user explicitly specifies 2-level block generation factors as
part of the fractional factorial design (e.g. a factor shift with levels
morning and afternoon).
For automatically-generated split-plot designs (cf. details section), nfactors simply is the number of all factors (whole plot and split plot together).
If nfac.WP < log2(WPs) , the algorithm will add (an) artificial plot generation factor(s).
For manually-specified split-plot designs (through options generators or
design together with WPfacs ), the user must specify at least log2(WPs)
split plot factors, i.e. nfac.WP >= log2(WPs) is required (and must, if necessary,
be achieved by adding log2(WPs) - nfac.WP extra independent generator columns
for the whole plot structure, which have to be counted in nfac.WP and nfactors ). |
factor.names |
a character vector of nfactors factor names
or a named list with nfactors elements, for which the names represent factor names
and the elements are EITHER vectors of length 2 with factor levels for the respective factor OR empty strings. For each factor with an empty string in factor.names, the levels given in default.levels are used. |
default.levels |
default levels (vector of length 2) for all factors for which no specific levels are given |
generators |
There are log2(nruns) basic factors the full factorial
of which spans the design. The generators specify how the remaining factors
are to be allocated to interactions of these.
Generators can be any of a list of vectors with position numbers of basis factors (e.g. c(1,2,4) stands for the interaction between first, second and fourth basis factor) a vector of character representations of these interactions (e.g. “ABD” stands for the same interaction as above) a vector of columns numbers in Yates order (e.g. 11 stands for ABD) |
design |
is a character string specifying the name of a design listed
in the catalogue specified as select.catlg , which is usually
the catalogue catlg
|
resolution |
is the arabic numeral for the requested resolution of the design.
FrF2 looks for a design with at least this resolution.
Option resolution does not work, if estimable , blocks
or WPs are specified, and neither if nruns is given.A design with resolution III (resolution=3) confounds main effects with 2-factor interactions, a design with resolution IV confounds main effects with three-factor interactions or 2-factor interactions with each other, and designs with resolution V or higher are usually regarded as very strong, because all 2-factor interactions are unconfounded with each other and with main effects. |
select.catlg |
specifies a catalogue of class catlg from
which an adequate design is selected and adapted. The specified catalogue is used for design construction, unless generators explicitly constructs a
non-catalogued design. The default catlg is adequate for most
applications.
If a specific different catalogue of designs is available, this can be specified here. Specification of a smaller subset of designs is useful, if estimable
has been given and clear=FALSE , for restricting the search
to promising designs.
|
estimable |
indicates the 2-factor interactions (2fis) that are to be estimable in
the design. Consult the details section for two different approaches of
requesting estimability, as indicated by the status of the clear option.
estimable can bea numeric matrix with two rows, each column of which indicates one interaction, e.g. column 1 3 for interaction of the first with the third factor OR a character vector containing strings of length 2 with capital letters from Letters
(cf. package DoE.base)
for the first 25 factors and small letters for the last 25 (e.g. c(\"AB\",\"BE\") OR a formula that contains an adequate model formula, e.g. formula(\"~A+B+C+D+E+(F+G+H+J+K+L)^2\") for a model with (at least) eleven factors. The names of the factors used in the formula can be the same letters usable in the character vector (cf. above, A the first factor, B the second etc.), or they can correspond to the factor names from factor.names .
|
clear |
logical, indicating how estimable is to be used. See details. |
res3 |
logical; if TRUE, estimable includes resolution III designs
into the search for adequate designs; otherwise resolution IV and higher designs
are included only. |
max.time |
maximum time for design search as requested by estimable ,
in seconds (default 60); used only if clear=FALSE,
since the search can take a long time in complicated or unlucky situations;
set max.time to Inf if you want to force a search over an extended period of
time; however, be aware that it may still take longer than feasible
(cf. also details section) |
perm.start |
used only if clear=FALSE .Provides a start permutation for permuting experiment factors (numeric vector). This is useful for the case that a previous search was not (yet) successful because of a time limit, since the algorithm notifies the user about the permutation at which it had to stop. |
perms |
used only if clear=FALSE .Provides the matrix of permutations of experiment factors to be tried; each row is a permutation. For example, for an 11-factor design with the first six factors and their 2fis estimable, it is only relevant, which of the eleven factors are to be allocated to the first six experiment factors, and these as well as the other five factors can be in arbitrary order. This reduces the number of required permutations from about 40 Mio to 462. It is recommended to use perms whenever possible, if clear=FALSE ,
since this dramatically improves performance of the algorithm.
It is planned to automatically generate perms for certain structures like compromise designs in the future. |
MaxC2 |
is a logical and defaults to FALSE. If TRUE, maximizing the number of free 2-factor interactions takes precedence over minimizing aberration. Resolution is always considered first. Most likely, features like this are going to change in the future. |
replications |
positive integer number. Default 1 (i.e. each row just once).
If larger, each design run is executed replication times.
If repeat.only , repeated measurements
are carried out directly in sequence, i.e. no true replication takes place,
and all the repeat runs are conducted together. It is likely that the error
variation generated by such a procedure will be too small, so that average values
should be analyzed for an unreplicated design.
Otherwise (default), the full experiment is first carried out once, then for the second replication and so forth. In case of randomization, each such blocks is randomized separately. In this case, replication variance is more likely suitable for usage as error variance (unless e.g. the same parts are used for replication runs although build variation is important). |
repeat.only |
logical, relevant only if replications > 1. If TRUE,
replications of each run are grouped together
(repeated measurement rather than true replication). The default is
repeat.only=FALSE , i.e. the complete experiment
is conducted in replications blocks, and each run occurs in each block. |
randomize |
logical. If TRUE, the design is randomized. This is the default.
In case of replications, the nature of randomization depends on the setting of
option repeat.only . |
seed |
optional seed for the randomization process |
alias.info |
can be 2 or 3, gives the order of interaction effects for which
alias information is to be included in the aliased component of the
design.info element of the output object. |
blocks |
is EITHER the number of blocks into which the experiment is subdivided OR a character vector of names of independent factors that are used as block constructors OR a vector or list of generators similar to generators . In the latter case, the differences to generators are that single numbers are not possible (would be interpreted as one Yates columns for generators ), that numbers/letters can refer to all nfactors factors rather than the log2(nruns) base factors only and that individual numbers are allowed (i.e. factors specified in the experiment can be used as block factors). If blocks is a single number, it must be a power of 2.
A blocked design can have at most nruns-blocks treatment
factors, but should usually have fewer than that.
If the experiment is randomized, randomization happens within blocks. |
block.name |
name of the block factor, default “Blocks” |
bbreps |
between block replications; these are always taken as genuine replications,
not repeat runs; default: equal to replications ;
CAUTION: you should not modify bbreps if you do not work with blocks,
because the program code uses it instead of replications in some places |
wbreps |
within block replications; whether or not these are taken as genuine replications
depends on the setting of repeat.only |
alias.block.2fis |
logical indicating whether blocks may be aliased
with 2fis (default: FALSE ); the option is effective only for automatic block assignment (cf. details section); it will often be necessary to modify this option, because there is otherwise no solution. CAUTION: If alias.block.2fis=TRUE , no effort is made to avoid aliasing
of 2fis with block main effects, even if complete de-aliasing were possible. |
hard |
gives the number of hard to change factors. These must be the
first factors in factor.names . Implementation is via a split-plot
design with as few as possible whole plots (number of possible whole plots is
determined via left-adjustment) and as few as possible non-hard factors
within the whole plot structure (by applying split-plot after left-adjustment).
If a different implementation is desired, it is of course possible to
explicitly treat the hard to change factors as whole-plot factors via
WPs and nfac.WP . |
check.hard |
is the number of candidate designs from the catalogue specified
in select.catlg that are checked for making hard-to-change factors
change as little as possible.The default is 10 - if too many changes are needed, a larger choice might help find a design with fewer level changes (but will also take longer run time and will find a worse design in terms of resolution / aberration). If you want to use the best design and do not want to compromise the confounding structure for ease-of-change reasons, set check.hard to 1. |
WPs |
is the number of whole plots and must be a power of 2.
If WPs = 1 , all settings for split-plot related options are ignored. |
nfac.WP |
is the number of whole plot factors and must be smaller than WPs .
The nfac.WP whole plot factors are counted within nfactors .
If WPfacs is specified (manual specification of whole plot factors instead
of the default first nfac.WP ), nfac.WP must be at least log2(WPs)
in order to support generation of WPs whole plots.
If nfac.WP is 0 and WPs > 1, an error is thrown,
because the situation is a block rather than a split-plot situation
(and either it was forgotten to specify
the number of whole plot factors, or blocks should be specified).
|
WPfacs |
is per default NULL. In this case, the first nfac.WP factors are
considered whole plot factors (and are, if necessary, automatically supplemented by
additional whole plot constructor factors). If WPfacs is specified, nfac.WP needs to be at least log2(WPs) ,
and WPfacs must have this many entries. A custom design must be specified
with options design or generators , and the requested factors in
WPfacs must indeed create a split-plot structure with WPs whole plots.
If the number of whole plots created by the whole plot factors differs from
WPs or factors other than the specified factors from WPfacs would
in fact become whole plot factors as well, an error is thrown.
WPfacs can be any ofa vector or list of factor position numbers OR a character vector of factor position letters from Letters OR a character vector with entries “F” followed by factor position number OR a character vector of factor names (this takes precedence over factor letters, i.e. if the factor names were B, A, C, D, and E, factor letter entries in the nfac.WP
are interpreted as factor names, not position letters).It is currently not possible to specify additional whole plot generators from interaction effects manually through WPfacs .
Rather, all whole plot factors - even artificial ones needed only to increase the number
of plots - need to be included in the design factors. |
check.WPs |
is the number of potential split-plot designs that are
compared by function splitpick w.r.t. resolution of the whole plot
portion of the design. This option is effective, if nfac.WP>k.WP
(i.e. bad resolution possible) and nfac.WP not larger than half
the number of plots (i.e. resolution better than III is possible).
The default is 10 - if not satisfied with the structure of the whole plot
factors, a larger choice might help find a better design (but also take
longer run time). |
... |
currently not used |
Per default, the function works on the basis of automatically-selected catalogued designs. The
default catalogue used is catlg
(a list object of class catlg
).
The result from function FrF2
is a data frame of class design
and has attributes that can be accessed
by functions desnum
, run.order
and design.info
from package DoE.base.
Alternatively, the user can explicitly specify a design through accessing
a specific catalogued design using the design
option or specifying non-catalogued
generators via the generators
option.
Apart from generation of simple fractional factorial designs based on catalogued
or non-catalogued generators, function FrF2
allows specification of blocked designs
and split-plot designs, as well as specification of a set of 2fis that are required to be estimable.
The implementation of these possibilities is explained below.
nfactors
or factor.names
and a single number for blocks
or WPs
.
Users with more mathematical background may want to use the manual definitions, perhaps
in conjunction with published catalogues of good block or split-plot designs, or
after inspecting possibilities with functions blockpick
or splitpick
.
blocks
can be a vector of factor names or factor letters, or of the same form as generators, except that
not only base factors but all factors can be used and single factors are permitted
(which would lead to resolution II designs if used in generators). For example, block = Letters[c(2,4,5)]
block = list(2,4,5)
block = c("Day","Shift")
factor.names
are to be treated as blocking factors). In this case, the number of blocks or whole plots is calculated,
and a new factor with the default name “Blocks” (in general the name chosen in
option block.name
) is generated, which would for example contain as levels
the Day/Shift combinations. It is also possible to choose interaction effects rather than factors themselves
as block generators, e.g. block = c("ABCD","EFGH")
block = list(c(1,2,3,4),c(5,6,7,8))
. design
or the generators
option
and specify manually with the WPfacs
option, which factors are whole plot factors
(i.e. factors that do not change within a plot).
The other factors become split-plot factors (i.e. factors that do change within a plot).
If the user chooses this route, WPfacs
must be character vectors of factor names, factor letters,
factor numbers preceded by capital F, or a list of factor position numbers (NOT: Yates column numbers).
Caution: It is the users responsibility to ensure a
good choice of split-plot design (e.g. by using a catalogued design from Huang, Chen and Voelkel 1998,
Bingham and Sitter 2003, or Bingham Schoen and Sitter 2004).
In case of a user-mistake such that the resulting design is not a split-plot design with
the alleged number of whole plots, an error is thrown.
FrF2
automatically generates the blocks. For full factorial designs, function FrF2
uses
the Sun, Wu and Chen (1997) catalogue of blocked designs (implemented in function blockpick
).
Otherwise, depending on the size of the problem,
function FrF2
uses function blockpick
or function blockpick.big
for finding an appropriate allocation of block generator columns:
Smaller problems choose(nruns-1-nfactors,k.block) < 100000
) blockpick
.
The search for an appropriate blocked design starts with the best design (in terms of aberration or MaxC2, if requested).
If the best design does not yield an adequate blocking possibility, the search continues with
the next best design and so forth.
For the smaller problems, function blockpick
looks for k.block
independent subsets among the eligible columns of the design.
(The eligible columns are all columns of the Yates matrix that are not occupied by treatment main effects
(if alias.block.2fis=TRUE
) or all columns of the Yates matrix that are neither occupied
by treatment main effects nor by 2fis among treatments (if alias.block.2fis=FALSE
.) For the larger problems,
function blockpick.big
permutes the k~base factors of candidate designs with nfactors + k.block
factors
in search of a design the first k.block
~factors of which can be used for block construction. In the latter case, any
specification of design (via options design
or generators
) is ignored. Note that function
blockpick.big
is not guaranteed to find an existing blocked design.
Sun, Wu and Chen (1997) provide a catalogue of blocked designs
with a few quality criteria, and they state that there is no single best design, but that the choice
depends on the situation. FrF2
always comes up with one specific solution design.
Comparisons to the catalogued designs in Sun, Wu and Chen (1997) have shown that
the designs found in FrF2
are often but not always isomorphic to the catalogued ones.
Differences do occur, especially if the base designs are resolution III, or if blockpick.big
has to be used. Users who want to be certain to use a “best” blocked design should manually
implement a specific catalogued design or inspect several solutions from functions blockpick
blockpick.big
.
nfac.WP
whole plot factors, which are of interest.
The user has to decide on a number of whole plots (WPs
) as well as
the number of whole plot factors nfac.WP
.
If log2(WPs) <= nfac.WP <= WPs-1
, it is obviously in principle possible to accomodate the
desired number of whole plot factors in the desired number of whole plots. If nfac.WP > WPs/2
,
the base design for the split-plot structure has to be of resolution III. Sometimes,
subject matter considerations limit whole plot sizes, and there are only few interesting
whole plot factors, i.e. nfac.WP < log2(WPs)
.
In this case, it is of course nevertheless necessary to
have a total of log2(WPs)
whole plot construction factors;
the missing log2(WPs) - nfac.WP
factors are added
to the design (names starting with WP
), and nfactors
is increased accordingly.
In all cases, the first nfac.WPs
user-specified factors are treated as whole plot factors, the
remaining factors as split-plot factors.
From there, function FrF2
proceeds like in the blocked situation by starting
with the best design and working its way down to worse designs, if the best design cannot
accomodate the desired split-plot structure. For each design, function FrF2
calls function splitpick
, which permutes base factors until
the requested whole plot / split-plot structure is achieved, or until impossibility for
this design with these base factors has been ascertained. In the latter case, function FrF2
proceeds to the next best design and so forth.
If several competing split-plot designs based on the same base design exist,
the best possible resolution among the first check.WPs
such designs is chosen.
No further criteria are automatically implemented, and no more than check.WPs
designs are checked. If not satisfied with the structure of the whole plot portion of the experiment,
increasing check.WPs
vs. the default 10 may help.
Expert users may want to inspect possibilities,
using function splitpick
directly.
Note that the algorithm does not necessarily find an existing split-plot design. It has been checked out which catalogued designs it can find: designs for all catalogued situations from Bingham and Sitter (2003) have been found, as well as for most catalogued situations from Huang, Chen and Voelkel (1998). Occasionally, a better design than catalogued has been found, e.g. for 4 whole plot and 10 split plot factors in 32 runs with 16 whole plots, the design found by the algorithm is resolution IV, while Huang, Chen and Voelkel propose a resolution III design. The algorithm has the largest difficulties with extreme designs in the sense that a large number of whole plots with a small number of whole plot factors are to be accomodated; thus it does not find designs for the more extreme situations in Bingham, Schoen and Sitter (2004).
estimable
allows to specify 2-factor interactions (2fis) that
have to be estimable in the model. Per default, it is assumed that a resolution IV
model is intended.
With option clear=TRUE
, FrF2
searches for
a model for which all main effects and all 2fis given in estimable
are
clear of aliasing with any other 2fis. This is a weaker requirement than resolution V,
because 2fis outside those specified in estimable
may be aliased with
each other. But it is much stronger than what is done in case of clear=FALSE
:
For the latter, FrF2
searches for a design that has a distinct column in
the model matrix for each main effect and each interaction requested with
in estimable
. Per default, resolution III designs are not included in the
search. If this default is overridden by the res3=TRUE
option, resolution III
designs are included. In case of clear=TRUE
, this leads to the somewhat
strange situation that main effects can be aliased with 2fis from outside
estimable
while 2fis from inside estimable
are not aliased with
any main effects or 2fis.
With clear=FALSE
, the algorithm loops through the eligible designs from
catlg.select
from good to worse (in terms of MA) and, for each design, loops
through all eligible permutations of the experiment factors from perms
.
If perms
is omitted, the permutations are looped through in lexicographic
order starting from 1:nfac or perm.start
. Especially in this case,
run times of the search algorithm can be very long.
The max.time
option allows to limit this run time.
If the time limit is reached, the final situation (catalogued design and
current permutation of experiment factors) is printed so that the user can
decide to proceed later with this starting point (indicated by catlg.select
for the catalogued design(s) to be used and perm.start
for the current
permutation of experiment factors).
Note that - according to the structure of the catalogued designs and the lexicographic
order of checking permutations - the initial order of the factors has a strong influence
on the run time for larger or unlucky problems. For example, consider
an experiment in 32~runs and 11~factors, for six of which the pairwise interactions are to be estimable
(Example 1 in Wu and Chen 1992). estimable
for this model can be specified as
formula("~(F+G+H+J+K+L)^2")
OR
formula("~(A+B+C+D+E+F)^2")
.
The former runs a lot faster than the latter (I have not yet seen the latter finish
the first catalogued design, if perms
is not specified).
The reason is that the latter needs more permutations of the experiment factors than
the former, since the factors with high positions
change place faster and more often than those with low positions.
For this particular design, it is very advisable to constrain the permutations of the experiment factors to the different subset selections of six factors from eleven, since permutations within the sets do not change the possibility of accomodating a design. The required permutations for the second version of this example can be obtained e.g. by the following code:
perms.6 <- combn(11,6)
perms.full <- matrix(NA,ncol(perms.6),11)
for (i in 1:ncol(perms.6))
perms.full[i,] <- c(perms.6[,i],setdiff(1:11,perms.6[,i]))
Handing perms.full to the procedure using the perms
option makes the second version of the
requested interaction terms fast as well, since up to almost 40 Mio permutations of experiment
factors are reduced to at most 462. Thus, whenever possible,
one should try to limit the permutations necessary in case of clear=FALSE
.
Function FrF2
is still under development, although most features are
now included, and the principle structure of inputs and outputs should not change
much any more. Please contact me with any suggestions for improvements.
Value is a data frame of S3 class design
(cf. package DoE.base) with attributes attached.
The data frame itself contains the design with levels coded as requested.
The following attributes are attached to it:
desnum |
Design matrix in -1/1 coding |
run.order |
three column data frame, first column contains the run number in standard order, second column the run number as randomized, third column the run number with replication number as postfix (in blocked designs, there may be two postfixes for within and between block replications); useful for switching back and forth between actual and standard run number |
design.info |
list with the entries
|
Ulrike Groemping
Bingham, D.R., Schoen, E.D. and Sitter, R.R. (2004). Designing Fractional Factorial Split-Plot Experiments with Few Whole-Plot Factors. Applied Statistics 53, 325-339.
Bingham, D. and Sitter, R.R. (2003). Fractional Factorial Split-Plot Designs for Robust Parameter Experiments. Technometrics 45, 80-89.
Bisgaard, S. (1994a). Blocking generators for small 2^(k-p) designs. J. Quality Technology 26, 288-294.
Chen, J., Sun, D.X. and Wu, C.F.J. (1993) A catalogue of 2-level and 3-level orthogonal arrays. International Statistical Review 61, 131-145.
Cheng, C.-S., Martin, R.J., and Tang, B. (1998). Two-level factorial designs with extreme numbers of level changes. Annals of Statistics 26, 1522-1539.
Cheng, C.-S. and Tsai, P.-W. (2009). Optimal two-level regular fractional factorial block and split-plot designs. Biometrika 96, 83-93.
Cheng, S.W. and Wu, C.F.J. (2002). Choice of optimal blocking schemes in 2-level and 3-level designs. Technometrics 44, 269-277.
Huang, P., Chen, D. and Voelkel, J.O. (1998). Minimum-Aberration Two-Level Split-Plot Designs. Technometrics 40, 314-326.
Sun, D.X., Wu, C.F.J. and Chen, Y.Y. (1997). Optimal blocking schemes for 2^p and 2^(n-p) designs. Technometrics 39, 298-307.
Wu, C.F.J. and Chen, Y. (1992) A graph-aided method for planning two-level experiments when certain interactions are important. Technometrics 34, 162-175.
See Also pb
for non-regular fractional factorials according
to Plackett-Burman and catlg
for the Chen, Sun, Wu catalogue
and some accessor functions.
## maximum resolution minimum aberration design with 4 factors in 8 runs FrF2(8,4) ## the design with changed default level codes FrF2(8,4, default.level=c("current","new")) ## the design with number of factors specified via factor names ## (standard level codes) FrF2(8,factor.names=list(temp="",press="",material="",state="")) ## the design with changed factor names and factor-specific level codes FrF2(8,4, factor.names=list(temp=c("min","max"),press=c("low","normal"), material=c("current","new"),state=c("new","aged"))) ## a full factorial FrF2(8,3, factor.names=list(temp=c("min","max"),press=c("low","normal"), material=c("current","new"))) ## a replicated full factorial (implicit by low number of factors) FrF2(16,3, factor.names=list(temp=c("min","max"),press=c("low","normal"), material=c("current","new"))) ## three ways for custom specification of the same design FrF2(8, generators = "ABC") FrF2(8, generators = 7) FrF2(8, generators = list(c(1,2,3))) ## more than one generator FrF2(8, generators = c("ABC","BC")) FrF2(8, generators = c(7,6)) FrF2(8, generators = list(c(1,2,3),c(2,3))) ## finding smallest design with resolution 5 in 7 factors FrF2(nfactors=7, resolution=5) ## maximum resolution minimum aberration design with 9 factors in 32 runs ## show design information instead of design itself design.info(FrF2(32,9)) ## maximum number of free 2-factor interactions instead of minimum aberration ## show design information instead of design itself design.info(FrF2(32,9,MaxC2=TRUE)) ## usage of replication ## shows run order instead of design itself run.order(FrF2(8,4,replication=2,randomize=FALSE)) run.order(FrF2(8,4,replication=2,repeat.only=TRUE,randomize=FALSE)) run.order(FrF2(8,4,replication=2)) run.order(FrF2(8,4,replication=2,repeat.only=TRUE)) ########## automatic blocked designs ################### ## from a full factorial ## FrF2(8,3,blocks=2) ## with replication run.order(FrF2(8,3,blocks=2,wbreps=2)) run.order(FrF2(8,3,blocks=2,wbreps=2,repeat.only=TRUE)) run.order(FrF2(8,3,blocks=2,bbreps=2)) run.order(FrF2(8,3,blocks=2,bbreps=2,wbreps=2)) ## automatic blocked design with fractions FrF2(16,7,blocks=4,alias.block.2fis=TRUE) ## isomorphic non-catalogued design as basis FrF2(16,gen=c(7,11,14),blocks=4,alias.block.2fis=TRUE) ## FrF2 uses blockpick.big and ignores the generator FrF2(64,gen=c(7,11,14),blocks=16,alias.block.2fis=TRUE) ########## manual blocked design #################### ### example that shows why order of blocks is not randomized ### can of course be randomized by user, if appropriate FrF2(32,9,blocks=c("Day","Shift"),alias.block.2fis=TRUE, factor.names=list(Day=c("Wednesday","Thursday"), Shift=c("Morning","Afternoon"), F1="",F2="",F3="",F4="",F5="",F6="",F7=""), default.levels=c("current","new")) ########## hard to change factors #################### ## example from Bingham and Sitter Technometrics 19999 ## MotorSpeed, FeedMode,FeedSizing,MaterialType are hard to change BS.ex <- FrF2(16,7,hard=4, factor.names=c("MotorSpeed", "FeedMode","FeedSizing","MaterialType", "Gain","ScreenAngle","ScreenVibLevel"), default.levels=c("-","+"),randomize=FALSE) design.info(BS.ex) BS.ex ## NOTE: the design has 8 whole plots. ## If randomize=FALSE is used like here, the first hard-to-change factors ## do not always change between whole plots. ## A conscious and honest decision is required whether this is ## acceptable for the situation at hand! ## randomize=TRUE would cause more changes in the first four factors. ########## automatic generation for split plot ########## ## 3 control factors, 5 noise factors, control factors are whole plot factors ## 8 plots desired in a total of 32 runs ## Bingham Sitter 2003 BS.ex2a <- FrF2(32, 8, WPs=8, nfac.WP=3, factor.names=c(paste("C",1:3,sep=""), paste("N",1:5,sep="")),randomize=TRUE) ## manual generation of this same design BS.ex2m <- FrF2(32, 8, generators=c("ABD","ACD","BCDE"),WPs=8, WPfacs=c("C1","C2","C3"), nfac.WP=3, factor.names=c(paste("C",1:3,sep=""),paste("N",1:5,sep="")),randomize=TRUE) ## design with few whole plot factors ## 2 whole plot factors, 7 split plot factors ## 8 whole plots, i.e. one extra WP factor needed BSS.cheese.exa <- FrF2(32, 9, WPs=8, nfac.WP=2, factor.names=c("A","B","p","q","r","s","t","u","v")) design.info(BSS.cheese.exa) ## manual generation of the design used by Bingham, Schoen and Sitter ## note that the generators include a generator for the 10th spplitting factor ## s= ABq, t = Apq, u = ABpr and v = Aqr, splitting factor rho=Apqr BSS.cheese.exm <- FrF2(32, gen=list(c(1,2,4),c(1,3,4),c(1,2,3,5),c(1,4,5),c(1,3,4,5)), WPs=8, nfac.WP=3, WPfacs=c(1,2,10), factor.names=c("A","B","p","q","r","s","t","u","v","rho")) design.info(BSS.cheese.exm) ########## usage of estimable ########################### ## design with all 2fis of factor A estimable on distinct columns in 16 runs FrF2(16, nfactors=6, estimable = rbind(rep(1,5),2:6), clear=FALSE) FrF2(16, nfactors=6, estimable = c("AB","AC","AD","AE","AF"), clear=FALSE) FrF2(16, nfactors=6, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"), clear=FALSE) ## formula would also accept self-defined factor names ## from factor.names instead of letters A, B, C, ... ## estimable does not need any other input FrF2(estimable=formula("~(A+B+C)^2+D+E")) ## estimable with factor names ## resolution three must be permitted, as FrF2 first determines that 8 runs ## would be sufficient degrees of freedom to estimate all effects ## and then tries to accomodate the 2fis from the model clear of aliasing in 8 runs FrF2(estimable=formula("~one+two+three+four+two:three+two:four"), factor.names=c("one","two","three","four"), res3=TRUE) ## clear=FALSE allows to allocate all effects on distinct columns in the ## 8 run MA resolution IV design FrF2(estimable=formula("~one+two+three+four+two:three+two:four"), factor.names=c("one","two","three","four"), clear=FALSE) ## 7 factors instead of 6, but no requirements for factor G FrF2(16, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"), clear=FALSE) ## larger design for handling this with all required effects clear FrF2(32, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"), clear=TRUE) ## 16 run design for handling this with required 2fis clear, but main effects aliased ## (does not usually make sense) FrF2(16, nfactors=7, estimable = formula("~A+B+C+D+E+F+A:(B+C+D+E+F)"), clear=TRUE, res3=TRUE) ## example for necessity of perms, and uses of select.catlg and perm.start ## based on Wu and Chen Example 1 ## Not run: ## runs per default about max.time=60 seconds, before throwing error with ## interim results ## results could be used in select.catlg and perm.start for restarting with ## calculation of further possibilities FrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE) ## would run for a long long time (I have not yet been patient enough) FrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE, max.time=Inf) ## End(Not run) ## can be easily done with perms, ## as only different subsets of six factors are non-isomorphic perms.6 <- combn(11,6) perms.full <- matrix(NA,ncol(perms.6),11) for (i in 1:ncol(perms.6)) perms.full[i,] <- c(perms.6[,i],setdiff(1:11,perms.6[,i])) FrF2(32, nfactors=11, estimable = formula("~(A+B+C+D+E+F)^2"), clear=FALSE, perms = perms.full )