Bias-corrected nearest-neighbor matching (Matching)
Follow the analysis.
Select a node to explore the method
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)
Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.
Questions to explore- Which assumption matters most here, and what evidence could challenge it?
- What would you check before passing this output to the next step?
Choose a question to start your comment.
Peer discussion
- Bring your experience, a question, or a different perspective.
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")
Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.
Questions to explore- Which assumption matters most here, and what evidence could challenge it?
- What would you check before passing this output to the next step?
Choose a question to start your comment.
Peer discussion
- Bring your experience, a question, or a different perspective.
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)
Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.
Questions to explore- Which assumption matters most here, and what evidence could challenge it?
- What would you check before passing this output to the next step?
Choose a question to start your comment.
Peer discussion
- Bring your experience, a question, or a different perspective.
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)
Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.
Questions to explore- Which assumption matters most here, and what evidence could challenge it?
- What would you check before passing this output to the next step?
Choose a question to start your comment.
Peer discussion
- Bring your experience, a question, or a different perspective.
Log in to comment on this step.
Inputs & data
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 |
Result figure rendered by StatsOtter from the package's documented example — unofficial community showcase; all credit to the original authors.
The estimate
\hat\tau_{\mathrm{ATT}}=\frac1{n_1}\sum_{Z_i=1}\big(Y_i-\hat Y_i(0)\big),\quad \hat Y_i(0)=\frac1M!\sum_{j\in\mathcal J_M(i)}! Y_j
⚠️ 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
Discuss the workflow (0)
Log in to join the discussion.