Machine Learning-Augmented Propensity Score Matching

Statistics
Introduced by
McCaffrey, Ridgeway & Morral (2004); Westreich, Lessler & Funk (2010)
Year
2004
Type
Causal inference / matching
Family
Quasi-experimental / causal inference

What does it do?

Machine learning-augmented propensity score matching (ML-PSM) estimates propensity scores with flexible machine learning algorithms, such as gradient boosted trees, random forests, or penalised regression (LASSO or elastic net), in place of the logistic regression traditionally used.

The aim is to model nonlinear relationships and interactions among covariates and treatment assignment more accurately. Better-fitting scores can improve covariate balance between matched treated and control units, which bears on bias in the estimated average treatment effect on the treated (ATT).

The intuition behind the method

Classic propensity score matching typically relies on a logistic regression for treatment assignment. If the true relationship between covariates and treatment is nonlinear or involves interactions the model omits, the scores will be misspecified and the matches may be poor. Machine learning algorithms can detect such patterns without the analyst specifying them in advance, which can produce scores that track treatment assignment more closely. Closer scores can reduce residual imbalance between matched groups, but they do not remove confounding from variables that were not measured. The added flexibility carries its own risk: the models must be tuned and checked to avoid overfitting.

History

Propensity score methods for observational causal estimation are long established. McCaffrey, Ridgeway and Morral (2004) introduced the use of boosted regression to estimate propensity score weights, in a study of adolescent probationers in substance-abuse treatment programmes, and reported that the boosted weights eliminated most pretreatment group differences. That work concerned weighting rather than matching. Westreich, Lessler and Funk (2010) compared neural networks, support vector machines, CART and meta-classifiers with logistic regression for propensity score estimation. The use of machine learning-estimated scores as the basis for matching, the variant described on this page, developed as an extension of these approaches.

When to use it

Use ML-PSM for observational data with a binary treatment and a large set of measured pre-treatment covariates, where the relationship between covariates and treatment is plausibly nonlinear or involves interactions that a logistic model would not capture. It is a reasonable choice when there are many candidate confounders and no firm basis for a particular functional form. Do not use it as a substitute for subject-matter knowledge: the causal interpretation still depends on the measured covariates capturing all common causes of treatment and outcome. Avoid it when the sample is small, since flexible models overfit and produce extreme scores, or when a logistic model already gives good balance, in which case the added complexity adds little.

Limitations and considerations

  • ML propensity score models have tuning parameters such as tree depth, regularisation strength and number of trees; poor tuning can produce scores that are either too smooth or too noisy.
  • Bootstrap inference that repeats the entire ML estimation is computationally expensive for large datasets.
  • Unmeasured confounding cannot be addressed: if important covariates are missing from X, no machine learning technique can restore causal identification.
  • The propensity score model is harder to interpret than a logistic regression, which may matter in regulatory or replication settings.
  • In small samples, overfitting can produce propensity scores near 0 or 1, which reduces overlap between treated and control units.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • The treatment model does not require the functional form to be specified in advance, so nonlinear terms and interactions can enter the score without being hand-coded.
  • In the substance-abuse study by McCaffrey et al. (2004), which concerned propensity score weighting rather than matching, boosted weights eliminated most pretreatment group differences where covariate numbers and functional forms were difficult to handle.
  • Once the scores are estimated, they can be paired with different matching algorithms, such as nearest-neighbour, kernel or radius matching.

Applications

  • Comparative effectiveness research in medicine: matching patients who receive one drug versus another on high-dimensional claims or EHR covariate sets.
  • Labour economics: evaluating training programme impacts when programme participation depends on many socioeconomic characteristics with complex interactions.
  • Education policy: estimating school voucher or charter school effects when selection into treatment is driven by rich neighbourhood and family covariates.
  • Marketing analytics: measuring the causal effect of a promotional campaign when targeting was based on many behavioural and demographic signals.
  • Environmental and health policy: estimating pollution exposure effects when exposure assignment depends on nonlinear geographic and demographic patterns.

How it works

How it works

1

A machine learning classifier is trained to predict the binary treatment indicator T from the covariate matrix X, and its predicted probabilities serve as the estimated propensity score. Candidate algorithms named on this page include gradient boosted CART, random forests, penalised regression (LASSO or elastic net), and neural networks. McCaffrey, Ridgeway and Morral (2004) used boosted regression to estimate propensity score weights when covariate numbers were large and functional forms were uncertain. Westreich, Lessler and Funk (2010) compared several classifiers, including neural networks, support vector machines and CART, as alternatives to logistic regression.

Formula
\hat{e}(X_i) = \Pr(T_i=1 \mid X_i) \approx f_{\text{ML}}(X_i)
2

Before and after matching, covariate balance is assessed using standardised mean differences (SMD) and, optionally, the Kolmogorov-Smirnov statistic for continuous variables. Good balance on the measured covariates indicates that the scores have done their job on those variables. Adequate balance should be judged against a threshold for the absolute SMD that is set before the outcome analysis, and the threshold should be reported with the results. Overlap should be checked by comparing the distributions of the propensity scores in the treated and control groups; where many units have no counterpart in the other group, trimming is needed before inference. Balance diagnostics do not test the assumption of no unmeasured confounding. Poor balance signals that the scores model or the matching algorithm needs adjustment.

3

Treated units are matched to one or more control units whose estimated propensity scores lie within a specified caliper, here 0.2 standard deviations of the log-odds. Common matching algorithms include nearest-neighbour matching with or without replacement, kernel matching, and radius matching. The matched sample is retained for outcome analysis, and unmatched units are discarded. The caliper should be checked against the balance it produces, not treated as fixed.

4

In the matched sample, the ATT is the average over treated units of the difference between each treated unit's outcome and the weighted average outcome of its matched controls, following the displayed formula. Here M(i) is the set of control units matched to treated unit i, and w_j is the weight given to matched control j. With equal weighting, w_j = 1/|M(i)|, so each treated unit is compared with the mean outcome of its own matched controls. The weighting scheme should be stated with the estimate, because the choice changes the computed value.

Formula
\hat{\tau}_{ATT} = \frac{1}{n_1} \sum_{i: T_i=1} \left( Y_i - \sum_{j \in \mathcal{M}(i)} w_j Y_j \right)
5

Standard errors should reflect both stages of the procedure: estimation of the propensity scores and the subsequent matching and outcome analysis. One option is a bootstrap that repeats the full pipeline on each resample. The bootstrap is not guaranteed to be valid for every matching estimator, so its validity should be checked for the matching algorithm used, and the choice of inference method should be justified in reporting. Standard variance formulas that treat the estimated scores as known can understate uncertainty.

Common pitfalls

  • Reporting ATT estimates without checking covariate balance in the matched sample. Balance, not the fit of the propensity model (for example, R-squared), is the relevant diagnostic.
  • Using the same data to fit the ML model and to estimate the outcome effect without sample splitting or cross-fitting, which can introduce data-adaptive bias.
  • Ignoring the common support (overlap) assumption. When propensity scores cluster near 0 or 1, many treated or control units lack valid matches and should be trimmed before inference.
  • Treating ML-PSM as automatic bias elimination. The method still requires a well-measured covariate set that satisfies the unconfoundedness assumption.
  • Bootstrapping only the matching or outcome stage. Uncertainty from the ML estimation stage must be included, so the whole pipeline should be repeated.

Frequently asked questions

Which ML algorithm works best for propensity score estimation?

No single algorithm has been established as best in general. McCaffrey, Ridgeway and Morral (2004) used boosted regression, and Westreich, Lessler and Funk (2010) compared several classifiers, including neural networks, support vector machines and CART, with logistic regression. In practice, candidate models are usually compared on covariate balance after matching rather than on predictive accuracy alone.

Does ML-PSM solve the problem of unmeasured confounding?

No. Like all propensity score methods, ML-PSM requires the unconfoundedness (ignorability) assumption: all variables that jointly determine treatment and outcome must be included in X. ML improves how the measured confounders are handled, but no algorithm can recover confounders that were never measured.

How should I report uncertainty for ML-PSM estimates?

One option is a bootstrap that re-runs the full pipeline, including ML model training, propensity score estimation, matching and outcome estimation, on each bootstrap sample. The bootstrap is not guaranteed to be valid for every matching estimator, so check its validity for the matching algorithm used and justify the inference method in reporting. Standard analytic variance formulas that ignore the first stage can understate uncertainty.

When should I prefer doubly robust estimation over pure ML-PSM?

Doubly robust estimators, such as augmented IPW or targeted learning, combine a propensity model with an outcome model. Augmented IPW-type estimators are doubly robust: under the stated conditions, the ATT estimator remains consistent if either the propensity model or the outcome model is correctly specified. This property depends on the specific estimator and the estimand, so it should be verified for the estimator in use rather than assumed. If either model may be partly misspecified, this can offer protection that plain ML-PSM does not.

Is a large sample required?

No fixed sample size is prescribed. Judge adequacy by the degree of overlap and balance in the matched sample. As a practical rule, rather than a formal requirement, make sure there are enough treated units to find matches within the caliper for most of the treated group. In small samples, flexible models can overfit the training data and produce extreme propensity scores, which degrades matching quality. Use cross-validation to tune the ML model, and cross-fitting where the same data are used for score estimation and outcome analysis. With very small samples, a well-specified logistic regression is usually safer.

Related methods

Sources

  1. McCaffrey, D. F., Ridgeway, G., & Morral, A. R. (2004). Propensity score estimation with boosted regression for evaluating causal effects in observational studies. Psychological Methods, 9(4), 403-425.

    Open DOI reference
  2. Westreich, D., Lessler, J., & Funk, M. J. (2010). Propensity score estimation: neural networks, support vector machines, decision trees (CART), and meta-classifiers as alternatives to logistic regression. Journal of Clinical Epidemiology, 63(8), 826-833.

    Open DOI reference