科学中的许多部分都涉及因果推断,即估计“处理”对“结果”的影响。为此,一个黄金标准方法是进行随机实验,其中单位接触处理是随机决定的。然后,人们可以比较经过处理和未经处理单位的平均结果,以无偏地估计所谓的平均处理效应(ATE),即在感兴趣的人群中处理的平均效应。
在社会科学中,许多重要的因果推断问题很难或根本无法使用随机实验来研究。例如,我们不能随机增加从中国到某些国家的进口而不增加到其他国家,以测量中国进口对它们就业的影响。同样,将公司随机分配到高和低最低工资组以研究最低工资对就业的影响也从未进行过。即使进行了这样的实验,其对最低工资效应的估计也会有一个重要的缺点。研究伦理要求在实验中包括受试者时需要明智的同意,因此实验样本通常不代表感兴趣的人群。然后,假设的最低工资实验将无偏地估计参加实验的公司中最低工资的效应,但这种效应可能与所有公司中最低工资的效应不同。即使随机实验是可行的,有时它们也缺乏“外部有效性”:其发现可能无法从实验样本推广到研究者想要了解ATE的人群。
为了回答随机实验不可行或缺乏外部有效性的困难--因果推断问题,研究者通常依赖自然实验。社会科学中使用的自然实验通常是政策变化。例如,美国一个州提高了最低工资,而邻近州没有,从而为研究者提供了一个面对高最低工资的处理组,和一个面对较低最低工资的对照组。自然实验通常影响整个州、地区或省份,因此利用自然实验的研究结果通常适用于大型和未选择的人群,与随机实验的结果不同。
随机和自然实验之间的一个关键区别是,在自然实验中,分配给处理的不是由研究者随机决定的,而是由政策制定者决定的。这一事实有两个重要后果。首先,由于政策制定者不会随机选择在哪里实施政策变化,经过处理和对照位置可能不可比,简单地比较它们的平均结果可能不会得到ATE的无偏估计器。在最低工资的例子中,例如,经过处理和对照州可能在经过处理的州提高其最低工资之前就有不同就业水平。然后,在该增加之后比较它们的就业水平将捕捉到最低工资的效应和两个州之间预先存在的差异。其次,立法变化通常充满了曲折。在最低工资的例子中,提高最低工资的经过处理的州可能随后会降低它,或再次增加它。而最初没有改变其最低工资的对照州可能随后决定改变它。此外,一些州可能实施大幅度的最低工资增长,而其他州实施较小的增长。这创造了大量的处理变化,使分析变得复杂。
这本书向应用研究者介绍了现代DID方法,可以使用这些方法来获得对随机实验不可行的困难--因果推断问题的可信答案。在第2章中介绍书籍的设置和符号后,第3章回顾了具有二元处理和无处理时间变化的经典差异中的差异(DID)设计。
安慰剂测试的可能性是平行趋势假设的一个重要优势:在观察性研究中,安慰剂测试是建立识别假设可信度的关键步骤(Imbens等人,2001年;Imbens和Xu,2024年)。
尽管如此,我们在第3章结束时强调了最近的一项文献,该文献表明,平行趋势的测试有时是不够有力的。这些测试可能无法检测到经过处理和对照地点之间的差异趋势,这些趋势可能足够大,足以解释政策估计效应的显著份额。这一认识激发了对依赖于平行趋势放宽的估计的日益关注,我们在第4章中进行了回顾。在那里,我们仍然考虑经典设计,并考虑匹配和DID估计器的组合,这些估计器依赖于条件平行趋势假设(第4.1节),以及依赖于近似平行趋势假设的估计器(第4.2节)。
de Chaisemartin和D'Haultfoeuille(2024年)对2015年至2019年美国经济评论发表的100篇谷歌学术引用最多的论文进行了调查。在这100篇论文中,有26篇至少估计了一个TWFE回归来估计处理对结果的影响。然而,这26篇论文中只有两篇具有二元处理和无处理时间变化的经典设计。TWFE回归也常用于政治学、社会学和环境科学。
最近的一项文献表明,在更复杂的设计中,TWFE估计不再等同于简单的DID估计,也不再只依赖于平行趋势假设。TWFE估计器不估计经过处理的样本的平均处理效应。也许更令人担忧的是,TWFE估计可能对一些单元的处理效应进行负向加权。然后,即使每个地点和时期都有正的处理效应,TWFE系数也可能是负的。如果假设处理效应在地点和时间上是恒定的,TWFE估计仍然是无偏的,但在TWFE回归已使用的应用中,这种假设在大多数情况下不太可能成立。例如,最低工资对就业的影响可能在受过高等教育的工人的州与受过较少教育的工人的州之间有所不同。
在第5至第9章中,这本书集中讨论了比经典设计更复杂的设计。在每一章中,我们首先解释为什么TWFE估计可能对异质性处理效应不稳健。然后我们回顾了替代的异质性稳健DID估计器,即依赖于平行趋势假设的估计器,像TWFE估计一样,但如果处理效应在地点或时间上是异质的,它们仍然对定义良好的因果效应无偏,与TWFE估计不同。
2、Martin Huber (2021). Causal analysis: Impact evaluation and causal machine learning with applications in R.
3、Nick Huntington-Klein (2021). The Effect.
4、Scott Cunningham(2020). Causal Inference: The Mix Tape.
Matteo Courthoud. Medium blog on Causal inference
Kyle Butts. Personal blog with DiD entries.
Sylvain Chabé-Ferret : Statistical Tools for Causal Inference Chapter 4: Difference-in-Differences.
Matheus Facure. Causal Inference for The Brave and True
Davis Schönholzer has a series of lectures on DiD here.
The World Bank’s Development Impact blog has several entries on DiD:
- 24 Jan 2022: Explaining why we should believe your DiD assumptions
- 10 Jan 2022: A new synthesis and key lessons from the recent difference-in-differences literature
- 04 Nov 2021: DiD you see Beta? Beta who? Part 2
- 02 Nov 2021: DiD you see Beta? Beta who? Part 1
- 30 Sep 2019: What Are We Estimating When We Estimate Difference-in-Differences? Scott Cunningham : Scott’s Substack has entries on DiD papers.
An Introduction to DiD with Multiple Time Periods by Brantly Callaway and Pedro H.C. Sant’Anna .
Jeffrey Wooldridge has 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.
Events and workshops
Scott Cunningham is now regularly organizing DiD workshops. You can find more information on Mixtape Sessions.
Pedro H.C. Sant’Anna . sometimes offers DiD workshops. Follow his Twitter for announcements or visit Causal Solutions.
Jeffrey Wooldridge sometimes offers DiD workshops. Follow his Twitter for announcements.
Videos and online lectures
Yiqing Xu has a series of lecture on his YouTube channel.
Pedro H.C. Sant’Anna. Triple Differences Research Designs at Causal Solutions.
Brady Neal. A brief introduction to causal inference.
Nick Huntington-Klein has series of short videos on DiD literature on YouTube as part of The Effect book series.
Ben Elsner has a YouTube lecture series on causal inference including the new DiD literature.
Jorge Perez Perez has a YouTube lecture series with his co-authors (see xtevent in the Stata section for paper and package) on event studies with the following sequence of videos:
- Jesse Shapiro, Christian Hansen: Introduction to Linear Panel Event-Study Designs
- Jorge Perez Perez: Event-Study Plots: Basics
- Simon Freyaldenhoven: Event-Study Plots: Suggestions
- Simon Freyaldenhoven: Approaches without Proxies or Instruments
- Jorge Perez Perez: Approaches with Proxies or Instrumental Variables
- Jorge Perez Perez: Performance of Different Estimators
- Simon Freyaldenhoven: Heterogeneous Policy Effects
Josh Angrist (MIT) has an animated video on DiD here.
Paul Goldsmith-Pinkham has a brilliant set of slides on empirical methods including DiD on GitHub. These are also supplemented by his YouTube lecture series.
Scott Cunningham : CodeChella, one of the first DiD workshops, in July 2021. The recordings from the workshop are available at YouTube.
Taylor J. Wright organized an online DiD reading group in the summer of 2021. The lectures can be viewed on YouTube. Here is a playlist in the order they appear:
- Andrew Goodman-Bacon: Difference-in-Differences with Variation in Treatment Timing. 27 April 2021.
- Jonathan Roth: Testing and Sensitivity Analysis for Parallel Trends. 10 May 2021.
- Pedro H.C. Sant’Anna: Difference-in-Differences with Multiple Time Periods. 15 May 2021.
- Akash Issar: Two-way fixed effects estimators with heterogeneous treatment effects. 11 June 2021.
- Kirill Borusyak: Revisiting Event Study Designs: Robust and Efficient Estimation. 13 June 2021.
- Kyle Butts: Difference-in-Differences with Spatial Spillovers. 29 June 2021.
- John Gardner: Two-stage differences in differences. 11 July 2021.
- Brantly Callaway: Difference-in-Differences with a Continuous Treatment. 6 August 2021.
- Clément de Chaisemartin: Two-way Fixed Effects Regressions with Several Treatments. 4 September 2021.
Chloe East in 2021 organized an online DiD reading group.
Papers
Papers are sorted by year and last name. Papers marked with a are review papers and are a good starting point. Papers without journals are pre-prints.
2024
Jonathan Roth (2024). Interpreting Event-Studies from Recent Difference-in-Differences Methods.
2024
Clément de Chaisemartin . The Review of Economics and Statistics.
2023
Alisa Tazhitdinova, Gonzalo Vazquez-Bare (2023). Difference-in-Differences with Unequal Baseline Treatment Status.
Andrew Gelman, Jessica Hullman, Lauren Kennedy (2023). Causal quartets: Different ways to attain the same average treatment effect
Ashesh Rambachan, Jonathan Roth (2023). A More Credible Approach to Parallel Trends. The Review of Economic Studies.
2022
Pedro Picchetti, Cristine Pinto (2022). Marginal Treatment Effects in Difference-in-Differences
Yuya Sasaki, Takuya Ura (2022). Estimation and Inference for Moments of Ratios with Robustness against Large Trimming Bias
Dalia Ghanem, Pedro H. C. Sant’Anna, Kaspar Wüthrich (2022). Selection and parallel trends.
P Rosenbaum, D Rubin (2022). Propensity scores in the design of observational studies for causal effects. Biometrika.
Jonathan Roth , Pedro H.C. Sant’Anna (2022). When Is Parallel Trends Sensitive to Functional Form?.
Andrew Baker, Jonah B. Gelbach (2022). Machine Learning and Predicted Returns for Event Studies in Securities Litigation.
Andrew C. Baker , David F. Larcker, Charles C. Y. Wang (2022). How Much Should We Trust Staggered Difference-In-Differences Estimates? Journal of Financial Economics.
Carolina Caetano, Brantly Callaway, Stroud Payne, Hugo Sant’Anna Rodrigues (2022). Difference in Differences with Time-Varying Covariates
Clément de Chaisemartin, Xavier d’Haultfoeuille, Félix Pasquier, Gonzalo Vazquez-Bare (2022). Difference-in-Differences Estimators for Treatments Continuously Distributed at Every Period.
Susanne Dandl, Torsten Hothorn, Heidi Seibold, Erik Sverdrup, Stefan Wager, Achim Zeileis (2022). What Makes Forest-Based Heterogeneous Treatment Effect Estimators Work?
Arindrajit Dube, Daniele Girardi, Oscar Jorda, Alan M. Taylor (2022). A Local Projections Approach to Difference-in-Differences Event Studies
Dalia Ghanem, Pedro Sant’Anna, Kaspar Wüthrich (2022). Selection and parallel trends.
Paul Goldsmith-Pinkham, Peter Hull & Michal Kolesár (2022). Contamination Bias in Linear Regressions
Nandita Mitra, Jason Roy, Dylan Small (2022). The Future of Causal Inference. American Journal of Epidemiology.
Jonathan Roth , Pedro H.C. Sant’Anna , Alyssa Bilinski , John Poe (2022). What’s Trending in Difference-in-Differences? A Synthesis of the Recent Econometrics Literature.
Pedro Picchetti, Cristine Pinto (2022). Marginal Treatment Effects in Difference-in-Differences
Anna Wysocki, Katherine Lawson, Mijke Rhemtulla (2022). Statistical Control Requires Causal Justification. Advances in Methods and Practices in Psychological Science.
2021
Dmitry Arkhangelsky , Susan Athey , David A. Hirshberg, Guido 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.
Eli Ben-Michael, Avi Feller, Jesse Rothstein (2021). Synthetic Controls with Staggered Adoption.
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.
Clément de Chaisemartin , Xavier D’Haultfoeuille (2021). Two-Way Fixed Effects and Differences-in-Differences with Heterogeneous Treatment Effects: A Survey.
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 (2021). Nonparametric Difference-in-Differences in Repeated Cross-Sections with Continuous Treatments.
Bruno Ferman, Cristine Pinto (2021). Synthetic Controls With Imperfect Pretreatment Fit. Quantitative Economics.
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
Kosuke Imai, In Song Kim, Erik Wang (2021). Matching Methods for Causal Inference with Time-Series Cross-Sectional Data.
Kosuke Imai, In Song Kim (2021). On the Use of Two-way Fixed Effects Regression Models for Causal Inference with Panel Data. Political Analysis.
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.
2020
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.
Pedro H.C. Sant’Anna , Jun Zhao (2020). Doubly robust difference-in-differences estimators. Journal of Econometrics.
Tymon Słoczyński (2020). Interpreting OLS Estimands When Treatment Effects Are Heterogeneous: Smaller Groups Get Larger Weights. The Review of Economics and Statistics.
Liyang Sun, Sarah Abraham (2020). Estimating dynamic treatment effects in event studies with heterogeneous treatment effects. Journal of Econometrics.
2019 and earlier
Bruno Ferman, Cristine Pinto (2019). Inference in Differences-in-Differences with Few Treated Groups and Heteroskedasticity. The Review of Economics and Statistics.
Simon Freyaldenhoven, Christian Hansen, Jesse M. Shapiro (2019). Pre-event Trends in the Panel Event-Study Design. American Economic Review.
Clément de Chaisemartin , Xavier D’Haultfoeuille (2018). Fuzzy differences-in-differences. The Review of Economic Studies.
Hans Fricke (2017). Identification based on difference-in-differences approaches with multiple treatments. Oxford Bulletin of Economics and Statistics.
Xavier D’Haultfoeuille, Stefan Hoderlein, Yuya Sasaki (2013). Nonlinear difference-indifferences in repeated cross sections with continuous treatments.
Susan Athey , Guido Imbens (2006). Identification and inference in nonlinear difference-indifferences models. Econometrica.
Interactive dashboards
These (related) interactive R-Shiny dashboards show 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