Usage
randomize(data, group = c("Treat", "Control"), ratio = NULL,
indx = NULL, block = NULL, n.block = NULL, match = NULL,
complete = TRUE)Arguments
data
A data frame containing the observations to which the treatments
are randomly assigned.
group
A numerical or character vector indicating the treatment/control
groups. The length of the vector equals the total number of
such groups. The default specifies two groups called Treat
and Control.
ratio
An optional numerical vector which specifies the proportion of
the treatment/control groups within the sample. The length of the
vector should equal the number of groups. The default is the
equal allocation.
indx
An optional variable name in the data frame to be used as the names
of the observations. If not specified, the row names of the data
frame will be used so long as they are available. If the row names
are not available, the integer sequence sta
block
An optional variable name in the data frame or a formula to be used
as the blocking variables for randomized-block designs. If a
variable name is specified, then the unique values of that variable
will form blocks unless n.block i
n.block
An optional scalar specifying the number of blocks to be created for
randomized block designs. If unspecified, the unique values of the
blocking variable will define blocks. If specified, the blocks of
roughly equal size will be created based
match
An optional variable name in the data frame or a formula to be used
as the matching variables for matched-pair designs. This input is
applicable only to the case where there are two groups. Pairs of
observations will be formed based on the sim
complete
logical. If it equals TRUE (default), then complete
randomization will be performed (within each block if randomized
block designs are used). Otherwise, simple randomization will be
implemented. For matched-pair designs, com