Examples¶
Each page mirrors a script in the repository’s examples/ directory and
shows its output. “Matching” means different things: most pages use
nearest-neighbor matching on a propensity score (a logit of the treatment on
the covariates), and the titles say when one uses another method
(Mahalanobis, kernel and ridge,
coarsened exact). To choose among them, see
Choosing a matching method. Run the scripts from the
repository’s root:
python examples/quickstart.py
Page |
What it shows |
|---|---|
1:1 matching on a fitted score with replacement, exact strata, a caliper; balance; the ATT with Abadie-Imbens SEs |
|
Greedy 1:1 nearest-neighbor matching on the propensity score, without replacement, calipers on the score and covariates, a score model with absorbed fixed effects, pairs to Parquet |
|
k = 3 on the propensity score, with ties and calipers; |
|
Nearest-neighbor matching on the covariates, with no propensity score, within strata |
|
The default bandwidth, cross-validation, influence-function SEs |
|
Cells, weights, balance and the effect |
|
When to use which standard error: Abadie-Imbens SEs, |
|
A million units in Parquet files, matched a stratum batch at a time |
The simulated data¶
simulate_matching draws units in 20 exact strata (r x i) with three
normal covariates x1, x2, x3, a logistic treatment d whose
probability (ps, the true score) depends on the covariates and the
stratum, and an outcome
so the treatment effect is 1 for everyone (effect= changes it). With its
defaults it reproduces tests/data/ref_data.csv, the data the test suite’s reference
values were computed on.