{DoE.wrapper}R Documentation

Function for generating Box-Behnken designs


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

Usage, ncenter=4, factor.names = NULL, default.levels=c(-1,1), 
, randomize=TRUE, seed=NULL, ...)



number of factors


integer number of center points for each block


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 (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

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


logical that indicates whether or not randomization should occur


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
before running function
It is recommended to change the setting back to the new recommended way afterwards:
For an example, see the documentation of the example data set VSGFS.


reserved for future usage


Function 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 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.


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 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.


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.


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


Ulrike Groemping


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,, 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,, lhs-package, rsm


plan1 <-  ## default for 5 factors is unblocked design, contrary to package rsm
## blocked design for 4 factors, using default levels
plan2 <-,"block",default.levels=c(10,30))
## design with factor.names and modified ncenter,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,factor.names=c("one","two", "three"), default.levels=c(10,20))

[Package DoE.wrapper version 0.12 Index]