Thin wrapper around fixest::feols with fixest::i()
relative-time dummies, plus unit and time fixed effects. The
reference_period is dropped as the baseline. Hard-errors if
fixest is not installed.
Usage
morie_did_event_study(
data,
outcome,
unit,
time,
treatment_time,
covariates = NULL,
reference_period = -1L,
leads = 4L,
lags = 4L,
cluster = NULL,
alpha = 0.05
)Arguments
- data
Panel data frame.
- outcome
Outcome column.
- unit
Unit identifier column.
- time
Calendar-time column (integer-valued).
- treatment_time
Column giving the period in which each unit first received treatment (
InforNAfor never-treated units).- covariates
Optional time-varying covariates.
- reference_period
Relative-time period omitted as baseline (default
-1).- leads
Number of pre-treatment periods to include.
- lags
Number of post-treatment periods to include.
- cluster
Cluster variable for standard errors (defaults to
unit).- alpha
Significance level.
Value
A list with coefficients (data frame),
reference_period, pre_trend_f_stat,
pre_trend_p_value, and details.
Details
For sun-Abraham interaction-weighted estimation prefer
fixest::sunab() directly.