block
, assign elements
of each row to treatment condition columns. Each element is equally
likely to be assigned to each column.assignment(block.obj, seed = NULL, namesCol = NULL)
block
, or a user-specified
block object.block.obj
can be specified directly by the user. It can be a
single dataframe or matrix with blocks as rows and treatment conditions
as columns. assignment
is designed to take a list with two
elements. The first element should be named {$blocks, and should
be a list of dataframes. Each dataframe should have blocks as rows and
treatment conditions as columns. The second element should be a logical
named {$level.two.
Specifying the random seed yields constant assignment, and thus allows
for easy replication of experimental protocols.If namesCol = NULL
, then ``Treatment 1", ``Treatment 2", ...are
used.
}
[object Object]
## First, block out <- block(x100, groups = "g", n.tr = 2, id.vars = c("id"), block.vars = c("b1", "b2"), algorithm="optGreedy", distance = "mahalanobis", level.two = FALSE, valid.var = "b1", valid.range = c(0,500), verbose = TRUE) ## Second, assign assg <- assignment(out, seed = 123) ## assg contains 3 data frames