ccd(basis, generators, blocks = "Block", n0 = 4, alpha = "orthogonal",
wbreps = 1, bbreps = 1, randomize = TRUE, coding)
NA
.n0[1]
specifies the number of center points in
'cube' blocks"orthogonal"
,the star points are positioned to block the design orthogonally; if it matches "rotatable"
, the star points are chosen to coded.data
object is returned with the specified coding.data.frame
with the generated design; or if coding
is specified, a coded.data
object. The blocking variable will be a factor
; all other variables will be numeric.-alpha
and +alpha
), plus center points. Everything is assumed to be on a coded scale, where the cube portion of the design has values of -1 and 1 for each variable, and the center points are 0. The codings may be provided, if desired, using the coding
argument.
The basis
argument determines a basic design used to create cube blocks. For example, basis = ~A+B+C
would generate a basic design of 8 runs. Use generators
if you want additional variables; for example, generators = c(D~-A*B, E~B*C)
added to the above would generate a 5-factor design with defining relation I = -ABD = BCE = -ACDE
.
If you want the cube points divided into fractional blocks, give the formula(s) in the blocks
argument. For instance, suppose we have basis = A+B+C+D+E
, generators = F~-A*C*D
, and blocks = Day ~ c(A*B*C, C*D*E)
. Then the blocking variable will be named "Day"
, and the basic 32-run design (half-fraction of 6 factors) will be divided into 4 blocks of 8 runs each, based on the combination of signs of A*B*C
and C*D*E
. Notice that Day
will be confounded with its generators, the interaction thereof, and all aliases of these: Day = ABC = CDE = ABDE = -BDF = -ADCF = -BCEF = -AEF
. To each of these blocks, we will add n0
(or n0[1]
) center points.
A star block contains n0
(or n0[2]
) center points, plus points at +/- alpha
on each coordinate axis. You may specify the alpha
you want, or have it chosen to achieve orthogonality of blocks (the default) or rotatability. Conditions for these criteria to hold are described in detail in references such as Myers and Montgomery (2005).
wbreps
values greater than 1 cause cube points or star points to be replicated in the same block. bbreps
values greater than 1 cause additional blocks to be added to the design. By default, the design is randomized so that the run order in each block is random. The order of appearance of the blocks is not randomized.
A couple of convenience features are added. If basis
is an integer instead of a formula, default variable names of x1, x2, ...
are used; for example, basis = 3
is equivalent to basis = ~x1+x2+x3
. You may specify generators or fractional blocks using the same notation. You may also give variables on the left-hand side when basis
is a formula, and these variables are added to the returned design. For example, Yield+ProcessTime ~ A+B+C
would generate a design in factors A, B, C
(plus others if there are generators), and additional variables Yield
and ProcessTime
initialized at NA
.ccd.pick
, coded.data
, bbd
library(rsm)
### Generate a standard 3-variable CCD with 12 runs in each block
des = ccd(3, n0=c(4,6), coding = list(x1 ~ (Temp - 150)/10,
x2 ~ (Pres - 50)/5, x3 ~ Feedrate - 4))
decode.data(des)
### Generate a 5-variable design in 2 blocks. The cube block has 16 runs
### This design will have alpha = 2; it is both orthogonal and rotatable
ccd(~ x1 + x2 + x3 + x4, x5 ~ x1 * x2 * x3 * x4, n0 = c(6,1))
### Generate a 5-variable design with 5 blocks:
### 4 blocks of 8 cube points each, and 1 block with star points
### You'll get alpha = 2.366; if you add alpha = "rot", you'll get 2.378
des = ccd(y1 + y2 ~ A + B + C + D + E, , Shift ~ c(-A*B*C, C*D*E), n0=c(2,4))
Run the code above in your browser using DataLab