ccd.design: Function for accessing central composite designs from package...

Description Usage Arguments Details Value Warning Note Author(s) References See Also Examples

View source: R/ccd.design.R

Description

Function for accessing central composite designs from package rsm, with automatic creation of an appropriate cube portion

Usage

1
2
3
4
5
6
ccd.design(nfactors=NULL, factor.names=NULL, default.levels=c(-1,1), ncube=NULL, 
        resolution=if (identical(blocks,1) & is.null(ncube)) 5 else NULL, 
        generators=NULL, ncenter = 4, alpha = "orthogonal", 
        replications=1, 
        block.name="Block.ccd", blocks=1, 
        randomize=TRUE, seed=NULL, ...)

Arguments

nfactors

number of factors

factor.names

list of cube corner values for each factor; names are used as variable names; the names must not be x1, x2, ..., as these are used for the variables in coded units;
if the list is not named, the variable names are X1, X2 and so forth; in coded units, -1 corresponds to the smaller, +1 to the larger value.

default.levels

default levels (vector of length 2) for all factors for which no specific levels are given

ncube

integer number of cube points (without center points for the cube)

resolution

arabic numeral for the requested resolution of the cube portion of the design; cubes for ccd designs should usually be at least of resolution V. the default value for resolution is therefore 5, unless generators or blocks are specified, in which case the default is NULL

generators

generators in the form allowed in function FrF2

ncenter

integer number of center points for each cube or star point block, or vector with two numbers, the first for the cube and the second for the star portion of the design

alpha

“orthogonal”, “rotatable”, or a number that indicates the position of the star points; the number 1 would create a face-centered design.

replications

the number of replications of the design; currently, only proper replications can be generated; these are randomized in blocks within the center point and star blocks. The same number of replications is used for both the cube and the star blocks.

block.name

name of block factor that distinguishes between blocks; even for unblocked cubes, the ccd design has at least one cube and one star point block

blocks

the same as in function FrF2;
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 numbers/letters refer to the factors of the experiment and not to column numbers of the Yates matrix

  • that numbers/letters can refer to *all* nfactors factors rather than the log2(nruns) base factors only,

  • that one single number is always interpreted as the number of blocks rather than a column reference,

  • that individual numbers are allowed in a list (i.e. individual factors specified in the experiment can be used as block factors) and

  • that no negative signs are allowed.

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.

For the statistical and algorithmic background of blocked designs, see block.
Note that the blocking strategy of package FrF2 was modified with version 2 (2.1) of the package.

randomize

logical that indicates whether or not randomization should occur

seed

NULL or a vector of two integer seeds for random number generation in randomization
In R version 3.6.0 and later, the default behavior of function sample has changed. If you work in a new (i.e., >= 3.6.-0) R version and want to reproduce a randomized design from an earlier R version (before 3.6.0), you have to change the RNGkind setting by
RNGkind(sample.kind="Rounding")
before running function ccd.design.
It is recommended to change the setting back to the new recommended way afterwards:
RNGkind(sample.kind="default")
For an example, see the documentation of the example data set VSGFS.

...

reserved for future usage

Details

The statistical background of central composite designs is briefly described under CentralCompositeDesigns.

Function ccd.design creates a central composite design from scratch. It proceeds by generating a cube design with function FrF2 and then augmenting this cube design using functions add.center from package FrF2 for adding center points to the cube and subsequently function ccd from package rsm for generating the star portion of the design.

There are two main purposes for this function: one is to provide central composite designs within the same syntax philosophy used in packages DoE.base-package and FrF2. The other is to automatically identify good (=resolution V) cube portions, which can be achieved by using the resolution parameter.

In comparison to direct usage of package ccd, the functions make the syntax closer to that of the other packages in the DoE.wrapper suite and allow automatic selection of fractional factorials as cubes.

Function ccd.design does not allow direct use of the estimable functionality that is available in function FrF2. Nevertheless, ccd designs with a cube based on the estimable functionality can be generated by first using function FrF2 and subsequently applying function ccd.augment. It may for example be interesting to use designs based on estimability requirements for 2-factor interactions in cases where a resolution V cube for the ccd is not feasible - of course, this does not allow to estimate the full second order model and therefore generates a warning.

Value

The function returns a data frame of S3 class design with attributes attached. The data frame itself is in the original data scale. The data frame desnum attached as attribute desnum is the coded design. The attribute design.info is a list of various design properties. The element type of that list is the character string ccd. Besides the elements present in all class design objects, there are the elements quantitative (vector with nfactor TRUE entries), and a codings element usable in the coding functions available in the rsm package, e.g. coded.data.

Note that the row names and the standard order column in the run.order attribute of ccd designs are not in conventional order, if the blocking routine blockpick.big was used. In such situations, these should not be used as the basis for any calculations.

Warning

Since R version 3.6.0, the behavior of function sample has changed (correction of a biased previous behavior that should not be relevant for the randomization of designs). For reproducing a randomized design that was produced with an earlier R version, please follow the steps described with the argument seed.

Note

This package is still under (slow) development. Reports about bugs and inconveniences are welcome. ccd.design is based on version 1 of package rsm.

Author(s)

Ulrike Groemping

References

Box, G.E.P., Hunter, J.S. and Hunter, W.G. (2005, 2nd ed.). Statistics for Experimenters. Wiley, New York.

Box, G.E.P. and Wilson, K.B. (1951). On the Experimental Attainment of Optimum Conditions. J. Royal Statistical Society, B13, 1-45.

NIST/SEMATECH e-Handbook of Statistical Methods, http://www.itl.nist.gov/div898/handbook/pri/section3/pri3361.htm, accessed August 20th, 2009.

Myers, R.H., Montgomery, D.C. and Anderson-Cook, C.M. (2009). Response Surface Methodology. Process and Product Optimization Using Designed Experiments. Wiley, New York.

See Also

See also ccd.augment, add.center, FrF2, lhs-package, rsm

Examples

1
2
3
4
5
6
7
8
ccd.design(5) ## per default uses the resolution V design in 16 runs for the cube
ccd.design(5, ncube=32) ## uses the full factorial for the cube
ccd.design(5, ncenter=6, default.levels=c(-10,10))
## blocked design (requires ncube to be specified)
ccd.design(5, ncube=32, blocks=4) 
## there is only one star point block

## for usage of other options, look at the FrF2 documentation

Example output

Loading required package: FrF2
Loading required package: DoE.base
Loading required package: grid
Loading required package: conf.design

Attaching package: 'DoE.base'

The following objects are masked from 'package:stats':

    aov, lm

The following object is masked from 'package:graphics':

    plot.design

The following object is masked from 'package:base':

    lengths

Loading required package: rsm
sh: 1: cannot create /dev/null: Permission denied
      Block.ccd        X1        X2        X3        X4        X5
C1.17         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.18         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.6          1  1.000000 -1.000000  1.000000 -1.000000  1.000000
C1.15         1 -1.000000  1.000000  1.000000  1.000000 -1.000000
C1.7          1 -1.000000  1.000000  1.000000 -1.000000  1.000000
C1.1          1 -1.000000 -1.000000 -1.000000 -1.000000  1.000000
C1.14         1  1.000000 -1.000000  1.000000  1.000000 -1.000000
C1.8          1  1.000000  1.000000  1.000000 -1.000000 -1.000000
C1.13         1 -1.000000 -1.000000  1.000000  1.000000  1.000000
C1.16         1  1.000000  1.000000  1.000000  1.000000  1.000000
C1.19         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.2          1  1.000000 -1.000000 -1.000000 -1.000000 -1.000000
C1.11         1 -1.000000  1.000000 -1.000000  1.000000  1.000000
C1.4          1  1.000000  1.000000 -1.000000 -1.000000  1.000000
C1.9          1 -1.000000 -1.000000 -1.000000  1.000000 -1.000000
C1.3          1 -1.000000  1.000000 -1.000000 -1.000000 -1.000000
C1.12         1  1.000000  1.000000 -1.000000  1.000000 -1.000000
C1.10         1  1.000000 -1.000000 -1.000000  1.000000  1.000000
C1.5          1 -1.000000 -1.000000  1.000000 -1.000000 -1.000000
C1.20         1  0.000000  0.000000  0.000000  0.000000  0.000000
S2.5          2  0.000000  0.000000 -2.366432  0.000000  0.000000
S2.4          2  0.000000  2.366432  0.000000  0.000000  0.000000
S2.1          2 -2.366432  0.000000  0.000000  0.000000  0.000000
S2.13         2  0.000000  0.000000  0.000000  0.000000  0.000000
S2.2          2  2.366432  0.000000  0.000000  0.000000  0.000000
S2.11         2  0.000000  0.000000  0.000000  0.000000  0.000000
S2.3          2  0.000000 -2.366432  0.000000  0.000000  0.000000
S2.8          2  0.000000  0.000000  0.000000  2.366432  0.000000
S2.9          2  0.000000  0.000000  0.000000  0.000000 -2.366432
S2.7          2  0.000000  0.000000  0.000000 -2.366432  0.000000
S2.14         2  0.000000  0.000000  0.000000  0.000000  0.000000
S2.6          2  0.000000  0.000000  2.366432  0.000000  0.000000
S2.12         2  0.000000  0.000000  0.000000  0.000000  0.000000
S2.10         2  0.000000  0.000000  0.000000  0.000000  2.366432
class=design, type= ccd 
creating full factorial with 32 runs ...

sh: 1: cannot create /dev/null: Permission denied
      Block.ccd        X1        X2        X3        X4        X5
C1.33         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.34         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.21         1 -1.000000 -1.000000  1.000000 -1.000000  1.000000
C1.26         1  1.000000 -1.000000 -1.000000  1.000000  1.000000
C1.25         1 -1.000000 -1.000000 -1.000000  1.000000  1.000000
C1.12         1  1.000000  1.000000 -1.000000  1.000000 -1.000000
C1.6          1  1.000000 -1.000000  1.000000 -1.000000 -1.000000
C1.27         1 -1.000000  1.000000 -1.000000  1.000000  1.000000
C1.20         1  1.000000  1.000000 -1.000000 -1.000000  1.000000
C1.23         1 -1.000000  1.000000  1.000000 -1.000000  1.000000
C1.5          1 -1.000000 -1.000000  1.000000 -1.000000 -1.000000
C1.2          1  1.000000 -1.000000 -1.000000 -1.000000 -1.000000
C1.28         1  1.000000  1.000000 -1.000000  1.000000  1.000000
C1.3          1 -1.000000  1.000000 -1.000000 -1.000000 -1.000000
C1.8          1  1.000000  1.000000  1.000000 -1.000000 -1.000000
C1.4          1  1.000000  1.000000 -1.000000 -1.000000 -1.000000
C1.19         1 -1.000000  1.000000 -1.000000 -1.000000  1.000000
C1.10         1  1.000000 -1.000000 -1.000000  1.000000 -1.000000
C1.35         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.30         1  1.000000 -1.000000  1.000000  1.000000  1.000000
C1.32         1  1.000000  1.000000  1.000000  1.000000  1.000000
C1.11         1 -1.000000  1.000000 -1.000000  1.000000 -1.000000
C1.29         1 -1.000000 -1.000000  1.000000  1.000000  1.000000
C1.22         1  1.000000 -1.000000  1.000000 -1.000000  1.000000
C1.18         1  1.000000 -1.000000 -1.000000 -1.000000  1.000000
C1.16         1  1.000000  1.000000  1.000000  1.000000 -1.000000
C1.13         1 -1.000000 -1.000000  1.000000  1.000000 -1.000000
C1.17         1 -1.000000 -1.000000 -1.000000 -1.000000  1.000000
C1.14         1  1.000000 -1.000000  1.000000  1.000000 -1.000000
C1.9          1 -1.000000 -1.000000 -1.000000  1.000000 -1.000000
C1.15         1 -1.000000  1.000000  1.000000  1.000000 -1.000000
C1.1          1 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000
C1.7          1 -1.000000  1.000000  1.000000 -1.000000 -1.000000
C1.31         1 -1.000000  1.000000  1.000000  1.000000  1.000000
C1.24         1  1.000000  1.000000  1.000000 -1.000000  1.000000
C1.36         1  0.000000  0.000000  0.000000  0.000000  0.000000
S2.3          2  0.000000 -2.494438  0.000000  0.000000  0.000000
S2.6          2  0.000000  0.000000  2.494438  0.000000  0.000000
S2.4          2  0.000000  2.494438  0.000000  0.000000  0.000000
S2.13         2  0.000000  0.000000  0.000000  0.000000  0.000000
S2.14         2  0.000000  0.000000  0.000000  0.000000  0.000000
S2.12         2  0.000000  0.000000  0.000000  0.000000  0.000000
S2.9          2  0.000000  0.000000  0.000000  0.000000 -2.494438
S2.7          2  0.000000  0.000000  0.000000 -2.494438  0.000000
S2.10         2  0.000000  0.000000  0.000000  0.000000  2.494438
S2.8          2  0.000000  0.000000  0.000000  2.494438  0.000000
S2.2          2  2.494438  0.000000  0.000000  0.000000  0.000000
S2.1          2 -2.494438  0.000000  0.000000  0.000000  0.000000
S2.11         2  0.000000  0.000000  0.000000  0.000000  0.000000
S2.5          2  0.000000  0.000000 -2.494438  0.000000  0.000000
class=design, type= ccd 
sh: 1: cannot create /dev/null: Permission denied
      Block.ccd        X1        X2        X3        X4        X5
C1.17         1   0.00000   0.00000   0.00000   0.00000   0.00000
C1.18         1   0.00000   0.00000   0.00000   0.00000   0.00000
C1.14         1  10.00000 -10.00000  10.00000  10.00000 -10.00000
C1.15         1 -10.00000  10.00000  10.00000  10.00000 -10.00000
C1.8          1  10.00000  10.00000  10.00000 -10.00000 -10.00000
C1.16         1  10.00000  10.00000  10.00000  10.00000  10.00000
C1.13         1 -10.00000 -10.00000  10.00000  10.00000  10.00000
C1.1          1 -10.00000 -10.00000 -10.00000 -10.00000  10.00000
C1.6          1  10.00000 -10.00000  10.00000 -10.00000  10.00000
C1.10         1  10.00000 -10.00000 -10.00000  10.00000  10.00000
C1.19         1   0.00000   0.00000   0.00000   0.00000   0.00000
C1.20         1   0.00000   0.00000   0.00000   0.00000   0.00000
C1.7          1 -10.00000  10.00000  10.00000 -10.00000  10.00000
C1.11         1 -10.00000  10.00000 -10.00000  10.00000  10.00000
C1.12         1  10.00000  10.00000 -10.00000  10.00000 -10.00000
C1.4          1  10.00000  10.00000 -10.00000 -10.00000  10.00000
C1.2          1  10.00000 -10.00000 -10.00000 -10.00000 -10.00000
C1.3          1 -10.00000  10.00000 -10.00000 -10.00000 -10.00000
C1.5          1 -10.00000 -10.00000  10.00000 -10.00000 -10.00000
C1.9          1 -10.00000 -10.00000 -10.00000  10.00000 -10.00000
C1.21         1   0.00000   0.00000   0.00000   0.00000   0.00000
C1.22         1   0.00000   0.00000   0.00000   0.00000   0.00000
S2.16         2   0.00000   0.00000   0.00000   0.00000   0.00000
S2.9          2   0.00000   0.00000   0.00000   0.00000 -24.12091
S2.8          2   0.00000   0.00000   0.00000  24.12091   0.00000
S2.5          2   0.00000   0.00000 -24.12091   0.00000   0.00000
S2.12         2   0.00000   0.00000   0.00000   0.00000   0.00000
S2.7          2   0.00000   0.00000   0.00000 -24.12091   0.00000
S2.10         2   0.00000   0.00000   0.00000   0.00000  24.12091
S2.2          2  24.12091   0.00000   0.00000   0.00000   0.00000
S2.13         2   0.00000   0.00000   0.00000   0.00000   0.00000
S2.15         2   0.00000   0.00000   0.00000   0.00000   0.00000
S2.3          2   0.00000 -24.12091   0.00000   0.00000   0.00000
S2.11         2   0.00000   0.00000   0.00000   0.00000   0.00000
S2.1          2 -24.12091   0.00000   0.00000   0.00000   0.00000
S2.4          2   0.00000  24.12091   0.00000   0.00000   0.00000
S2.14         2   0.00000   0.00000   0.00000   0.00000   0.00000
S2.6          2   0.00000   0.00000  24.12091   0.00000   0.00000
class=design, type= ccd 
sh: 1: cannot create /dev/null: Permission denied
      Block.ccd        X1        X2        X3        X4        X5
C1.33         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.34         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.15         1 -1.000000  1.000000  1.000000  1.000000 -1.000000
C1.3          1 -1.000000 -1.000000 -1.000000  1.000000 -1.000000
C1.25         1  1.000000  1.000000 -1.000000 -1.000000 -1.000000
C1.2          1 -1.000000 -1.000000 -1.000000 -1.000000  1.000000
C1.35         1  0.000000  0.000000  0.000000  0.000000  0.000000
C1.14         1 -1.000000  1.000000  1.000000 -1.000000  1.000000
C1.28         1  1.000000  1.000000 -1.000000  1.000000  1.000000
C1.21         1  1.000000 -1.000000  1.000000 -1.000000 -1.000000
C1.24         1  1.000000 -1.000000  1.000000  1.000000  1.000000
C1.36         1  0.000000  0.000000  0.000000  0.000000  0.000000
C2.33         2  0.000000  0.000000  0.000000  0.000000  0.000000
C2.34         2  0.000000  0.000000  0.000000  0.000000  0.000000
C2.4          2 -1.000000 -1.000000 -1.000000  1.000000  1.000000
C2.27         2  1.000000  1.000000 -1.000000  1.000000 -1.000000
C2.13         2 -1.000000  1.000000  1.000000 -1.000000 -1.000000
C2.16         2 -1.000000  1.000000  1.000000  1.000000  1.000000
C2.35         2  0.000000  0.000000  0.000000  0.000000  0.000000
C2.1          2 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000
C2.23         2  1.000000 -1.000000  1.000000  1.000000 -1.000000
C2.26         2  1.000000  1.000000 -1.000000 -1.000000  1.000000
C2.22         2  1.000000 -1.000000  1.000000 -1.000000  1.000000
C2.36         2  0.000000  0.000000  0.000000  0.000000  0.000000
C3.33         3  0.000000  0.000000  0.000000  0.000000  0.000000
C3.34         3  0.000000  0.000000  0.000000  0.000000  0.000000
C3.18         3  1.000000 -1.000000 -1.000000 -1.000000  1.000000
C3.12         3 -1.000000  1.000000 -1.000000  1.000000  1.000000
C3.30         3  1.000000  1.000000  1.000000 -1.000000  1.000000
C3.19         3  1.000000 -1.000000 -1.000000  1.000000 -1.000000
C3.35         3  0.000000  0.000000  0.000000  0.000000  0.000000
C3.8          3 -1.000000 -1.000000  1.000000  1.000000  1.000000
C3.9          3 -1.000000  1.000000 -1.000000 -1.000000 -1.000000
C3.5          3 -1.000000 -1.000000  1.000000 -1.000000 -1.000000
C3.31         3  1.000000  1.000000  1.000000  1.000000 -1.000000
C3.36         3  0.000000  0.000000  0.000000  0.000000  0.000000
C4.33         4  0.000000  0.000000  0.000000  0.000000  0.000000
C4.34         4  0.000000  0.000000  0.000000  0.000000  0.000000
C4.17         4  1.000000 -1.000000 -1.000000 -1.000000 -1.000000
C4.6          4 -1.000000 -1.000000  1.000000 -1.000000  1.000000
C4.29         4  1.000000  1.000000  1.000000 -1.000000 -1.000000
C4.32         4  1.000000  1.000000  1.000000  1.000000  1.000000
C4.35         4  0.000000  0.000000  0.000000  0.000000  0.000000
C4.20         4  1.000000 -1.000000 -1.000000  1.000000  1.000000
C4.10         4 -1.000000  1.000000 -1.000000 -1.000000  1.000000
C4.11         4 -1.000000  1.000000 -1.000000  1.000000 -1.000000
C4.7          4 -1.000000 -1.000000  1.000000  1.000000 -1.000000
C4.36         4  0.000000  0.000000  0.000000  0.000000  0.000000
S5.11         5  0.000000  0.000000  0.000000  0.000000  0.000000
S5.5          5  0.000000  0.000000 -2.160247  0.000000  0.000000
S5.13         5  0.000000  0.000000  0.000000  0.000000  0.000000
S5.9          5  0.000000  0.000000  0.000000  0.000000 -2.160247
S5.14         5  0.000000  0.000000  0.000000  0.000000  0.000000
S5.1          5 -2.160247  0.000000  0.000000  0.000000  0.000000
S5.2          5  2.160247  0.000000  0.000000  0.000000  0.000000
S5.10         5  0.000000  0.000000  0.000000  0.000000  2.160247
S5.8          5  0.000000  0.000000  0.000000  2.160247  0.000000
S5.3          5  0.000000 -2.160247  0.000000  0.000000  0.000000
S5.12         5  0.000000  0.000000  0.000000  0.000000  0.000000
S5.6          5  0.000000  0.000000  2.160247  0.000000  0.000000
S5.7          5  0.000000  0.000000  0.000000 -2.160247  0.000000
S5.4          5  0.000000  2.160247  0.000000  0.000000  0.000000
class=design, type= ccd 

DoE.wrapper documentation built on Jan. 11, 2020, 9:28 a.m.