make_match_distances {stratamatch} | R 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. Note that this
function requires that the R package optmatch
is installed.
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 |
method |
either "prop" for propensity score matching based on a glm fit
with model |
Value
a match distance matrix for optmatch
See Also
https://cran.r-project.org/package=optmatch
Examples
dat <- make_sample_data(n = 75)
# stratify with auto_stratify
a.strat <- auto_stratify(dat, "treat", outcome ~ X2, size = 25)
# make match distances. Requires optmatch package to be installed.
md <- make_match_distances(a.strat, treat ~ X1 + X2, method = "mahal")
[Package stratamatch version 0.1.9 Index]