Learn R Programming

DoE.base (version 0.23-2)

cross.design: Function to cross several designs

Description

This function generates cartesian products of two or more experimental designs.

Usage

cross.design(design1, design2, ..., randomize = TRUE, seed=NULL)

Arguments

design1
a data frame of class design that restricted by certain criteria (cf. details) if design1 is not of class design, crossing will nevertheless work, but the output object will be a da
design2
a data frame of class design with the same restrictions for design type as for design1; can also be a vector if ... is not used; cf. details for what is allowed regarding replications
...
optional further data frames that are to be crossed; they must be of class design with the above-mentioned restrictions for design types; the last element can also be a vector
randomize
logical indicating whether randomization should take place after crossing the designs
seed
seed for random number generation

Value

  • Function cross.design returns a simple data frame without design information, if design1 is not of class design. Otherwise, the value is a data frame of class design with type crossed and the following extraordinary elements:
  • cross.nrunsvector of run numbers of individual designs
  • cross.nfactorsvector of numbers of factors of individual designs
  • cross.typesvector of types of individual designs
  • cross.randomizevector of logicals (randomized or not) of individual desigs
  • cross.seedvector of seeds of individual designs
  • cross.replicationsvector of numbers of replications of individual designs
  • cross.repeat.onlyvector of logicals (repeat.only or not) of individual designs
  • cross.maplist with the map vectors for component designs of type FrF2.estimable
  • cross.selected.columnsNULL (if no oa type design) or list of column vectors for each design
  • cross.nlevelslist with the nlevels vectors for those component designs that have them
  • The standard elements are as usual, with randomize and seed referring to the randomization within function cross.design itself (previous randomizations are shown under cross.randomize and cross.seed). The nlevels element of design.info is available only if it is available for all designs that have been crossed (otherwise refer to the element cross.nlevels. The creator element of the design.info attribute consists is a 2-element list containing the list original of all the original creators and the element modify that contains the call to cross.design. If present, the clear, ncube, ncenter, residual.df, origin, comment, generating.oa elements of design.info are vector-valued. If present, the generators element of design.info is a list of character vectors. If present, the aliased and catlg.entry elements of design.info are lists of lists.

Details

Crossing is carried out recursively, following the direct.sum approach from package conf.design. All but the last designs must fulfill various criteria (cf. below). The last design to be crossed can also be a vector. Designs to be crossed must not be a blocked, nor splitplot, nor crossed, folded or Taguchi parameter design, nor designs in wide format. Furthermore, designs must not contain responses (checked via the response.names element of design.info). If replications are desired, it is recommended to accomodate them in the last design. Only the last design may have repeat.only replications. If the last design has repeat.only replications and there are also proper replications in earlier designs, a warning is thrown, but the repeat.only replications are nevertheless accomodated; this is experimental and may not yield the expected results under all circumstances.

See Also

See Also param.design

Examples

Run this code
## creating a Taguchi-style inner-outer array design
   ## with proper randomization
   ##   function param.design would generate such a design with all outer array runs 
   ##     for each inner array run conducted in sequence
   ##   alternatively, a split-plot approach can also handle control and noise factor 
   ##     designs without necessarily crossing two separate designs
   des.control <- oa.design(ID=L18)
   des.noise <- oa.design(ID=L4.2.3,nlevels=2,factor.names=c("N1","N2","N3"))
   crossed <- cross.design(des.control, des.noise)
   crossed
   summary(crossed)

Run the code above in your browser using DataLab