Difference-in-Differences Meets Tree-based Methods: Heterogeneous Treatment Effects Estimation with Unmeasured Confounding

Caizhi Tang, Huiyuan Wang, Xinyu Li, Qing Cui, Longfei Li, Jun ZhouICML 2023

Overview

This paper introduces DiDTree, a novel framework that combines Difference-in-Differences (DiD) with gradient-boosted trees to estimate heterogeneous treatment effects in panel data. By relaxing the strict "parallel trends" assumption and using a dual-objective splitting rule, the method effectively handles unmeasured confounding without requiring complex auxiliary models like propensity scores.

The Challenge of Unmeasured Confounding

Estimating the causal effect of an intervention—such as a new policy or a marketing campaign—is notoriously difficult when "unmeasured confounders" exist. These are hidden variables that influence both who receives the treatment and what the outcome is.

In longitudinal studies where the same units are tracked over time, researchers often use Difference-in-Differences (DiD). Standard DiD relies heavily on the Parallel Trends (PT) assumption: the idea that, without treatment, the "treated" and "control" groups would have evolved along parallel paths. In the real world, this assumption is almost always violated. Existing fixes often require "nuisance parameters" (like propensity scores) that are prone to misspecification, or they require "instrumental variables" that are difficult to find.

The authors tackle a specific challenge: How can we estimate Conditional Average Treatment Effects on the Treated (CATT)—meaning, how the effect varies across different types of individuals—when we have unmeasured confounding and the parallel trends assumption does not strictly hold?

The DiDTree Approach

The authors propose a tree-based approach called DiDTree (and its ensemble version, Gradient Boosting DiD-Tree). The core innovations include:

  1. Approximate Conditional Parallel Trends: Instead of requiring trends to be perfectly parallel, the authors assume that the "most common" difference in trends observed in the past (pre-treatment) is transferable to the post-treatment period. This allows for "partial identifiability" of the causal effect even when standard DiD assumptions fail.
  2. A Novel Splitting Rule: Standard decision trees split data to minimize prediction error. DiDTree uses a dual-objective splitting rule that minimizes both:
  3. Violation of Parallel Trends ($R_{//}$): How well the split captures the historical difference between groups.
  4. Data Fitting Error ($R_{data}$): How well the model fits the actual observed outcomes.
  5. Nuisance-Free Estimation: Unlike many modern causal learners, DiDTree does not explicitly estimate propensity scores or outcome regressions as auxiliary steps. This avoids the "error propagation" that occurs when intermediate models are slightly misspecified.

Core Innovations

  • The "Most Common Difference" as a Proxy: The key insight is realizing that perfect parallelism isn't strictly necessary. If we can find a functional form that represents the most consistent historical gap between groups, we can use that to "de-bias" the post-treatment results.
  • Trees as Implicit Matchers: Tree-based methods naturally excel at "stratification"—grouping similar units together. By incorporating the DiD logic directly into the tree's splitting rule, the model automatically finds sub-populations where the "approximate parallel trends" assumption is most likely to hold.
  • Robustness to Imbalance: DiDTree is significantly less sensitive to "imbalanced" data (where the treated group is much smaller or larger than the control group) compared to meta-learners or causal forests.

Experimental Results

The researchers evaluated their method using both synthetic panel data and a real-world dataset from a financial company's randomized controlled trial (RCT) involving credit line increases. To test robustness, bias was artificially introduced into the RCT data to simulate a non-random, observational setting.

Performance comparison of DiDTree against baselines across varying degrees of parallel trend violation ($\rho$).
  • Superior Accuracy: In synthetic scenarios with unmeasured confounding, DiDTree consistently achieved lower Mean Absolute Error (MAE) than state-of-the-art baselines like Causal Forests (GRF), Bayesian Causal Forests (BCF), and various Meta-Learners (S-Learner, X-Learner).
  • Handling Non-Parallelism: As the data moved further away from parallel trends (decreasing $\rho$), the performance of most baselines degraded significantly. In contrast, DiDTree remained relatively stable and consistently outperformed the alternatives.
  • Real-World Performance: On the biased credit card dataset, DiDTree significantly outperformed "Naive-DiD" and other causal models across different treatment levels (e.g., $2k, $3k, and $6k credit line increases), demonstrating its practical utility in financial and policy settings.

Limitations and Future Directions

While powerful, the authors note a few areas for future improvement:

  • Time Structure: The current model may not fully exploit complex temporal structures (like seasonality or specific lags) of time-varying covariates.
  • Balanced Panels: The study focuses on "balanced" panels, where every unit is observed at every time point. Extending this to "unbalanced" panels with missing observations is a logical next step.
  • Treatment Timing: The current framework assumes treatment happens at the final time point. Adapting this for staggered adoption (where different units are treated at different times) would significantly broaden its applicability.

Summary updated

BibTeX
@inproceedings{tang2023difference,
  author = {Caizhi Tang and Huiyuan Wang and Xinyu Li and Qing Cui and Longfei Li and JUN ZHOU},
  title = {{Difference-in-Differences Meets Tree-based Methods: Heterogeneous Treatment Effects Estimation with Unmeasured Confounding}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=FdCeFHTXrS},
}
Figure