planor.randomize {planor} | R Documentation |
Randomize a factorial design according to a specified block structure formula.
planor.randomize(blockformula, data, out.order, keep.initial=FALSE)
blockformula |
the block structure formula. |
data |
a data frame. |
out.order |
a list of |
keep.initial |
if TRUE, the initial row order of the design
is stored in column |
The input data frame after randomization.
Each name in blockformula
must correspond to a factor
of the dataframe data
. The only exception is
UNITS
. If UNITS
is used in blockformula
but absent from data
, a factor is added to data
,
with one level per row. See the examples below for the usage of
UNITS
in blockformula
.
Monod, H. and Bouvier, A.
Bailey, R.A. (1983) Generalized wreath products of permutation groups. Proc. London Math. Soc., 47, 69–82.
Kobilinsky A. (1989) Randomization of a cartesian block structure. Technical Report. Laboratoire de Biométrie. INRA. Versailles.
### Block design Design <- data.frame(block=rep(1:4,rep(2,4)), treatment=c("A1","B1","A2","B2","A3","B3","A4","B4")) ### No within-block randomization planor.randomize(~block, data=Design) ### Blocks and units within blocks randomization planor.randomize(~block/UNITS, data=Design) ### Row-Column design RowColDes <- data.frame(row=rep(1:3,rep(3,3)),col=rep(1:3,3), treatment=LETTERS[c(1:3,2,3,1,3,1,2)], oldRow=rep(1:3,rep(3,3)),oldCol=rep(1:3,3)) planor.randomize(~row*col, data=RowColDes)