Libraries
Our Packages
Each family groups the same estimator across languages — pick Stata, R, Python or Julia 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. These designs nest staggered adoption designs, so the package can be used with a staggered adoption design. But staggered first switch designs also encompass more general designs, where the treatment may be non binary and/or non-absorbing (groups may experience several treatment switches). 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).
Tells you which difference-in-differences design your panel is, and which estimator to use. You pass four variables (outcome, group, time, treatment), and the command classifies the panel as a classical DID design (CLA), staggered adoption design (SAD), heterogeneous adoption design (HAD), staggered first switch design (SFSD), or OTHER. It then suggests a suitable estimator and points to the relevant chapter of de Chaisemartin and D'Haultfoeuille (2026). It classifies; it does not estimate.
ReplicationPackages contains full replication code for published papers. ApplicationData provides the datasets used in empirical applications of the estimators.