make_match_distances: Make match distances within strata

View source: R/match_functions.R

make_match_distancesR Documentation

Make match distances within strata

Description

Makes the match distance with strata specifications for strata_match. This function is largely unecessary to call outside of stratamatch, but it is exported for the benefit of the user to aid in debugging.

Usage

make_match_distances(object, model, method)

Arguments

object

a strata object

model

(optional) formula for matching. If left blank, all columns of the analysis set in object will be used as covariates in the propensity model or mahalanobis match (except outcome, treatment and stratum)

method

either "prop" for propensity score matching based on a glm fit with model model, or "mahal" for mahalanobis distance matching by the covariates in model.

Value

a match distance matrix for optmatch

Examples


dat <- make_sample_data(n = 75)

# stratify with auto_stratify
a.strat <- auto_stratify(dat, "treat", outcome ~ X2, size = 25)
md <- make_match_distances(a.strat, treat ~ X1 + X2, method = "mahal")

raikens1/stratamatch documentation built on April 1, 2022, 9:48 p.m.