dcm.design.cand {choiceDes}  R Documentation 
Optimal fractional factorial design
Description
Generate an optimal restricted fractional factorial design given a pregenerated 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 tabdelimited 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 levelscoded 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 pregenerated 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 tabdelimited plaintext file is generated in the working
directory containing the levelscoded design.
Value
levels 
A data frame consisting of the levelscoded design with blocks stacked in order. Variables for card, version and task are appended. 
effects 
A list of the effectscoded, 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.rproject.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)