bbd.design: Function for generating Box-Behnken designs

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

View source: R/bbd.design.R

Description

Function for generating Box-Behnken designs, making use of package rsm

Usage

1
2
bbd.design(nfactors, ncenter=4, factor.names = NULL, default.levels=c(-1,1), 
          block.name=NULL, randomize=TRUE, seed=NULL, ...)

Arguments

nfactors

number of factors

ncenter

integer number of center points for each block

factor.names

list of scale end values for each factor (the middle value is calculated);
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 A, B and so forth; in the coded units used in attribute desnum, -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; must consist of two numeric values for the scale ends, the default middle level is calculated

block.name

name of block factor that distinguishes between the blocks; blocks are usable for nfactors=4 and nfactors=5 only, block.name is ignored otherwise.

randomize

logical that indicates whether or not randomization should occur

seed

optional seed 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 bbd.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

Function bbd.design creates a Box-Behnken design, which is a design for quantitative factors with all factors on three levels. Box-Behnken designs should not be used if the combinations of the extreme levels of the factors are of interest (cf. also Myers, Montgomery and Anderson-Cook 2009). There are designs for 3 to 7 factors, and the unreplicated versions of these have 14 (3 factors), 24 (4 factors), 40 (5 factors), 48 (6 factors), and 56 (7 factors) runs plus the specified number of center points ncenter.

Function bbd.design is an interface to function bbd from package rsm that makes this design accessible using similar syntax as used in packages DoE.base and FrF2 and creates an output object that is also treatable by the convenience functions available in package DoE.base.

Currently, creation of replications and repeated measurements - as would be usual for other design functions - is not implemented. This is planned for the future, but does not have high priority.

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 matrix desnum attached as attribute desnum contains the coded data, the attribute run.order contains the standard order and the actual run order of the design (contrary to package rsm, the row names of the design refer to the actual rather than the standard run order).

The attribute design.info is a list of design properties. The element type of that list is the character string bbd. 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.

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. bbd.design is based on version 1 of package rsm.

Author(s)

Ulrike Groemping

References

Box, G.E.P. and Behnken, D.W. (1960). Some new three-level designs for the study of quantitative variables. Technometrics 2, 455-475.

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 FrF2, ccd.design, lhs-package, rsm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plan1 <- bbd.design(5)  ## default for 5 factors is unblocked design, contrary to package rsm
plan1
## blocked design for 4 factors, using default levels
plan2 <- bbd.design(4,block.name="block",default.levels=c(10,30))
plan2
desnum(plan2)
## design with factor.names and modified ncenter
bbd.design(3,ncenter=6, 
  factor.names=list("one"=c(25,35),"two"=c(-5,20), "three"=c(20,60)))
## design with character factor.names and default levels
bbd.design(3,factor.names=c("one","two", "three"), default.levels=c(10,20))

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
    A  B  C  D  E
1   1  0  0  1  0
2   1  0  0 -1  0
3   0  1  1  0  0
4   0  0  1 -1  0
5   0  0 -1  0  1
6   0 -1  0  0 -1
7   0  0  0  1 -1
8   0 -1  0  0  1
9  -1  0  0  0 -1
10  0  0 -1  1  0
11  0  1  0 -1  0
12  0  1  0  1  0
13  0 -1  0 -1  0
14  1 -1  0  0  0
15  0  0  0  1  1
16 -1 -1  0  0  0
17  0  0 -1  0 -1
18  0  1  0  0  1
19 -1  0  0  0  1
20  1  0  1  0  0
21  0  0  1  0 -1
22  0  1 -1  0  0
23  0 -1  0  1  0
24  0  0  0  0  0
25  0 -1  1  0  0
26  0  0 -1 -1  0
27  0  0  0  0  0
28  0  0  0 -1  1
29  1  1  0  0  0
30  0  0  1  0  1
31 -1  0 -1  0  0
32  0  0  0  0  0
33  0 -1 -1  0  0
34  0  0  0 -1 -1
35  0  0  0  0  0
36 -1  0  1  0  0
37 -1  1  0  0  0
38 -1  0  0 -1  0
39  1  0 -1  0  0
40  0  0  1  1  0
41 -1  0  0  1  0
42  1  0  0  0  1
43  1  0  0  0 -1
44  0  1  0  0 -1
class=design, type= bbd 
   block  A  B  C  D
1      1 30 10 20 20
2      1 20 20 10 30
3      1 20 20 20 20
4      1 30 30 20 20
5      1 10 10 20 20
6      1 10 30 20 20
7      1 20 20 30 30
8      1 20 20 20 20
9      1 20 20 10 10
10     1 20 20 20 20
11     1 20 20 20 20
12     1 20 20 30 10
13     2 10 20 20 10
14     2 20 30 10 20
15     2 30 20 20 10
16     2 20 20 20 20
17     2 20 20 20 20
18     2 20 10 30 20
19     2 20 30 30 20
20     2 20 10 10 20
21     2 20 20 20 20
22     2 20 20 20 20
23     2 10 20 20 30
24     2 30 20 20 30
25     3 20 20 20 20
26     3 20 10 20 10
27     3 20 10 20 30
28     3 20 20 20 20
29     3 30 20 30 20
30     3 20 20 20 20
31     3 30 20 10 20
32     3 10 20 10 20
33     3 20 30 20 10
34     3 10 20 30 20
35     3 20 20 20 20
36     3 20 30 20 30
class=design, type= bbd.blocked 
   block2 block3  A  B  C  D
1       0      0  1 -1  0  0
2       0      0  0  0 -1  1
3       0      0  0  0  0  0
4       0      0  1  1  0  0
5       0      0 -1 -1  0  0
6       0      0 -1  1  0  0
7       0      0  0  0  1  1
8       0      0  0  0  0  0
9       0      0  0  0 -1 -1
10      0      0  0  0  0  0
11      0      0  0  0  0  0
12      0      0  0  0  1 -1
13      1      0 -1  0  0 -1
14      1      0  0  1 -1  0
15      1      0  1  0  0 -1
16      1      0  0  0  0  0
17      1      0  0  0  0  0
18      1      0  0 -1  1  0
19      1      0  0  1  1  0
20      1      0  0 -1 -1  0
21      1      0  0  0  0  0
22      1      0  0  0  0  0
23      1      0 -1  0  0  1
24      1      0  1  0  0  1
25      0      1  0  0  0  0
26      0      1  0 -1  0 -1
27      0      1  0 -1  0  1
28      0      1  0  0  0  0
29      0      1  1  0  1  0
30      0      1  0  0  0  0
31      0      1  1  0 -1  0
32      0      1 -1  0 -1  0
33      0      1  0  1  0 -1
34      0      1 -1  0  1  0
35      0      1  0  0  0  0
36      0      1  0  1  0  1
   one  two three
1   30  7.5    40
2   30  7.5    40
3   30 20.0    60
4   35  7.5    60
5   30  7.5    40
6   25  7.5    20
7   30 20.0    20
8   25  7.5    60
9   35 -5.0    40
10  30 -5.0    20
11  30 -5.0    60
12  30  7.5    40
13  30  7.5    40
14  30  7.5    40
15  35 20.0    40
16  25 -5.0    40
17  35  7.5    20
18  25 20.0    40
class=design, type= bbd 
   one two three
1   20  20    15
2   15  10    20
3   10  15    10
4   15  20    20
5   20  10    15
6   15  15    15
7   10  20    15
8   10  10    15
9   15  15    15
10  15  15    15
11  15  10    10
12  15  15    15
13  20  15    20
14  15  20    10
15  10  15    20
16  20  15    10
class=design, type= bbd 

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