fac.design(nlevels=NULL, nfactors=NULL, factor.names = NULL,
replications=1, repeat.only = FALSE, randomize=TRUE, seed=NULL)
nfactors
entries or single number;
can be omitted, if obvious from factor.names
nlevels
or factor.names
nlevels
is given, factor.names
can be a character vector of factor names.
In this case, default factor levels are the numbers from 1 to the number of levels for each factor.
Otherwise it must be a list of vectors witrepeat.only
, repeated measurements
are carried out directly in sequence, i.e. no true replicTRUE
,
replications of each run are grouped together
(repeated measurement rather than true replication). The default is
repeat.only=FALSE
, i.e. the compleTRUE
, the design is randomized. This is the default.
In case of replications, the nature of randomization depends on the setting of
option repeat.only
.fac.design
returns a data frame of S3 class design
with attributes attached.
The experimental factors are all stored as R factors.
For factors with 2 levels, contr.FrF2
contrasts (-1 / +1) are used.
For factors with more than 2 numerical levels, polynomial contrasts are used
(i.e. analyses will per default use orthogonal polynomials).
For factors with more than 2 categorical levels, the default contrasts are used.
Future versions will most likely allow more user control about the type of
contrasts to be used.
The design.info
attribute of the data frame has the element
nlevels
in addition to the standard elements documented for class design
.fac.design
creates full factorial designs, i.e. the number of runs is the
product of all numbers of levels.FrF2
, oa.design
, pb
## only specify level combination
fac.design(nlevels=c(4,3,3,2))
## design requested via factor.names
fac.design(factor.names=list(one=c("a","b","c"), two=c(125,275), three=c("old","new"), four=c(-1,1), five=c("min","medium","max")))
## design requested via character factor.names and nlevels (with a little German lesson for one two three)
fac.design(factor.names=c("eins","zwei","drei"),nlevels=c(2,3,2))
Run the code above in your browser using DataLab