esplot | R Documentation |
Visualize the dynamic treatment effects and create an event study plot.
esplot(data, Period, Estimate, SE, CI.lower = NULL,
CI.upper = NULL, Count = NULL, fill.gap = TRUE,
start0 = FALSE, show.count = NULL, stats = NULL,
stats.labs = NULL, highlight.periods = NULL,
highlight.colors = NULL, main = NULL,
xlim = NULL, ylim = NULL,
xlab = NULL, ylab = NULL,
gridOff = FALSE, stats.pos = NULL,
theme.bw = TRUE, cex.main = NULL,
cex.axis = NULL, cex.lab = NULL,
cex.text = NULL, axis.adjust = FALSE)
data |
The input data for the event study plot. |
Period |
The variable name of the relative period. |
Estimate |
The variable name of the estimated coefficient. |
SE |
The variable name of the standard errors. Omitted if |
CI.lower |
Optional. The variable name of the lower confidence interval. |
CI.upper |
Optional. The variable name of the upper confidence interval. |
Count |
Optional. The variable name indicating the number of treated observations for each time period. |
fill.gap |
Logical. Whether to use 0 values to fill gaps in dynamic treatment effects. Default is |
start0 |
Logical. Whether period 0 should be considered as the first post-treatment period. Default is |
show.count |
Logical. Whether to display the bar plot of the number of observations at the bottom of the plot. |
stats |
Optional. A list of statistics to be printed on the plot. |
stats.labs |
Optional. The names corresponding to |
highlight.periods |
Optional. A list of periods to highlight. |
highlight.colors |
Optional. A list of colors for highlighting periods. |
main |
Optional. The title of the plot. |
xlim |
Optional. The limits of the x-axis. |
ylim |
Optional. The limits of the y-axis. |
xlab |
Optional. The label for the x-axis. |
ylab |
Optional. The label for the y-axis. |
gridOff |
Logical. Whether to turn off grid lines. Default is |
stats.pos |
Optional. The position of the printed statistics. |
theme.bw |
Logical. Whether to use a black-and-white theme. Default is |
cex.main |
Optional. The font size for the plot title. |
cex.axis |
Optional. The font size for the axis labels. |
cex.lab |
Optional. The font size for the axis tick labels. |
cex.text |
Optional. The font size for other text elements in the plot. |
axis.adjust |
Logical. Whether to adjust the axis position. Default is |
p |
A ggplot object of the event study plot. |
Licheng Liu, Yiqing Xu, Ziyi Liu, Zhongyu Yin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.