Native greedy nearest-neighbour matching on the logit propensity
score (Rosenbaum & Rubin 1985; caliper per Cochran & Rubin 1973).
The propensity model is base stats::glm; no MatchIt at
runtime. Returns the same morie_match_result shape as
always; cross-validated against MatchIt in tests/cross/.
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).
