/Diff-in-Diff-Notes

Keeping track of what is going on with the latest DiD innovations.

Last updated: 17 July 2021.

Notes

This repository tracks the recent developments in the Difference-in-Difference (DiD) literature. Currently, it is just a dump of my bookmarks from different websites including Twitter, GitHub, YouTube etc. This will be sorted out over time as the literature converges to some consensus. But this might still take a while.

This is a working document, if you want to contribute, just message, or open an issue on GitHub. Let's make this the most epic DiD repository ever!

TODO:

  • Dump the info.
  • Add key lit.
  • Port to a proper website.

Why do DiD?

TO BE ADDED

Stata packages

Name Installation Package by Reference paper
bacondecomp ssc install bacondecomp, replace

Andrew Goodman-Bacon

Thomas Goldring

Austin Nichols
Andrew Goodman-Bacon (2021). Difference-in-differences with variation in treatment timing. Journal of Econometrics
eventstudyinteract See end of table Liyang Sun Liyang Sun, Sarah Abraham (2020). Estimating dynamic treatment effects in event studies with heterogeneous treatment effects. Journal of Econometrics.
did_multiplegt ssc install did_multiplegt, replace Clément de Chaisemartin

Xavier D'Haultfoeuille
Clément de Chaisemartin, Xavier D'Haultfoeuille (2020). Two-Way Fixed Effects Estimators with Heterogeneous Treatment Effects. American Economic Review.

Clément de Chaisemartin, Xavier D'Haultfoeuille (2021). Two-way fixed effects regressions with several treatments.

Clément de Chaisemartin, Xavier D'Haultfoeuille (2021). Difference-in-Differences Estimators of Inter-temporal Treatment Effects.
did_imputation ssc install did_imputation, replace Kirill Borusyak

Xavier Jaravel

Jann Spiess
Kirill Borusyak, Xavier Jaravel, Jann Spiess (2021). Revisiting Event Study Designs: Robust and Efficient Estimation
drdid See end of table Fernando Rios-Avila

Asjad Naqvi

Pedro H.C. Sant'Anna
Pedro H.C. Sant'Anna, Jun Zhao (2020). Doubly robust difference-in-differences estimators, Journal of Econometrics.
csdid See end of table Fernando Rios-Avila Brantly Callaway, Pedro H.C. Sant'Anna (2020). Difference-in-Differences with multiple time periods, Journal of Econometrics.
flexpaneldid ssc install flexpaneldid, replace Eva Dettmann

Alexander Giebler

Antje Weyh
Eva Dettmann, Alexander Giebler, Antje Weyh (2020). Flexpaneldid: A Stata Toolbox for Causal Analysis with Varying Treatment Time and Duration. IWH Discussion Papers No. 3/2020
xtevent See end of table Simon Freyaldenhoven

Christian Hansen

Jorge Perez Perez

Jesse M. Shapiro
Simon Freyaldenhoven, Christian Hansen, Jesse M. Shapiro (2019). Pre-event Trends in the Panel Event-Study Design. American Economic Review.
did2s ssc install did2s, replace Kyle Butts John Gardner (2021). Two-stage differences in differences.
stackedev See end of table Joshua Bleiberg Doruk Cengiz , Arindrajit Dube , Attila Lindner, Ben Zipperer (2019). The effect of minimum wages on low-wage jobs. The Quarterly Journal of Economics.

Note: The length of the installation paths from GitHub repositories is messing up the table. Till this is sorted out, links are here:

  • bacondecomp alternative: net install ddtiming, from(https://tgoldring.com/code/)
  • drdid: net install drdid, from ("https://raw.githubusercontent.com/friosavila/csdid_drdid/v0.1/code") replace
  • csdid: net install csdid, from ("https://raw.githubusercontent.com/friosavila/csdid_drdid/main/code/") replace
  • eventstudyinteract : net install eventstudyinteract, from("https://raw.githubusercontent.com/lsun20/EventStudyInteract/main/") replace
  • xtevent : Manually download and install from https://simonfreyaldenhoven.github.io/software/
  • stackedev: net install stackedev, from("https://raw.githubusercontent.com/joshbleiberg/stackedev/main/")

How to use these packages?

TO BE ADDED.

R packages

Name Installation Package by Reference paper
bacondecomp install.packages("bacondecomp")

Evan Flack

Ed Jee
Andrew Goodman-Bacon (2021). Difference-in-differences with variation in treatment timing. Journal of Econometrics.
fixest with sunab() function install.packages("fixest") Laurent Bergé Liyang Sun, Sarah Abraham (2020). Estimating dynamic treatment effects in event studies with heterogeneous treatment effects. Journal of Econometrics.
TwoWayFEWeights install.packages("TwoWayFEWeights") Shuo Zhang Clément de Chaisemartin, Xavier D'Haultfoeuille (2021). Two-Way Fixed Effects Estimators with Heterogeneous Treatment Effects.
DIDmultiplegt [not as recent as Stata version] install.packages("DIDmultiplegt") Shuo Zhang Two-Way Fixed Effects Estimators with Heterogeneous Treatment Effects.
drdid devtools::install_github("pedrohcgs/DRDID") Pedro H.C. Sant'Anna

Jun Zhao
Pedro H.C. Sant'Anna, Jun Zhao (2020). Doubly robust difference-in-differences estimators, Journal of Econometrics.
did install.packages("did") Pedro H.C. Sant'Anna

Brantly Callaway
Brantly Callaway, Pedro H.C. Sant'Anna (2020). Difference-in-Differences with multiple time periods, Journal of Econometrics.
did2s devtools::install_github("kylebutts/did2s") Kyle Butts John Gardner (2021). Two-stage differences in differences.

Kirill Borusyak , Xavier Jaravel , Jann Spiess (2021). Revisiting Event Study Designs: Robust and Efficient Estimation

Liyang Sun, Sarah Abraham (2020). Estimating dynamic treatment effects in event studies with heterogeneous treatment effects. Journal of Econometrics.

Brantly Callaway, Pedro H.C. Sant'Anna (2020). Difference-in-Differences with multiple time periods, Journal of Econometrics.

Jonathan Roth , Pedro H.C. Sant'Anna (2021) Efficient Estimation for Staggered Rollout Designs.

Literature

Papers

SORTABLE TABLE TO BE ADDED. In alphabetical order by last name.

Kirill Borusyak , Xavier Jaravel , Jann Spiess (2021). Revisiting Event Study Designs: Robust and Efficient Estimation.

Brantly Callaway, Andrew Goodman-Bacon, Pedro H.C. Sant'Anna. Difference-in-Differences with a Continuous Treatment.

Brantly Callaway, Pedro H.C. Sant'Anna (2020). Difference-in-Differences with multiple time periods, Journal of Econometrics.

Clément de Chaisemartin, Xavier D'Haultfoeuille (2020). Two-Way Fixed Effects Estimators with Heterogeneous Treatment Effects. American Economic Review.

Clément de Chaisemartin, Xavier D'Haultfoeuille (2021). Two-way fixed effects regressions with several treatments.

Clément de Chaisemartin, Xavier D'Haultfoeuille (2021). Difference-in-Differences Estimators of Inter-temporal Treatment Effects.

Simon Freyaldenhoven, Christian Hansen, Jesse M. Shapiro (2019). Pre-event Trends in the Panel Event-Study Design. American Economic Review.

John Gardner (2021). Two-stage differences in differences.

Andrew Goodman-Bacon (2021). Difference-in-differences with variation in treatment timing. Journal of Econometrics.

Jonathan Roth , Pedro H.C. Sant'Anna (2021) Efficient Estimation for Staggered Rollout Designs.

Pedro H.C. Sant'Anna, Jun Zhao (2020). Doubly robust difference-in-differences estimators, Journal of Econometrics.

Liyang Sun, Sarah Abraham (2020). Estimating dynamic treatment effects in event studies with heterogeneous treatment effects. Journal of Econometrics.

Books

Scott Cunningham (2020). Causal Inference: The Mix Tape.

Nick Huntington-Klein (2021). The Effect.

DiD knowledge curation

Here are people who are actively involved in curating information on the latest DiD developments. This includes blogs, lecture series, tweets.

Events and Videos

Scott Cunningham : CodeChella the ultimate DiD event Workshop 1: Friday July 16th, 2021 and Workshop 2: Friday July 23, 2021 which will be live on Twitch. Will post links if recordings are up somewhere.

Chloe East organizes an online DiD reading group.

Taylor J. Wright organizes an online DiD reading group. The lecture recordings can also be viewed on YouTube.

Blogs

Scott Cunningham : Scott's Substack is the goto place for an easy-to-digest explanation of the latest metric-heavy DiD papers.

Andrew C. Baker has notes on Difference-in-Differences Methodology with supporting material on GitHub.

Notes

Paul Goldsmith-Pinkham has a brilliant set of lectures on empirical methods including DiD on GitHub. These are also supplemented by YouTube videos.

Jeffrey Wooldridge has made several notes on DiD which are shared on his Dropbox including Stata dofiles.

Fernando Rios-Avila has a great explainer for the Callaway and Sant'Anna (2020) CS-DID logic on his blog.

Christine Cai has a working document which lists recent papers using different methods including DiDs.

Interactive dashboards

These (related) interactive R-Shiny dashboards showcase how TWFE models give wrong estimates.

Kyle Butts : https://kyle-butts.shinyapps.io/did_twfe/

Hans Henrik Sievertsen : https://hhsievertsen.shinyapps.io/kylebutts_did_eventstudy/

Tweets

Twitter threads that summarize the DiD literature. In order to render these properly, you need to view them on the Jekyll website.


I spent this past week catching up with the DiD literature. Here is my list🧵:
1. Read (if you haven't) Andrew Goodman-Bacon's "Difference-in-Differences with Variation in Treatment Timing." The paper that started all for me (there are others before).Link: https://t.co/GBFjBnHDcj

— Jesús Villero (@jotavillero) May 16, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Navigating the DiD revolution from one applied researcher's perspective.

A LONG 🧵 on what I've learned & what I'm still trying to figure out. Advice/insights welcome!

My @michaelpollan 🥦🍅🥕🫑 inspired TL;DR take:

"Apply DiD in context, not every 2x2, mostly event studies" pic.twitter.com/CWmwyo1Btp

— Matthew A. Kraft (@MatthewAKraft) June 24, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

I've been catching up on staggered diff-in-diff/two-way fixed effects recently. Simulating helped me see how bad TWFE performs with dynamic treatment effects (see those pre-trends). I also tried implementing Sun & Abraham (2020)'s interaction-weighted estimator in Stata pic.twitter.com/FQBCQi0m7d

— Shan Huang (@ShanHuang_ec) June 16, 2020
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>