DID2S: Stata module to estimate a TWFE model using the two-stage difference-in-differences approach
Kyle Butts ()
Additional contact information
Kyle Butts: University of Colorado, Boulder
Statistical Software Components from Boston College Department of Economics
Abstract:
did2s implements Two-Stage Difference-in-Differences by Gardner (2021). A TWFE model for outcomes is given by unit/group fixed effects, time fixed effects, treatment variable (or variables in the case of event study), and potentially covariates. To avoid the problems with OLS estimation of difference-in-differences/event-studies in the presence of staggered treatment adoption, this method proceeds in two stages: 1. This program estimates the unit/group fixed effects, time fixed effects, and potentially covariates using only untreated/not-yet-treated observations. This is used to predict counterfactual outcomes in all periods and residualize the observed outcome. 2. Then regress the residualized outcome on the treatment variable(s) to estimate the treatment effects.
Language: Stata
Requires: Stata version 13
Keywords: two-way fixed effects; differences in differences; DID (search for similar items in EconPapers)
Date: 2021-05-29, Revised 2023-04-28
Note: This module should be installed from within Stata by typing "ssc install did2s". The module is made available under terms of the GPL v3 (https://www.gnu.org/licenses/gpl-3.0.txt). Windows users should not attempt to download these files with a web browser.
References: Add references at CitEc
Citations:
Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/d/did2s.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/d/did2s.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/d/did2s_example.do sample do-file (text/plain)
http://fmwww.bc.edu/repec/bocode/d/df_het.dta sample data file (application/x-stata)
http://fmwww.bc.edu/repec/bocode/d/df_hom.dta sample data file (application/x-stata)
http://fmwww.bc.edu/repec/bocode/g/Gardner_2sdd.pdf documentation (application/pdf)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s458951
Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php
Access Statistics for this software item
More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().