drdid
depvar [indepvars] [if] [in] , [ivar(varname)] time(varname) treatment(varname) [noisily method rc1]
drdid
implements the locally efficient doubly robust difference-in-differences (DiD) estimators for the average treatment effect proposed by Sant'Anna and Zhao (2020). The estimator combines inverse probability weighting and outcome regression estimators (also implemented in the package) to form estimators with more attractive statistical properties.
Parameter | Description |
---|---|
ivar | Variable indexing groups, e.g., country. When ivar is ignored, repeated cross section data is assumed. |
time | Variable indexing time, e.g., year |
treatment | Dummy variable indicating treatment, e.g., reform |
method is one of
Method | Description |
---|---|
drimp (default) | Sant’Anna and Zhao (2020a) Improved doubly robust DiD estimator based on inverse probability of tilting and weighted least squares |
dripw | Sant’Anna and Zhao (2020a) doubly robust DiD estimator based on stabilized inverse probability weighting and ordinary least squares |
reg | Outcome regression DiD estimator based on ordinary least squares |
stdipw | Abadie (2005) inverse probability weighting DiD estimator with stabilized weights |
ipw | Abadie (2005) inverse probability weighting DiD estimator |
ipwra | Inverse-probability-weighted regression adjustment (via teffects) |
all | Compute all of the above |
Option | Description |
---|---|
rc1 | When using repeated crossection data, the option rc1 requests the doubly robust, but not locally efficient, drimp and dripw estimators. |
nosily | Request showing the estimation of all intermediate steps. |
The command may create additional variables in the dataset. __att__
stores the recentered influence function for the estimated statistic and __dy__
stores the change in the outcome for an individual (when panel data is used). These variables are overwritten everytime the command is run.
The command also returns, as part of e()
, the coefficients and variance covariance matrixes associated with all intermediate sets. See ereturn list
after running the command.
use https://friosavila.github.io/playingwithstata/drdid/lalonde.dta, clear
Panel estimator with default drimp method
drdid re age educ black married nodegree hisp re74 if treated==0 | sample==2, ivar(id) time(year) tr(experimental)
Repeated cross section
drdid re age educ black married nodegree hisp re74 if treated==0 | sample==2, time(year) tr(experimental)
- Fernando Rios-Avila (Levy Economics Institute of Bard College), maintainer
- Asjad Naqvi (International Institute for Applied Systems Analysis)
- Pedro H. C. Sant'Anna (Vanderbilt University)
You are free to use this package under the terms of its license. If you use it, please cite both the original article and the software package in your work:
- Sant’Anna, Pedro H. C., and Jun Zhao. 2020a. “Doubly Robust Difference-in-Differences Estimators.” Journal of Econometrics 219 (1): 101–22.
- Rios-Avila, Fernando, Asjad Naqvi and Pedro H. C. Sant'Anna. 2021. “DRDID: Doubly Robust Difference-in-Differences Estimators for Stata.” [Software] Available at https://github.com/friosavila/csdid_drdid/tree/v0.1
- Abadie, Alberto. 2005. “Semiparametric Difference-in-Differences Estimators.” The Review of Economic Studies 72 (1): 1–19.
- Sant’Anna, Pedro H. C., and Jun Zhao. 2020a. “Doubly Robust Difference-in-Differences Estimators.” Journal of Econometrics 219 (1): 101–22.
- Sant’Anna, Pedro H. C., and Jun Zhao. 2020b. “DRDID: Doubly Robust Difference-in-Differences Estimators.” [Software] Available at https://cran.r-project.org/package=DRDID