Learn R Programming

fixes (version 0.5.0)

plot_es: Plot Event Study Results

Description

plot_es() produces standard event study plots, showing estimated effects and confidence intervals across event time. Supports both ribbon and errorbar styles, multiple confidence levels, and several ggplot2 themes.

Usage

plot_es(
  data,
  ci_level = 0.95,
  type = "ribbon",
  vline_val = 0,
  vline_color = "#000",
  hline_val = 0,
  hline_color = "#000",
  linewidth = 1,
  pointsize = 2,
  alpha = 0.2,
  barwidth = 0.2,
  color = "#B25D91FF",
  fill = "#B25D91FF",
  theme_style = "bw"
)

Value

A ggplot2 object.

Arguments

data

Data frame returned by run_es().

ci_level

Confidence level for intervals (numeric, e.g. 0.95). Must match columns like 'conf_low_95'.

type

Confidence interval style: "ribbon" (default) or "errorbar".

vline_val

X value for vertical reference line (default: 0).

vline_color

Color for vertical line.

hline_val

Y value for horizontal reference line (default: 0).

hline_color

Color for horizontal line.

linewidth

Width of estimate line or error bars.

pointsize

Point size for estimates.

alpha

Transparency for ribbon (default: 0.2).

barwidth

Width of error bars (if type = "errorbar").

color

Color for lines and points.

fill

Fill color for ribbon.

theme_style

ggplot2 theme: "bw" (default), "minimal", or "classic".

Author

Yosuke Abe

Details

Visualizes event study estimates and confidence intervals produced by run_es().

See Also

run_es

Examples

Run this code
if (FALSE) {
result <- run_es(...)
plot_es(result, ci_level = 0.95, type = "ribbon")
}

Run the code above in your browser using DataLab