Create vector of integers containing block identifiers
Creates a vector of integers which represent unique blocks in an
object output from
createBlockIDs(obj, data, id.var)
- an output object from
- the data frame that was input into
- a string specifying which column of
datacontains identifying information.
Under the current implementation,
should be set to
If blocking was performed specifying a
createBlockIDs will assign block ID values that are unique
across groups. In other words,
createBlockIDs does not restart
numbering when it encounters a new group of blocks.
A numeric vector of integers with
nrow(data)elements with lowest value equal to 1, corresponding to the block each unit is in. For units in
datathat are not in
obj, the value of NA is assigned.
data(x100) out <- block(x100, groups = "g", n.tr = 2, id.vars = c("id"), block.vars = c("b1", "b2")) createBlockIDs(out, x100, id.var = "id") ## block ID integers are unique, even with several groups