# NOT RUN {
# Sample data illustrating the DiD
data(base_did)
# Estimation of yearly effect (they are automatically added)
est = did_estimate_yearly_effects(y ~ x1 + treat + post, base_did,
treat_time = ~treat+period, reference = 5)
# Now we plot the results
did_plot_yearly_effects(est)
# Now with fixed-effects:
est_fe = did_estimate_yearly_effects(y ~ x1 | id + period, base_did,
treat_time = ~treat+period, reference = 5)
did_plot_yearly_effects(est_fe)
# you can change the type of SE to be plotted:
did_plot_yearly_effects(est_fe, se = "cluster") # default
did_plot_yearly_effects(est_fe, se = "standard")
# }
Run the code above in your browser using DataLab