match_data_groups: Match Data with Group Information

Description Usage Arguments Value Examples

Description

An extension of the match.data function from the MatchIt library. Equivalent to performing match.data(m.out) with the addition of providing the matched group data, which is provided in the STRATA variable.

Usage

1
match_data_groups(m.out, df, join_index)

Arguments

m.out

The m.out object from calling 'matchit' (e.g. matchit(formula, data=prematch_df)).

df

The data.frame object that was called by 'matchit' to create 'm.out'.

join_index

The unique identifier used to left join items from the prematch data.frame to the postmatch data.frame.

Value

Returns a data.frame that has the matched data (created by 'match.data(m.out)' with a new column called STRATA which has the matching group information.

Examples

1
2
3
4
5
library(MatchIt)

# m.out was already created by calling 'matchit'

matched_data <- match_data_groups(m.out, prematch_data, join_index="ID")

jjinho/sos documentation built on May 21, 2019, 4:06 a.m.