Evaluating Causal Impact: PSM, DiD, Synthetic Controls, and DML
Statistics & ExperimentsModel answerLast updated
Master core causal inference tools (PSM, DiD, SCM, and DML), their identification assumptions, failure modes, and modern estimation techniques for observational data.
Context
Suppose your analytics team needs to measure the causal effect of an offline marketing campaign on customer quarterly spend. Random assignment was not possible: the marketing team specifically targeted regions with historically high engagement and users with high propensity to convert.
Questions
-
Propensity Score Matching (PSM)
- Formalize the identification assumptions required to estimate the Average Treatment Effect on the Treated (ATT) under PSM.
- Describe the step-by-step workflow for implementing PSM and verifying its validity.
- What is the single biggest statistical vulnerability of PSM when analyzing non-randomized data?
-
Difference-in-Differences (DiD)
- Define the classic $2 \times 2$ DiD estimator in both sample-mean and fixed-effects regression formats.
- State the primary identification assumption, explain how to test it empirically, and describe how to handle non-parallel trend baseline differences.
- Why does standard Two-Way Fixed Effects (TWFE) break down under staggered rollouts with time-varying treatment effects, and what modern estimators fix this?
-
Synthetic Control Method (SCM)
- In what operational scenarios is Synthetic Control strictly preferred over standard DiD?
- Explain how donor weights are computed and how hypothesis testing is conducted when there is only one treated unit ($N_1 = 1$).
-
Double Machine Learning (DML)
- Write out the Partially Linear Regression model used in DML.
- Why does plug-in estimation using high-dimensional ML algorithms (e.g., Random Forests, XGBoost, Lasso) introduce bias into the causal parameter?
- Detail how Neyman Orthogonality and Cross-Fitting resolve these issues to deliver $\sqrt{N}$-consistent inference.
Hints
Hint 1
Recall the potential outcomes notation: express ATT as E[Y(1) - Y(0) | D=1].
Hint 2
Distinguish between selection on observables (PSM) and selection on unobservables (DiD).
Hint 3
For DML, focus on regularization bias and overfitting bias, and show how residualization cancels out first-order nuisance estimation errors.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
1. Conceptual Framework & Target Estimand
To measure campaign impact without randomized treatment assignment ($D_i \in {0, 1}$), we apply Rubin’s Potential Outcomes Framework. Let $Y_i(1)$ be the potential quarterly spend of customer $i$ if exposed to the campaign, and $Y_i(0)$ be the potential spend if unexposed.
Because targeted campaigns focus on high-intent cohorts, comparing raw averages yields severe upward selection bias ($\mathbb{E}[Y(0) \mid D=1] > \mathbb{E}[Y(0) \mid D=0]$). The target estimand is the Average Treatment Effect on the Treated (ATT):
$$\tau_{\text{ATT}} = \mathbb{E}[Y(1) - Y(0) \mid D = 1] = \mathbb{E}[Y(1) \mid D = 1] - \mathbb{E}[Y(0) \mid D = 1]$$
The primary challenge is estimating the unobserved counterfactual baseline $\mathbb{E}[Y(0) \mid D = 1]$.
2. Propensity Score Matching (PSM)
Identification Assumptions
To identify ATT via propensity scores $e(X) = P(D=1 \mid X)$:
- Conditional Ignorability (Unconfoundedness): $(Y(1), Y(0)) \perp!!!\perp D \mid X$. All baseline covariates driving both campaign selection and quarterly spend are fully observed in $X$.
- Weak Overlap (Positivity for ATT): $e(X) < 1$ for all $X$ in the support of the treated group. Every treated unit must have a non-zero probability of being in the control group.
- SUTVA (Stable Unit Treatment Value Assumption): No spillover effects (one customer receiving the campaign does not affect another's outcome) and uniform treatment intensity.
Step-by-Step Workflow & Diagnostics
- Fit Propensity Model: Estimate $e(X)$ using logistic regression or gradient boosted trees using strictly pre-treatment variables.
- Assess Common Support: Plot overlap densities of $e(X)$ for treated and untreated groups. Trim observations outside common support (e.g., $e(X) \notin [0.01, 0.99]$).
- Perform Matching: Match each treated unit to control unit(s) using nearest-neighbor matching on the logit of the propensity score with a tight caliper (e.g., $0.2 \times \sigma_{\text{logit}}$).
- Evaluate Balance (Crucial Step): Compute the Standardized Mean Difference (SMD) for every covariate $X_j$: $$\text{SMD}j = \frac{\bar{X}{j, \text{treated}} - \bar{X}{j, \text{control}}}{\sqrt{\frac{s{j, \text{treated}}^2 + s_{j, \text{control}}^2}{2}}}$$ Rule of thumb: $\text{SMD} < 0.1$ across all covariates, quadratic terms, and interactions. High predictive accuracy (e.g., high AUC of $e(X)$) indicates poor overlap, not a good causal model.
- Estimate ATT: Compute the mean outcome difference between matched pairs. Use Abadie-Imbens analytical standard errors or bootstrap the entire matching pipeline (noting standard bootstrap is non-smooth for 1-to-1 nearest neighbor matching). Alternatively, use Doubly Robust AIPW weighting.
Fundamental Vulnerability
PSM only controls for selection on observables. If an unobserved variable (e.g., underlying customer brand loyalty or unmeasured offline intent) influences both campaign exposure and spending, PSM produces biased causal estimates.
3. Difference-in-Differences (DiD)
DiD controls for unobserved time-invariant confounders by utilizing pre- and post-treatment longitudinal panel data.
Formulations
The standard $2 \times 2$ sample-mean estimator is: $$\hat{\tau}{\text{DiD}} = (\bar{Y}{\text{treat, post}} - \bar{Y}{\text{treat, pre}}) - (\bar{Y}{\text{ctrl, post}} - \bar{Y}_{\text{ctrl, pre}})$$
In a two-way fixed effects (TWFE) regression: $$Y_{it} = \alpha_i + \lambda_t + \tau_{\text{DiD}} (D_i \times \text{Post}t) + \varepsilon{it}$$ where $\alpha_i$ are unit fixed effects, $\lambda_t$ are time fixed effects, and standard errors are clustered at the assignment level (e.g., regional market level).
Identification & Diagnostics
The critical identifying condition is the Parallel Trends Assumption: $$\mathbb{E}[Y(0){\text{post}} - Y(0){\text{pre}} \mid D=1] = \mathbb{E}[Y(0){\text{post}} - Y(0){\text{pre}} \mid D=0]$$
Outcome Spend (Y)
^
| Treated (Observed Post-Campaign) --> Y_treat,post
| /
| / <--- [Estimated Effect τ]
| /
| - - - - - - - / - - - - - - - -> Counterfactual Y(0)_post
| / /
| / / Parallel Trajectory
| Y_treat,pre /
| / Control Group
| Y_ctrl,pre /
| /-----> Y_ctrl,post
+---------------------------------------------> Time
Pre Post
Testing & Handling Non-Parallel Trends:
- Event Study Specification: Estimate dynamic coefficients $\tau_k$: $$Y_{it} = \alpha_i + \lambda_t + \sum_{k = -K, k \ne -1}^{M} \tau_k (D_i \times \mathbb{I}(t = t^* + k)) + \varepsilon_{it}$$ Pre-period leads ($\tau_k$ for $k < -1$) must be statistically zero.
- Conditional Parallel Trends: If raw trends diverge, combine DiD with propensity score matching or inverse probability weighting (e.g., Sant'Anna & Zhao Doubly Robust DiD) to balance pre-treatment characteristics.
Failure of TWFE under Staggered Rollouts
When units receive campaigns at different times and treatment effects evolve over time (heterogeneous treatment effects), standard TWFE standard regressions decompose into a weighted average of pairwise comparisons. Crucially, already-treated units act as controls for later-treated units. Subtracting dynamic treatment trajectories causes negative weighting and severe bias.
Solution: Use modern staggered estimators such as Callaway & Sant'Anna (2021) or Sun & Abraham (2021), which clean control groups by comparing newly treated units strictly against never-treated or not-yet-treated cohorts.
4. Synthetic Control Method (SCM)
When SCM Beats DiD
Synthetic Control is preferred over DiD when:
- Aggregate treatment on very few units (e.g., $N_1 = 1$ state or metro area).
- Parallel trends fail pre-treatment: No single control region mirrors the treated region's trajectory.
- Long pre-treatment timeline: Extensive historical data is available to train donor weights.
Mechanics and Inference ($N_1 = 1$)
SCM constructs a synthetic counterfactual unit by finding non-negative weights $W = (w_1, w_2, \dots, w_J)^T$ over $J$ untreated donor units such that $\sum_{j=1}^J w_j = 1$.
The weight vector minimizes pre-treatment prediction error: $$\min_{W} | X_1 - X_0 W |V \quad \text{s.t.} \quad w_j \ge 0, \sum{j=1}^J w_j = 1$$ where $X_1$ is the vector of pre-treatment characteristics/outcomes for the treated unit, $X_0$ is the matrix for donor units, and $V$ measures variable importance.
Inference via Placebo Tests: Standard $p$-values are non-applicable with $N_1 = 1$. Instead:
- Re-run the SCM optimization iteratively on every untreated donor unit in the donor pool (in-space placebos).
- Calculate the ratio of Post-Treatment Mean Squared Prediction Error (MSPE) to Pre-Treatment MSPE for the treated unit and all placebos.
- The exact $p$-value is the proportion of placebo units with a Post/Pre MSPE ratio equal to or larger than the treated unit's ratio: $$p = \frac{\sum_{j=1}^J \mathbb{I}\left(\text{Ratio}j \ge \text{Ratio}{\text{treated}}\right)}{J + 1}$$
5. Double Machine Learning (DML)
When controlling for high-dimensional confounders $X$ (e.g., user activity features, purchase histories), ML predictions introduce non-negligible bias into standard regression models. DML resolves this.
Partially Linear Regression Model (PLR)
$$Y = \theta D + g(X) + U, \quad \mathbb{E}[U \mid D, X] = 0$$ $$D = m(X) + V, \quad \mathbb{E}[V \mid X] = 0$$
Where $\theta$ is the causal effect parameter, $g(X) = \mathbb{E}[Y \mid X] - \theta m(X)$ is the high-dimensional outcome nuisance function, and $m(X) = \mathbb{E}[D \mid X]$ is the treatment nuisance function.
Failure of Naive Machine Learning
If you fit $\hat{g}(X)$ using Lasso, Random Forests, or Gradient Boosting and plug it directly into linear regression, $\hat{\theta}$ suffers from two core biases:
- Regularization/Shrinkage Bias: ML models optimize for prediction ($|Y - \hat{Y}|_2$), not unbiased structural parameter estimation. They compress parameter coefficients, leaking confounding bias into $\hat{\theta}$.
- Overfitting Bias: Using the same observations to train $\hat{g}(X)$ and estimate $\hat{\theta}$ causes correlation between estimator residuals and model errors, destroying standard $1/\sqrt{N}$ asymptotic normality.
The DML Solution: Neyman Orthogonality & Cross-Fitting
DML rectifies these biases via two essential components:
1. Neyman Orthogonality (Residualization / Frisch-Waugh-Lovell)
Instead of estimating $\theta$ directly on raw variables, construct orthogonal residual scores. Define the score function $\psi(W; \theta, \eta)$ where $\eta = (g, m)$: $$\tilde{Y} = Y - \mathbb{E}[Y \mid X]$$ $$\tilde{D} = D - \mathbb{E}[D \mid X]$$
By regressing outcome residuals $\tilde{Y}$ on treatment residuals $\tilde{D}$, the score derivative with respect to nuisance functions evaluates to zero at the true parameter values: $$\left. \frac{\partial \mathbb{E}[\psi(W; \theta_0, \eta)]}{\partial \eta} \right|_{\eta = \eta_0} = 0$$
Mathematical Result: The error in $\hat{\theta}$ depends on the product of the errors of the two nuisance models: $$|\hat{\theta} - \theta_0| \approx O_P\left( |\hat{g} - g_0|_2 \times |\hat{m} - m_0|_2 \right)$$ Even if ML estimators $\hat{g}$ and $\hat{m}$ converge at slower non-parametric rates (e.g., $N^{-1/4}$), their product converges at $N^{-1/2}$. This restores $\sqrt{N}$-consistency and parametric normality.
2. K-Fold Cross-Fitting
To eliminate overfitting bias without losing statistical efficiency:
Full Data Sample (N)
|-------------------|-------------------|-------------------|
Fold 1 Fold 2 Fold 3
[Evaluation] [Train] [Train]
|
Predict Ỹ, D̃ using ML trained on Folds 2 & 3
- Partition dataset into $K$ equal folds.
- For fold $k$, train ML predictors $\hat{\ell}{-k}(X) \approx \mathbb{E}[Y \mid X]$ and $\hat{m}{-k}(X) \approx \mathbb{E}[D \mid X]$ on all out-of-fold data ($K-1$ folds).
- Generate out-of-sample residuals for fold $k$: $$\hat{V}i = D_i - \hat{m}{-k}(X_i), \quad \hat{U}i = Y_i - \hat{\ell}{-k}(X_i)$$
- Pool residuals across all $K$ folds and compute the final orthogonal OLS estimator: $$\hat{\theta}{\text{DML}} = \frac{\sum{i=1}^N \hat{V}_i \hat{U}i}{\sum{i=1}^N \hat{V}_i^2}$$
This delivers valid standard errors and valid asymptotic $95%$ confidence intervals: $\hat{\theta} \pm 1.96 \cdot \text{SE}(\hat{\theta}_{\text{DML}})$.
Comparative Summary Matrix
| Method | Key Identification Assumption | Main Confounding Addressed | Ideal Use Case |
|---|---|---|---|
| PSM | Selection on Observables | Observed pre-treatment covariates | Cross-sectional user targeting with rich feature sets |
| DiD | Parallel Trends | Unobserved time-invariant confounders | Panel data with pre/post rollout across treated/untreated cohorts |
| SCM | Convex Combination Pre-fit | Unobserved time-varying aggregate factors | Small $N_1$ (e.g., 1 region/city) with long pre-treatment timeline |
| DML | High-Dimensional Unconfoundedness | High-dimensional non-linear observed covariates | Complex feature spaces (text, telemetry, large logs) requiring ML |