Thin wrapper around MatchIt::matchit(method = "nearest") that
returns a morie_match_result list for compatibility with the
rmorie balance / treatment-effect helpers.
Usage
morie_matching_nearest_neighbor(
data,
treatment,
covariates,
n_neighbors = 1L,
caliper = NULL,
replace = FALSE,
ps = NULL,
alpha = 0.05
)Arguments
- data
Data frame.
- treatment
Binary treatment column (0/1).
- covariates
Character vector of covariates for the propensity model.
- n_neighbors
Number of matches per treated unit (forwarded as
ratio).- caliper
Maximum logit-propensity distance for a valid match, expressed in SD units of the logit (or
NULLfor no caliper).- replace
If
TRUE, controls may be re-used.- ps
Optional pre-computed propensity scores (ignored; retained for back-compat).
- alpha
Significance level (carried through to
details).
Examples
if (FALSE) { # \dontrun{
res <- morie_matching_nearest_neighbor(df, "d", c("x1", "x2"),
caliper = 0.2)
} # }