Visualize the adjusted close prices or abnormal returns of selected stocks around a specified event date.
Usage
plot_stocks(
task,
target_variable = "firm_adjusted",
add_event_date = FALSE,
max_symbols = 6,
sample_symbols = TRUE,
do_sample = NULL
)Arguments
- task
An EventStudyTask object.
- target_variable
A character string specifying the target variable to plot. Default is "firm_adjusted".
- add_event_date
Add vertical line for event date (TRUE/FALSE).
- max_symbols
An integer specifying the maximum number of symbols to display. Default is 6.
- sample_symbols
Logical; if
TRUE(default), randomly samplemax_symbolssymbols when the task contains more thanmax_symbols. IfFALSE, take the firstmax_symbolsin order.- do_sample
Deprecated. Renamed to
sample_symbolsin EventStudy 0.66.0. Accepts the old name for backward compatibility and emits one deprecation warning.
See also
Other eventstudy-plots:
es_colours,
plot_car_distribution(),
plot_diagnostics(),
plot_event_study(),
theme_eventstudy()
