assign.grp: Random Group Assignment

assign.grpR 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

nonbimatch

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)


nbpMatching documentation built on Sept. 25, 2024, 9:06 a.m.