An ecosystem of causal inference tools for panel data — available in Stata, R, and Python — built on the research of de Chaisemartin & D'Haultfoeuille.
Libraries
Each family groups the same estimator across languages — pick Stata, R, or Python depending on your workflow. All share the same methodology and paper.
Flagship package. Heterogeneity-robust estimators for staggered first switch designs, where groups experience their first treatment change at different points in time. Those are very general designs, where the treatment may be non binary and/or non-absorbing (groups may experience several treatment switches). Of course, the package can also be used with a binary and staggered design. The estimators computed by the package allow for effects of lagged treatments on the outcome. Based on de Chaisemartin and D'Haultfoeuille (2020) and de Chaisemartin and D'Haultfoeuille (2025).
Like _dyn, _stat computes heterogeneity-robust DID estimators in general designs, where the treatment may be non binary and/or non-absorbing. Unlike _dyn, _stat assumes that lagged treatments do not affect the current outcome beyond a pre-determined lag. On the one hand, allowing for effects of lagged treatments up to any lag is appealing, to avoid misspecification. On the other hand, allowing for this generality also has some downsides: it may yield harder to interpret estimators, which rely on a parallel-trends assumption over a longer horizon. Thus, in settings where past treatments are unlikely to affect the outcome for very long, _stat is an interesting alternative to _dyn. Based on de Chaisemartin and D'Haultfoeuille (2020) and de Chaisemartin et al (2022).
Computes heterogeneity-robust DID estimators, in heterogeneous adoption designs where all groups start receiving heterogeneous treatment doses at the same date and no group remains fully untreated. In such designs, all groups experience their first treatment change at the same date (there are no stayers), so _stat and _dyn cannot be used. Based on de Chaisemartin et al (2025).
Computes the implicit weights attached to two-way fixed effects regressions, as well as summary measures of these regressions' robustness to heterogeneous treatment effects. Based on de Chaisemartin and D'Haultfoeuille (2020)
Non-parametric tests of the linearity of a conditional expectation, based on Yatchew (1997) and Stute (1997). Can be useful to test the homogeneous and linear effect assumption underlying two-way fixed effects regressions.
Estimators for treatment-effect heterogeneity across sites in multi-site randomized experiments with few units per site. Based on de Chaisemartin & Deeb (2023).
Estimates average effects of current and lagged treatments, under a parallel-trends assumption and a distributed-lag model allowing for heterogeneous effects across units. Based on de Chaisemartin and D'Haultfoeuille (2025).
ReplicationPackages contains full replication code for published papers. ApplicationData provides the datasets used in empirical applications of the estimators.
All packages implement heterogeneity-robust estimators valid under parallel trends — even with staggered adoption and treatment effect heterogeneity. They provide credible alternatives to TWFE regressions, whose implicit weighting can be negative and cause sign reversals.
ERC Really Credible Team
Led by Clément de Chaisemartin at Sciences Po, maintained by predoctoral research fellows funded by the ERC Really Credible grant.
Principal Investigator
Current Predocs
Alumni