assign.grp: Random Group Assignment

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Randomly assign each element into treatment group A or B.

Usage

1
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

nonbimatch

Examples

1
2
3
4
5
6
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)

nbpMatching documentation built on May 29, 2017, 7:22 p.m.