Code

Main Packages

These are the main packages that I have developed and actively maintain.

Difference-in-differences with multiple time periods and variation in treatment timing. Computes group-time average treatment effects and aggregates them into event studies and other summary parameters, with pre-tests and plots. Based on Callaway and Sant'Anna (2021).
Treatment effects in interactive fixed effects models with a small number of time periods. Code for Callaway and Karami (2023) and Callaway and Tsyawo (staggered adoption with non-parallel trends).
Generic tools for panel data causal inference. The backbone for many of my other packages, and useful for extending panel data methods to new settings.
Quantile treatment effects (QTE and QTET) under difference-in-differences, changes-in-changes, and selection-on-observables assumptions, including the estimators from Callaway and Li (2019) and Callaway, Li, and Oka (2018).
Difference-in-differences with a continuous treatment. Based on Callaway, Goodman-Bacon, and Sant'Anna (2026).
Computes the implicit regression weights in TWFE regressions with multiple periods, including specifications with covariates.
Difference-in-differences when one of the covariates is itself affected by the treatment (a “bad control”).
Functions I use across my research and packages, including panel data helpers, distribution and quantile functions, formula utilities, and summary statistics.

Utility Packages

Smaller packages that serve a specific purpose.

Reveal math line-by-line in Quarto or Xaringan presentations.
Implements Kotlarski's result (as in Li and Vuong, 1998) to estimate the distribution of a latent variable from repeated measurements of it.
Code for my courses, mainly regression adjustment estimators of treatment effects.

Additional Packages

These are packages developed for specific projects. They are functional, but not as general purpose as the packages above, and I am not actively maintaining them.

Policy evaluation during a pandemic, based on Callaway and Li (2023). Its functionality has been merged into ptetools, but the original examples remain here.
Bounds on the distribution and quantiles of the treatment effect, and the ATT conditional on the previous outcome, from Callaway (2021).
Counterfactual distributions with a continuous treatment, from Callaway and Huang (2020).
Distribution regression.
Quantile regression and other nonlinear models with measurement error in both the outcome and the treatment, from Callaway, Li, Murtazashvili, and Tsyawo (2026).