Skip to content

Commit

Permalink
summer 2024 update
Browse files Browse the repository at this point in the history
  • Loading branch information
asjadnaqvi committed May 17, 2024
1 parent 2e2ea15 commit bd737fe
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 41 deletions.
Binary file added assets/images/DiD summer 2024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/DiD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/DiD_winter2023.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 33 additions & 25 deletions docs/01_stata.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/code/06_02_bacon.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ image: "../../../assets/images/DiD.png"


*This section has been updated and considerably improved thanks to [Daniel Sebastian Tello Trillo](https://sebastiantellotrillo.com/).*

*Last updated: 16 May 2024*

---
Expand Down
4 changes: 3 additions & 1 deletion docs/code/06_20_combined.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ image: "../../../assets/images/DiD.png"
{:toc}


*Last updated: 29 Nov 2022*
*(Last updated: 29 Nov 2022)*

---

Expand All @@ -27,6 +27,8 @@ image: "../../../assets/images/DiD.png"
This example follows the [five estimators](https://github.com/borusyak/did_imputation/blob/main/five_estimators_example.png) code that utilizes the `event_plot` command. In this example, we will use the same code structure we have been using in the individual sections above. So let's get started.


Please note that the estimators are not truely substitutable except in certain circumstances. Please read the assumptions of each estimator carefully before plotting them in one graph. A good starting point to understanding the differences between estimators is [Roth 2024](https://arxiv.org/abs/2401.12309).


## Step 0: Get all the packages

Expand Down
6 changes: 5 additions & 1 deletion docs/reading/04_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ Josh Angrist (MIT) [<img width="12px" src="https://cdn.jsdelivr.net/npm/simple-i

## Papers

*Papers are sorted by year and last name. Papers marked with a <img width="20px" src="https://img.icons8.com/color/48/000000/sun--v1.png"/> are review papers and are a good starting point. Papers without journals are pre-prints.*
*Papers are sorted by year and last name. Papers marked with the <img width="20px" src="https://img.icons8.com/color/48/000000/sun--v1.png"/> symbol are review papers and can be considered as essential readings. Please note that this section is not updated frequently and paper links might be outdated.*


### 2024
Jonathan Roth (2024). [Interpreting Event-Studies from Recent Difference-in-Differences Methods](https://arxiv.org/abs/2401.12309). <img width="20px" src="https://img.icons8.com/color/48/000000/sun--v1.png"/>


### 2023
Expand Down
22 changes: 8 additions & 14 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,27 @@ permalink: /

# Welcome!

*Last updated: December 2023*
*Last updated: May 2024*

This repository tracks the recent developments and innovations in the **Difference-in-Difference (DiD)** literature. It serves two purposes. First, it is an organized collection of various bookmarks from Twitter, GitHub, YouTube etc. Second, it aims to present the different packages from an end-user's perspective. This part has to do with how to apply these methods in day-to-day applied research. On the theory side, several really useful resources are listed in the [Resources](https://asjadnaqvi.github.io/DiD/docs/resources) including workshops and notes by some of the key authors leading the development in this field. Please refer to this section if you want a deeper theoreical understanding.
This repository tracks the developments in **Difference-in-Difference (DiD)** software packages. Brief explanations of how to use these packages is also provided. The [Resources](https://asjadnaqvi.github.io/DiD/docs/resources) section includes information on relevant readings, books, videos, and workshops in this field. The website gets updated roughly every three to four months. Therefore, it might not contain the most recent information. Therefore, if you come across new updates, broken links, or new packages, then please send a message, start an [Issue](https://github.com/asjadnaqvi/DiD/issues), or simply do a pull request. The aim of this repository is to collectively build notes and a code base that we can all use.

The contents of this page will get intermitent updates as necessary. It might contain errors, or links might get broken, or packages get updated, or new papers are not listed. Therefore, please give feedback by opening a Pull Request (PR) or opening an [Issue](https://github.com/asjadnaqvi/DiD/issues). The aim of this repository is to collectively build notes and a code base that we can all use.

Some thoughts below from my own perspective (these are also subject to evolve over time):


## What happened? The DiD renaissance
The DiD renaissance was nothing short of a revolutionary movement in 2020. Several DiD papers and packages coming out back-to-back in 2020 and 2021. This combined with COVID-19 lockdowns where everyone working from home, and #EconTwitter at its peak levels of activity helped boost these methods. Even in 2023 and 2024, existing and new packages continue to be released and optimized.

The DiD renaissance was nothing short of a revolutionary movement. Several DiD papers and packages coming out simultaneously in 2020 and 2021 was a game changer for a relatively stable field of causal inference. Additionally, with COVID-19 lockdowns where everyone working from home, and #EconTwitter at its peak levels of activities on line helped boost these new methods. Even in 2023, several really solid packages have been released and various existing packages have been optimizated.

At the heart of this new DiD literature is the premise that the classic Two-way Fixed Effects (TWFE) model can give [wrong estimates](https://asjadnaqvi.github.io/DiD/docs/code/06_01_twfe/). This is very likely especially if treatments are heterogeneous (differential treatment timings, different treatment sizes, different treatment statuses over time) that can contaminate the treatment effects. This can result from "bad" treatment combinations biased the average treatment estimation to the point of even reversing the sign.

Innovations like the [Bacon decomposition](https://asjadnaqvi.github.io/DiD/docs/code/06_02_bacon/) help us unpack the relative weight of the various combinations of treated versus untreated cohorts. The new DiD methods "correct" for these TWFE biases by combining various estimation techniques, such as bootstrapping, inverse probability weights, matching, influence functions, and imputations, to handle parallel trends, negative weights, covariates, and controls. The packages are constantly being improved, and currently have multiple implementations across and within different languages.
At the heart of this new DiD literature is the premise that the classic Two-way Fixed Effects (TWFE) model can give [wrong estimates](https://asjadnaqvi.github.io/DiD/docs/code/06_01_twfe/). This is very likely especially if treatments are heterogeneous (differential treatment timings, different treatment sizes, different treatment statuses over time) that can contaminate the treatment effects. This can result from "bad" treatment combinations biased the average treatment estimation to the point of even reversing the sign. Innovations like the [Bacon decomposition](https://asjadnaqvi.github.io/DiD/docs/code/06_02_bacon/) help us unpack the relative weight of the various combinations of treated versus untreated cohorts. The new DiD methods "correct" for these TWFE biases by combining various estimation techniques, such as bootstrapping, inverse probability weights, matching, influence functions, and imputations, to handle parallel trends, negative weights, covariates, and controls.

While these methods are definite improvement over classic TWFE methods, what is not very clear, and requires a deeper dive, is which method and/or package works best for which problems. Hopefully, more will be written on comparing the utility of each estimation technique by those who know this stuff better. At the time of updating this, new papers and packages are still being released but at a considerably less frequency. We are now seeing more applications and replications that can help us understand the nuances across these various DiD innovations.
While these methods are definite improvement over classic TWFE methods, what requires a deeper dive, is a solid understanding of which methods and/or packages works best for specific problems. Hopefully, more will be written on comparing the utility of each estimation technique by those who know this stuff better. Currently in 2024, while packages are still rolling out, we are also observing more applications and discussions that can help us understand the nuances across various DiD innovations.

Several review papers have come out that summarize the state-of-the-field really well. They are a good starting point to familiarize oneself with the methods and are marked in the [literature](https://asjadnaqvi.github.io/DiD/docs/reading/04_resources) section.


## Misc info

The aim of this repository is to help readers navigate the packages, code, and syntax usage. Therefore, this repository is periodically updated. If you want to report errors, updates, and/or want to contribute, then please [open an issue](https://github.com/AsjadNaqvi/DiD/issues), or [start a discussion](https://github.com/asjadnaqvi/DiD/discussions), or e-mail me at [email protected].
If you want to report errors, updates, and/or want to contribute, then please [open an issue](https://github.com/AsjadNaqvi/DiD/issues) or e-mail me at [email protected].

I update the [Stata code](https://asjadnaqvi.github.io/DiD/docs/code) every few months or so. Similary, [@grantmcdermott](https://github.com/grantmcdermott) maintains the [R code](https://asjadnaqvi.github.io/DiD/docs/code_r). Please reach out if you can help contribute code for *Python* or *Julia*.
I maintain the [Stata code](https://asjadnaqvi.github.io/DiD/docs/code) part while [@grantmcdermott](https://github.com/grantmcdermott) has been super amazing in maintaining the [R code](https://asjadnaqvi.github.io/DiD/docs/code_r). Please reach out if you can help contribute code for *Python* or *Julia*.

If you use this repository and find it helpful, acknowledgements and/or citations will be highly appreciated.
If you use this repository and find it helpful, acknowledgements and/or citations will be highly appreciated.

0 comments on commit bd737fe

Please sign in to comment.