DiD Resources
I have done a lot of work on difference-in-differences (DiD), and have tried to make as many resources as possible available online. This page collects links to those resources.
DiD Course
I have been teaching a one-day course on recent DiD methods for Mixtape Sessions. All of my teaching material is available on Github.
This includes slides for three lectures – feel free to use in these in your teaching (with proper attritubution):
Introduction (pdf latex): covers the canonical two-period DiD model and summarizes how recent papers have deviated from the canonical model
Staggered treatment (pdf tex): covers (some of the) recent innovations in DiD with staggered treatment timing
Violations of parallel trends (pdf tex): covers recent work on limitations of pre-trends testing and alternative approaches when parallel trends might be violated, with a focus on Roth (2022, AERI, “Pre-test with Caution…’’) and Rambachan and Roth (2023, RESTUD, “A More Credible Approach…”)
There are also two coding exercises that show how these methods can be used in practice:
Staggered timing coding exercise: Instructions R solutions Stata solutions
Violations of PT coding exercise: Instructions R solutions Stata solutions
If you like this material, you can see when I’m next teaching the course and sign up here.
DiD Review Paper
For a more detailed review of the recent literature, see my Journal of Econometrics paper, “What’s trending in difference-in-differences? A synthesis of the recent econometrics literature”. You may be especially interested in Table 1, which provides a checklist for practitioners.
Also be sure to check out Table 2, which provides a list of packages for DiD methods, based on Asjad Naqvi’s excellent website.
Packages
I am the co-creator of several packages for DiD methods. Click on the links below and check out the package READMEs for instructions.
HonestDiD (R Stata): robust inference and sensitivity analysis tools for DiD when parallel trends may be violated, based on Rambachan and Roth (2023)
staggered (R Stata): Implements the efficient estimator for settings with (quasi-)random treatment timing proposed in Roth and Sant’Anna (2023, JPE:Micro). Also implements Callaway & Sant’Anna and Sun & Abraham estimators (without covariates).
pretrends (R Stata Shiny): implements power calculations for pre-trends tests following Roth (2022, AERI)