mdd_event_study | R Documentation |
Event study
mdd_event_study(
mdd_dat,
trim_low = NULL,
trim_high = NULL,
time.omit = -1,
weights = NULL,
cluster = NULL,
...
)
## S3 method for class 'mdd_event_study'
plot(x, ...)
mdd_dat |
An object of class mdd_dat created by |
trim_low, trim_high |
Upper/lower bound on parameters to include |
time.omit |
Which is the base year omitted in the analysis? |
weights |
Weight argument passed to the underlying |
cluster |
Cluster argument passed to the underlying |
... |
passed to feols for mdd_event_study |
x |
the ES object |
This function uses lags of pre/post treatment, omitting the lag -1
(can be changed with time.omit
).
The interpretation of the event-study coefficient is then the following:
each coefficient represents the value of a DiD relating the treated/control difference
at relative year -3, -2, 1, 2
to the treated/control difference at relative year -1.
mdd_test_pre_trend_event
to run a parallel trend assumption
## simulate and format data
DID_dat <- sim_dat_common(timing_treatment = 5:10, as_mdd = TRUE)
## Estimate DiD
mdd_DD_simple(DID_dat)
## estimate ES
ES_out <- mdd_event_study(DID_dat)
ES_out
summary(ES_out)
plot(ES_out)
## compare to year-t- base year diff-diffs:
means_manu <- DID_dat |>
mdd_group_means() |>
as.data.frame() |>
reshape(idvar = "Time",timevar = ".group",
direction = "wide")
diff_by_period <- means_manu$y.treated - means_manu$y.control
all.equal((diff_by_period - diff_by_period[5])[-5],
coef(ES_out), check.attributes= FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.