查看原文
其他

统计计量 | DID最新进展汇总:命令、书单、论文、文章资源汇总

数据Seminar 2022-12-31

来源:Stata packages | DiD (asjadnaqvi.github.io)

本文转载自公众号计量经济学服务中心

https://asjadnaqvi.github.io/DiD/docs/01_stata/

这个存储库跟踪DID文献的最新发展。它有两个目的。首先,它是一个有组织的转储我的书签从Twitter, GitHub, YouTube等。这里的目的是跟踪DiD进展。第二是从终端用户的角度理解不同的包。这一部分是关于如何在我们的研究工作中应用这些方法。在理论方面,已经存在几个真正有用的注释(请参阅参考资料部分)。

我会继续增加这个网站的内容。它可能包含错误或者语言不够精确。这可能反映了我自己对正在发生的事情的理解不足。所以请给予反馈!这个存储库的目的是共同构建我们都可以使用的注释和代码库。

以下是我个人的一些想法(这些想法也会随着时间的推移而改变):

发生了什么事?DID

一些DDID方面创新在2020年和2021年同时出现,导致了网上的集体混乱。这篇新did文献的核心是一个前提,即经典的双向固定效应(TWFE)模型对治疗效果给出了错误的估计。如果处理是异质性的(不同的处理时间,不同的处理规模,不同的处理状态随着时间的推移),这尤其正确,这可能会导致“负权重”,稀释真正的处理效果。通过比较晚期治疗组与早期治疗组、治疗组与未治疗组的组合,可以得出负权重。也有广泛的共识,即这些偏见仍然存在,即使治疗没有交错。

从抨击TWFE开始,不同的DiD包使用不同的方法创新来“纠正”TWFE的偏差。在这些包中有处理不同DiD方面的不同方法,如平行趋势、负权重和协变量。因此,在不同的包中使用了各种方法,包括自举、逆概率权重、匹配、影响函数和impuations。

这里也存在着我自己的困惑,即使用哪个包来解决哪个问题。根据网上的对话,似乎所有的研究问题都归结为我们真正想要估计的。这使得用于分析的包选择有点主观。希望专家们会写更多关于比较每个包的效用的文章。但在撰写本文时,预计未来几个月将出现更多的创新。

我们为什么要用DiD?

因为并不是所有的东西都能用随机对照试验来评估。尽管随机对照试验在方法上非常干净,但它们有很高的时间和金钱成本。此外,它们需要一定程度的社会和政治资本来执行,尤其是在发展中国家。相比之下,像iv和rd等准实验方法的应用则很难找到。这使得did在适用性方面成为一种非常强大的方法。如果可以获得详细的主要或次要微观数据,也相对容易找到具有不同时间的干预措施(基本上是所有的政策实施)。因此,从数据到结果的转换相当快(与rcts相比),而且交错处理图在视觉上非常容易解释。此外,我的预感是,TWFEs发现的方法论问题,导致了新的DiD论文,也将在未来几年溢出到IV和RDD论文中。因此,现在这些DiD文献将为跟踪即将到来的方法创新提供坚实的基础。

信息

这是一个工作文档。如果您想报告错误或贡献,只需打开一个问题,或开始讨论,或发送电子邮件到asjadnaqvi@gmail.com。由于路径和链接也可能更改,请报告它们,以保持这个库尽可能最新。我可能会在帖子下面增加一个讨论区,以便直接评论。

我会用一些Stata代码慢慢建立这个网站。这是为了帮助我(和您)浏览文献并找出不同包的代码结构。

Stata中关于DID的包

包是按名字的字母顺序排序的。有些包路径被跨行分隔,但添加了空格以保持表格式的完整性。只需确保在Stata中复制它们时,它们在一行中并删除空格。要从GitHub安装包,获取GitHub包:net install github, from("https://haghish.github.io/github/")。Stata包的文档通常在内部帮助文件上完成。有些包确实有专门的网站、pdf或GitHub存储库,它们在网站栏中被识别出来。否则,检查具有专用页面的等价R包。

NameInstallationWebsitePackage byReference paper
bacondecompssc install bacondecomp, replaceor older version: net install ddtiming, from (https://tgoldring.com/code/)
Andrew Goodman-Bacon Thomas Goldring Austin NicholsAndrew Goodman-Bacon  (2021). Difference-in-differences with variation in treatment timing. Journal of Econometrics
csdidssc install csdid, replaceLinkFernando Rios-Avila Pedro H.C. Sant’AnnaBrantly Callaway, Pedro H.C. Sant’Anna  (2020). Difference-in-Differences with multiple time periods, Journal of Econometrics.
did2sssc install did2s, replaceLinkKyle ButtsJohn Gardner (2021). Two-stage differences in differences.
did_multiplegtssc install did_multiplegt, replace
Clément de Chaisemartin Xavier D’HaultfoeuilleClé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_imputationssc install did_imputation, replaceLinkKirill Borusyak Xavier Jaravel Jann SpiessKirill Borusyak , Xavier Jaravel , Jann Spiess  (2021). Revisiting Event Study Designs: Robust and Efficient Estimation.
drdidssc install drdid, replaceLinkFernando Rios-Avila Pedro H.C. Sant’Anna Asjad NaqviPedro H.C. Sant’Anna , Jun Zhao (2020). Doubly robust difference-in-differences estimators, Journal of Econometrics.
eventddssc install eventdd, replaceLinkDamian Clarke Kathya TapiaDamian Clarke, Kathya Tapia Schythe (2020). Implementing the Panel Event Study.
eventstudyinteractssc install eventstudyinteract, replaceLinkLiyang SunLiyang Sun, Sarah Abraham (2020). Estimating dynamic treatment effects in event studies with heterogeneous treatment effects. Journal of Econometrics.
flexpaneldidssc install flexpaneldid, replaceLinkEva Dettmann Alexander Giebler Antje WeyhEva 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
stackedevgithub install joshbleiberg/stackedevLinkJoshua BleibergDoruk Cengiz , Arindrajit Dube , Attila Lindner, Ben Zipperer  (2019). The effect of minimum wages on low-wage jobs. The Quarterly Journal of Economics.
staggered_statagithub install jonathandroth/staggered_stataLinkJonathan RothJonathan Roth , Pedro H.C. Sant’Anna  (2021). Efficient Estimation for Staggered Rollout Designs
xteventssc install xtevent, replaceLinkSimon Freyaldenhoven Christian Hansen Jorge Perez Perez Jesse M. ShapiroSimon Freyaldenhoven, Christian Hansen, Jesse M. Shapiro (2019). Pre-event Trends in the Panel Event-Study Design. American Economic Review.

如何使用Stata软件包?

对于各个包,请查看它们的帮助文件以获取文档和示例。我已经开始将一些Stata代码放在注释和代码部分。但这需要一段时间才能完成。

对于在Stata中使用和绘制多个DiD包,强烈推荐Kirill Borusyak的event_plot命令(ssc install event_plot, replace)。它估计并组合来自五个不同估计的结果。在GitHub上的five_estimators_example.do文档中给出了如何使用不同包绘制事件研究图的示例

event_plot的用法示例已经被扩展了两次:

David Burgherr在Dropbox上有一份文件。

Pietro Santoleri在GitHub上有一份文件,列出了七个不同的估算值。

Scott Cunningham将样本dofile作为CodeChella DiD事件的一部分。

大家都在读:DID最新书单、论文、文章资源推荐

Reading material

TABLE OF CONTENTS

  1. Books
  2. Blogs and notes
  3. Interactive dashboards
  4. Papers

Books

The books below are the ones that discuss the new DiD literature. There are of course many other great econometric books!

Martin Huber (2021). Causal analysis: Impact evaluation and causal machine learning with applications in R.



Nick Huntington-Klein (2021). The Effect.


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



Blogs and notes

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

An Introduction to DiD with Multiple Time Periods by Brantly Callaway and Pedro H.C. Sant’Anna.

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.

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


Interactive dashboards

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

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

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


Papers

Papers are in alphabetical order by last name. Papers without journals are pre-prints.

Dmitry Arkhangelsky, Susan Athey, David A. Hirshberg, Guido W. Imbens, Stefan Wager (2021). Synthetic Difference in Differences. American Economic Review.

Dmitry Arkhangelsky , Guido Imbens, Lihua Lei , Xiaoman Luo (2021). Double-Robust Two-Way-Fixed-Effects Regression For Panel Data.

Susan Athey, Guido Imbens (2006). Identification and inference in nonlinear difference-indifferences models. Econometrica.

Andrew Baker, David F. Larcker, Charles C. Y. Wang (2021). How Much Should We Trust Staggered Difference-In-Differences Estimates?

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 (2021). 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 (2018). Fuzzy differences-in-differences. The Review of Economic Studies.

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.

Clément de Chaisemartin, Xavier D’Haultfoeuille (2021). Two-Way Fixed Effects and Differences-in-Differences with Heterogeneous Treatment Effects: A Survey.

Xavier D’Haultfoeuille, Stefan Hoderlein, Yuya Sasaki (2013). Nonlinear difference-indifferences in repeated cross sections with continuous treatments.

Xavier D’Haultfoeuille, Stefan Hoderlein, Yuya Sasaki (2021). Nonparametric Difference-in-Differences in Repeated Cross-Sections with Continuous Treatments.

Bruno Ferman , Cristine Pinto (2021). Synthetic Controls with Imperfect Pre-Treatment Fit. Quantitative Economics.

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

Hans Fricke (2017). Identification based on difference-in-differences approaches with multiple treatments. Oxford Bulletin of Economics and Statistics.

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

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

Pamela Jakiela (2021). Simple Diagnostics for Two-Way Fixed Effects

Michelle Marcus, Pedro H. C. Sant’Anna (2021). The Role of Parallel Trends in Event Study Settings: An Application to Environmental Economics. Journal of the Association of Environmental and Resource Economists.

Jonathan Roth  (2021). Pre-test with Caution: Event-study Estimates After Testing for Parallel Trends.

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.




星标⭐我们不迷路!
想要文章及时到,文末“在看”少不了!

点击搜索你感兴趣的内容吧



往期推荐


数据治理 | 带你学Python之 环境搭建与基础数据类型介绍篇

统计计量 | 梁捷:因果识别——挑战经典理论的实证研究工具

数据可视化 | 如何利用色彩来佐证观点

统计计量 | 社会经济政策的计量经济学评估——理论与应用

统计计量 | 《计量经济学》中的前沿方法——随机干预试验方法简介

机器学习 | 这 725 个机器学习术语表,太全了!

数据资源 | 数据在哪儿?常用数据库链接






数据Seminar




这里是大数据、分析技术与学术研究的三叉路口


推荐 | 青酱


    欢迎扫描👇二维码添加关注    

点击下方“阅读全文”了解更多

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存