twfe_did_rc {DRDID} | R Documentation |
Two-way fixed effects DiD estimator, with repeated cross-section data
Description
twfe_did_rc
is used to compute linear two-way fixed effects estimators for the ATT
in difference-in-differences (DiD) setups with stationary repeated cross-sectional data. As illustrated
by Sant'Anna and Zhao (2020),this estimator generally do not recover the ATT. We encourage empiricists
to adopt alternative specifications.
Usage
twfe_did_rc(
y,
post,
D,
covariates = NULL,
i.weights = NULL,
boot = FALSE,
boot.type = "weighted",
nboot = NULL,
inffunc = FALSE
)
Arguments
y |
An |
post |
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. |
Value
A list containing the following components:
ATT |
The TWFE DiD point estimate |
se |
The TWFE DiD standard error |
uci |
Estimate of the upper bound of a 95% CI for the TWFE parameter. |
lci |
Estimate of the lower bound of a 95% CI for the TWFE parameter. |
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 |
Examples
# use the simulated data provided in the package
covX = as.matrix(sim_rc[,5:8])
# Implement TWFE DiD estimator (you probably should consider something else....)
twfe_did_rc(y = sim_rc$y, post = sim_rc$post, D = sim_rc$d,
covariates= covX)