reg_did_panel {DRDID} | R Documentation |
Outcome regression DiD estimator for the ATT, with panel data
Description
reg_did_panel
computes the outcome regressions estimators for the average treatment effect on the
treated in difference-in-differences (DiD) setups with panel data.
Usage
reg_did_panel(
y1,
y0,
D,
covariates,
i.weights = NULL,
boot = FALSE,
boot.type = "weighted",
nboot = NULL,
inffunc = FALSE
)
Arguments
y1 |
An |
y0 |
An |
D |
An |
covariates |
An |
i.weights |
An |
boot |
Logical argument to whether bootstrap should be used for inference. Default is FALSE. |
boot.type |
Type of bootstrap to be performed (not relevant if |
nboot |
Number of bootstrap repetitions (not relevant if |
inffunc |
Logical argument to whether influence function should be returned. Default is FALSE. |
Details
The reg_did_panel
function implements
outcome regression difference-in-differences (DiD) estimator for the average treatment effect
on the treated (ATT) defined in equation (2.2) of Sant'Anna and Zhao (2020) when panel data are available.
The estimator follows the same spirit of the nonparametric estimators proposed by Heckman, Ichimura and Todd (1997),
though here the the outcome regression models are assumed to be linear in covariates (parametric),
The nuisance parameters (outcome regression coefficients) are estimated via ordinary least squares.
Value
A list containing the following components:
ATT |
The OR DiD point estimate |
se |
The OR DiD standard error |
uci |
Estimate of the upper bound of a 95% CI for the ATT |
lci |
Estimate of the lower bound of a 95% CI for the ATT |
boots |
All Bootstrap draws of the ATT, in case bootstrap was used to conduct inference. Default is NULL |
att.inf.func |
Estimate of the influence function. Default is NULL |
call.param |
The matched call. |
argu |
Some arguments used (explicitly or not) in the call (panel = TRUE, boot, boot.type, nboot, type="or") |
References
Heckman, James J., Ichimura, Hidehiko, and Todd, Petra E. (1997),"Matching as an Econometric Evaluation Estimator: Evidence from Evaluating a Job Training Programme", Review of Economic Studies, vol. 64(4), p. 605–654, doi:10.2307/2971733.
Sant'Anna, Pedro H. C. and Zhao, Jun. (2020), "Doubly Robust Difference-in-Differences Estimators." Journal of Econometrics, Vol. 219 (1), pp. 101-122, doi:10.1016/j.jeconom.2020.06.003
Examples
# Form the Lalonde sample with CPS comparison group
eval_lalonde_cps <- subset(nsw, nsw$treated == 0 | nsw$sample == 2)
# Further reduce sample to speed example
set.seed(123)
unit_random <- sample(1:nrow(eval_lalonde_cps), 5000)
eval_lalonde_cps <- eval_lalonde_cps[unit_random,]
# Select some covariates
covX = as.matrix(cbind(eval_lalonde_cps$age, eval_lalonde_cps$educ,
eval_lalonde_cps$black, eval_lalonde_cps$married,
eval_lalonde_cps$nodegree, eval_lalonde_cps$hisp,
eval_lalonde_cps$re74))
# Implement OR DiD with panel data
reg_did_panel(y1 = eval_lalonde_cps$re78, y0 = eval_lalonde_cps$re75,
D = eval_lalonde_cps$experimental,
covariates = covX)