
This function plots the results of a did_estimate_yearly_effects
estimation.
did_plot_yearly_effects(object, x.shift = 0, w = 0.1,
ci_level = 0.95, style = c("bar", "interval", "tube"), add = FALSE,
col = 1, bar.col = col, bar.lwd = par("lwd"), bar.lty,
grid = TRUE, grid.par = list(lty = 1), bar.join = TRUE, ...)
An object returned by the function did_estimate_yearly_effects
.
Shifts the confidence intervals bars to the left or right, depending on the value of x.shift
. Default is 0.
The width of the confidence intervals.
Scalar between 0 and 1: the level of the CI. By default it is equal to 0.95.
One of "interval"
(default), "bar"
or "tube"
. The style of the plot.
Default is FALSE
, if the intervals are to be added to an existing graph. Note that if it is the case, then the argument x
MUST be numeric.
Color of the point estimate and of the line joining them (if style = "interval"
).
Color of the bars of the confidence interval. Defaults to col
.
Line width of the confidence intervals, defaults to 1
.
Line type of the confidence intervals, defaults to 1
for style = "bar"
and to 2
for style = "interval"
.
Whether to add an horizontal grid. Default is TRUE
.
Graphical parameters used when plotting the grid in the background. Default is list(lty=1)
.
Logical, default is FALSE
. Whether to join the dots when style = "bar"
.
Any other argument to be passed to summary
or to plot
.
# 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