dcm.design.cand {choiceDes} | R Documentation |
Optimal fractional factorial design
Description
Generate an optimal restricted fractional factorial design given a pre-generated candidate set.
Usage
dcm.design.cand(cand, nb, sets, alts, fname=NULL, Rd=20, print=TRUE)
Arguments
cand |
A data frame of columns representing factors in the design OR a tab-delimited file readable
using |
nb |
The number of blocks or versions in the final design. |
sets |
The number of choice sets in each version of the final design. |
alts |
The number of alternatives in each choice set. |
fname |
A character string, usually ending in ".txt", indiciating the name of the file containing the levels-coded design. |
Rd |
The number of repeats used by the initial design and blocking algorithms. See arg
|
print |
Boolean indicating whether there is output to the console during execution. |
Details
Generates balanced and blocked choice sets from a pre-generated candidate set.
Typical use will involve (1) generating a full factorial candidate set (see gen.factorial
),
(2) manipulating levels as desired (e.g., adding restrictions) and,
(3) using the manipulated set as input into the function.
Design optimization and blocking use the same algorithms as those in dcm.design
.
If fname
is not NULL
a tab-delimited plain-text file is generated in the working
directory containing the levels-coded design.
Value
levels |
A data frame consisting of the levels-coded design with blocks stacked in order. Variables for card, version and task are appended. |
effects |
A list of the effects-coded, blocked design and diagnostics. See |
d.eff |
A list containing |
References
Federov, V.V. (1972). Theory of optimal experiments. Academic Press, New York.
Wheeler, R.E. (2004). AlgDesign. The R project for statistical computing. (http://www.r-project.org).
See Also
dcm.design
, optFederov
, optBlock
Examples
## generate full factorial candidate set
cand <- gen.factorial(c(3,3,4), factors="all")
## restrict the candidate set so that level 3 in the first factor
## cannot occur with level 1 in the second factor
remove.rows <- which(cand[,1] == 3 & cand[,2] == 1)
cand.restr <- cand[-remove.rows,]
## generate the design from the restricted candidate set
## and check that no design rows violate the restriction
des <- dcm.design.cand(cand.restr, 10, 6, 2)
which(des$levels[,4] == 3 & des$levels[,5] == 1)