matches: Function to find pair matches using a distance matrix....

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

View source: R/nearfar.R

Description

Given values of percent sinks and cutpoint, this function will find the corresponding near-far match

Usage

1
2
matches(dta, covs, iv = NA, imp.var = NA, tol.var = NA, sinks = 0,
    cutpoint = NA)

Arguments

dta

The name of the data frame on which to do the matching

covs

A vector of the names of the covariates to make “near”, e.g., covs=c("age", "sex", "race")

iv

The name of the instrumental variable, e.g., iv="QOB"

imp.var

A list of (up to 5) named variables to prioritize in the “near” matching

tol.var

A list of (up to 5) tolerances attached to the prioritized variables where 0 is highest penalty for mismatch

sinks

Percentage of the data to match to sinks (and thus remove) if desired; default is 0

cutpoint

Value below which individuals are too similar on iv; increase to make individuals more “far” in match

Details

Default settings yield a "near" match on only observed confounders in X; add IV, sinks, and cutpoint to get near-far match.

Value

A two-column matrix of row indices of paired matches

Author(s)

Joseph Rigdon jrigdon@stanford.edu

References

Lu B, Greevy R, Xu X, Beck C (2011). Optimal nonbipartite matching and its statistical applications. The American Statistician, 65(1), 21-30.

See Also

opt_nearfar

Examples

1
2
3
k2 = matches(dta=mtcars, covs=c("cyl", "disp"), sinks=0.2, iv="carb",
    cutpoint=2, imp.var=c("cyl"), tol.var=0.03)
k2[1:5, ]

nearfar documentation built on June 3, 2017, 1:02 a.m.

Search within the nearfar package
Search all R packages, documentation and source code