Match treated and control units on covariates, then bias-correct and get the correct large-sample standard errors.
Input · what goes in
A treatment indicator Tr, an outcome Y, and a matrix of covariates X (or estimated propensity scores).
Show data format & exampleHide example
| Y | Tr | age | educ |
|---|---|---|---|
| 12.0 | 1 | 34 | 12 |
| 9.5 | 0 | 31 | 11 |
| 14.2 | 1 | 45 | 16 |
| 8.8 | 0 | 29 | 10 |
Pipeline · the recipe
↑ Click any step in the diagram to read its logic, code, assumptions & discussion.
Fit the propensity score model
Data preparation — shapes the raw inputs into what the estimator expects.
Estimate the propensity score with a logit of treatment on the LaLonde covariates (Dehejia-Wahba specification).
# Install: install.packages("Matching")
library(Matching)
data(lalonde)
glm1 <- glm(treat ~ age + I(age^2) + educ + I(educ^2) + black +
hisp + married + nodegr + re74 + I(re74^2) +
re75 + I(re75^2) + u74 + u75,
family = binomial, data = lalonde)
- No comments on this step yet — be the first.
Log in to comment on this step.
Bias-adjusted nearest-neighbor matching
The core estimate — where the causal quantity itself is computed.
Match treated to control on covariates with replacement and turn on Abadie-Imbens bias adjustment.
X <- cbind(lalonde$age, lalonde$educ, lalonde$black, lalonde$hisp,
lalonde$married, lalonde$nodegr, lalonde$re74, lalonde$re75)
Y <- lalonde$re78
Tr <- lalonde$treat
m <- Match(Y = Y, Tr = Tr, X = X, M = 1, BiasAdjust = TRUE, estimand = "ATT")
- No comments on this step yet — be the first.
Log in to comment on this step.
Check covariate balance after matching
A pre-flight check — run this before trusting any estimate downstream.
MatchBalance reports pre- and post-match treated/control means and t-test p-values for every covariate.
mb <- MatchBalance(treat ~ age + educ + black + hisp + married +
nodegr + re74 + re75,
match.out = m, nboots = 500, data = lalonde)
- No comments on this step yet — be the first.
Log in to comment on this step.
Report the ATT with Abadie-Imbens SE
Uncertainty quantification — standard errors, intervals, and aggregation.
summary(m) prints the ATT estimate, the analytic Abadie-Imbens standard error, t-stat, and matched sample sizes.
summary(m)
- No comments on this step yet — be the first.
Log in to comment on this step.
Output · what you get
Result figure rendered by StatsOtter from the package's documented example — unofficial community showcase; all credit to the original authors.
Result · the numbers
⚠️ Unofficial community showcase of Matching (docs). Not affiliated with the authors — all credit to Guido Imbens & coauthors; this summarizes public documentation.
What it does. Estimates treatment effects (ATE/ATT) in observational data by pairing each treated unit with similar control units on covariates or a propensity score. How it works. It performs multivariate nearest-neighbor matching (with replacement), optionally applies a regression-based bias correction for inexact matches, and—uniquely—computes the Abadie-Imbens variance estimator instead of naive standard errors. Sekhon's package also supports genetic matching to optimize covariate balance. Assumptions. Unconfoundedness (selection on observables) and overlap/common support between treated and control covariate distributions. Imbens's contribution. Abadie & Imbens (2006, Econometrica) derived the large-sample properties of matching estimators and showed that the bootstrap is invalid for matching, motivating their analytic variance estimator and bias correction—exactly what Matching implements via BiasAdjust and its standard errors.
What you get — Estimated ATT/ATE with Abadie-Imbens standard errors and covariate balance diagnostics.
Example output
Estimate... 1824.2
AI SE...... 802.3
T-stat.... 2.2738
p.val..... 0.022972
Original number of observations.............. 445
Original number of treated obs............... 185
Matched number of observations............... 185
Matched number of observations (unweighted). 314
***** (V1) age *****
Before Matching After Matching
mean treatment........ 25.816 25.816
mean control.......... 25.054 25.692
std mean diff......... 10.655 1.7370
T-test p-value........ 0.26594 0.81080

Discussion (0)
Log in to join the discussion.