Skip to contents

Thin wrapper around MatchIt::matchit(method = "subclass") that reports within-stratum sample sizes and PS ranges, preserving the rmorie return shape (data_with_strata + stratum_effects).

Usage

morie_matching_subclassify(
  data,
  treatment,
  covariates,
  ps = NULL,
  n_strata = 5L
)

Arguments

data

Data frame.

treatment

Binary treatment column name.

covariates

Character vector of covariates.

ps

Optional pre-computed propensity scores (ignored; retained for back-compat).

n_strata

Number of quantile-based strata (default 5).

Value

A list with components data_with_strata (the matched data augmented with ._stratum and ._ps columns) and stratum_effects (per-stratum sample sizes and PS ranges).

Examples

if (FALSE) { # \dontrun{
morie_matching_subclassify(df, "d", c("x1", "x2"), n_strata = 5)
} # }