New Methods & Techniques

Two-Way Fixed Effects with Heterogeneous Treatment Effects: The de Chaisemartin-D'Haultfoeuille (2020) Critique and the DID_M Estimator

1 Introduction

Two-way fixed effects (TWFE) regression is ubiquitous in applied economics. Yet in staggered adoption settings where units receive treatment at different times-TWFE can be badly biased when treatment effects are heterogeneous. A growing body of work has diagnosed this problem. Among the most influential contributions is de Chaisemartin and D'Haultfœuille [2020], which characterises precisely when TWFE fails, shows that the TWFE estimator is a weighted sum of treatment effects with potentially negative weights, and proposes an alternative estimator DID_M that avoids the problem. This article explains the de Chaisemartin and D'Haultfœuille [2020] framework in detail, including the decomposition result, the identifying assumptions for DID_M, and its properties relative to TWFE.

2 The TWFE Setup and the Negative Weights Result

2.1 Setup

Consider a balanced panel with N units and T periods. Let $D_{it}\in\{0,1\}$ denote treatment status. The TWFE regression is:

$Y_{it}=\alpha_{i}+\gamma_{t}+\beta D_{it}+\epsilon_{it}$ (1)

The coefficient $\beta$ is the object of interest. Let $\Delta_{it}$ denote the treatment effect for unit i at time t, so that $Y_{it}=Y_{it}^{0}+\Delta_{it}D_{it}$ where $Y_{it}^{0}$ is the potential outcome under no treatment.

2.2 The Decomposition

de Chaisemartin and D'Haultfœuille [2020] show that:

$plim(\hat{\beta})=\sum_{(i,t):D_{it}=1}w_{it}\Delta_{it}$ (2)

where the weights $w_{it}$ satisfy $\sum_{(i,t):D_{it}=1}w_{it}=1$ but some weights can be negative. Specifically:

$w_{it}=\frac{\tilde{D}_{it}}{\mathbb{E}[\tilde{D}_{it}^{2}]}$

where $\tilde{D}_{it}$ is the residual from projecting $D_{it}$ on unit and time fixed effects. The residual $\tilde{D}_{it}$ can be negative for treatment cells where the group has a higher mean treatment than the overall mean conditional on time, causing negative weights. The practical implication is stark: even if every $\Delta_{it}>0$, the TWFE coefficient $\hat{\beta}$ can be negative or zero.

2.3 When Are Weights Negative?

Negative weights arise when an already-treated cell has $\tilde{D}_{it}<0$ This happens when the unit's mean treatment rate is high and the cell is used as a "comparison" in the fixed-effects projection. In staggered designs, units that have been treated for a long time have high mean treatment rates, so their $\tilde{D}_{it}$ is negative in early treatment periods and TWFE implicitly uses them as controls. de Chaisemartin and D'Haultfœuille [2020] provide a diagnostic: compute the share of treated observations with negative weights, and the minimum value of $\hat{\beta}$ that would be consistent with all $\Delta_{it}\ge0$ If the minimum is substantially negative, TWFE is uninformative.

3 The DID_M Estimator

3.1 Identification

The DID M estimator is designed to recover a meaningful weighted average of treatment effects without using already-treated units as controls. The identifying assumption is:

Parallel trends in switchers: For units that switch from untreated to treated between period $t-1$ and t ("switchers"), the counterfactual trend in potential outcomes $Y^{0}$ equals the trend observed for units that did not switch treatment status between $t-1$ and t.

Formally, let $S_{t}=\{i:D_{it}\ne D_{i,t-1}\}$ be the set of switchers at time t. The parallel trends assumption requires:

$\mathbb{E}[Y_{it}^{0}-Y_{i,t-1}^{0}|i\in S_{t}]=\mathbb{E}[Y_{it}^{0}-Y_{i,t-1}^{0}|i\notin S_{t},D_{it}=D_{i,t-1}=0]$ (3)

This is a local parallel trends assumption: it only requires trend comparability between switchers and units that remained untreated across periods $t-1$ and t. It does not require parallel trends between switchers and already-treated units the comparison that TWFE implicitly makes and that causes the negative-weights problem.

3.2 The Estimator

The DID M estimator is defined period by period. For each t, a "local" DiD is computed:

$\hat{DID}_{t}=\frac{1}{|S_{t}|}\sum_{i\in S_{t}}[(Y_{it}-Y_{i,t-1})-\overline{Y}_{t}^{NS}+\overline{Y}_{t-1}^{NS}]$ (4)

where $\overline{Y}_{t}^{NS}$ is the mean outcome of non-switching, never-treated units in period t. The global DID M estimator then averages these period-specific DiDs, weighted by the number of switchers in each period:

$\hat{DID}_{M}=\frac{\sum_{t}|S_{t}|\cdot\hat{DID_{t}}}{\sum_{t}|S_{t}|}$ (5)

Under the local parallel trends assumption, $\tilde{D}I\overline{D}_{M}$ converges to a weighted average of period-specific average treatment effects on switchers, with positive weights only.

3.3 Variance Estimation

de Chaisemartin and D'Haultfœuille [2020] derive an analytical variance estimator and show that $\hat{DID}_{M}$ is asymptotically normal as $N\rightarrow\infty$ with T fixed. Inference via standard errors clustered at the unit level is recommended for finite samples.

4 Extensions: Dynamic Effects and Switchers Back

The basic DID M estimator identifies the contemporaneous effect of switching. de Chaisemartin and D'Haultfœuille [2020] also propose:

  • Dynamic effects: By tracking switchers for $l$ periods after they switch, one can estimate $\Delta_{it+l}$ for $l=0,1,2,...,$ yielding an event-study-style plot of how treatment effects evolve over time.
  • Switchers back: If treatment is not absorbing units can move from treated to untreated the framework extends to switchers in both directions, estimating entry and exit effects separately.

5 Software

The estimator is implemented in the did multiplegt Stata command and the DIDmultiplegt R package, both authored by the paper's authors. The syntax mirrors standard DiD commands:

# R example
library (DIDmultiplegt)
result <- did_multiplegt(
df= mydata,
Y= "outcome",
G= "unit_id",
T= "time",
D= "treatment"
)

6 Comparison to Callaway-Sant'Anna

Both de Chaisemartin and D'Haultfœuille [2020] and Callaway and Sant'Anna [2021] address the same fundamental problem with TWFE. The approaches differ in:

  • Treatment variation: DID M handles any binary treatment path, including switching back and forth. Callaway-Sant'Anna assumes absorbing treatment (once treated, always treated).
  • Aggregation: Callaway-Sant'Anna aggregate cohort-time ATTs via explicit aggregation formulas; DID M aggregates period-specific local DiDs.
  • Covariates: Both methods can incorporate covariates for doubly-robust estimation, though the implementation differs.
  • Baseline periods: DID_M conditions on the period immediately before switching; Callaway-Sant'Anna can use all pre-treatment periods as baselines.

In practice, both estimators tend to give similar results when the treatment is absorbing and effects are stable [Roth et al., 2023].

7 Conclusion

The de Chaisemartin and D'Haultfœuille [2020] paper made two lasting contributions. First, it provided a clear and general statement of when TWFE fails: whenever some treated observations receive negative weights, which is possible whenever treatment effects are heterogeneous across time or groups. Second, it proposed DID_M as a clean alternative that avoids the contaminated comparisons underlying TWFE's problems. Combined with the diagnostic tools the paper provides, the result is a practical framework for assessing and fixing the most common pitfall in panel data econometrics.

References

  1. de Chaisemartin, C. and D'Haultfœuille, X. (2020). Two-way fixed effects estimators with heterogeneous treatment effects. American Economic Review, 110(9):2964-2996.
  2. Callaway, B. and Sant'Anna, P.H.C. (2021). Difference-in-differences with multiple time periods. Journal of Econometrics, 225(2):200-230.
  3. Goodman-Bacon, A. (2021). Difference-in-differences with variation in treatment timing. Journal of Econometrics, 225(2):254-277.
  4. Roth, J., Sant'Anna, P.H.C., Bilinski, A., and Poe, J. (2023). What's trending in difference-in-differences? A synthesis of the recent econometrics literature. Journal of Econometrics, 235(2):2218-2244.
  5. Sun, L. and Abraham, S. (2021). Estimating dynamic treatment effects in event studies with heterogeneous treatment effects. Journal of Econometrics, 225(2):175-199.

Continue Reading

Browse All Sections →
Home
This is some text inside of a div block.
This is some text inside of a div block.
This is some text inside of a div block.

Article Title