assign.grp {nbpMatching} | R Documentation |
Random Group Assignment
Description
Randomly assign each element into treatment group A or B.
Usage
assign.grp(matches, seed = 68, ...)
Arguments
matches |
A data.frame or nonbimatch object. Contains information on how to match the covariate data set. |
seed |
Seed provided for random-number generation. Default value of 68. |
... |
Additional arguments, not used at the moment. |
Details
This function takes the matched pairs generated by nonbimatch and randomly assigns each element to a group.
Value
original data.frame with treatment group column
Author(s)
Cole Beck
See Also
Examples
df <- data.frame(id=LETTERS[1:25], val1=rnorm(25), val2=rnorm(25))
df.dist <- gendistance(df, idcol=1)
df.mdm <- distancematrix(df.dist)
df.match <- nonbimatch(df.mdm)
assign.grp(df.match)
assign.grp(df.match$matches)
[Package nbpMatching version 1.5.5 Index]