run_event_study: Run a Complete Event Study

View source: R/execute.R

run_event_studyR Documentation

Run a Complete Event Study

Description

Convenience wrapper that runs the full event study pipeline: prepare data, fit models, and calculate test statistics in a single call.

Usage

run_event_study(
  task,
  parameter_set = ParameterSet$new(),
  report = FALSE,
  report_args = list(),
  verbose = getOption("eventstudy.verbose", TRUE)
)

Arguments

task

An EventStudyTask object.

parameter_set

A ParameterSet object defining the event study. Defaults to a new ParameterSet with default settings.

report

Logical. When FALSE (default), the function behaves exactly as before this parameter was added. When TRUE, also renders a report via es_report() after the pipeline completes and attaches the rendered path(s) as attr(task, "report_path").

report_args

Named list forwarded to es_report() when report = TRUE. May include output_file, format, provider, and any other argument accepted by es_report(). Defaults to list() (uses es_report() defaults, which render "event_study_report.html" in the working directory).

verbose

Logical; if FALSE, suppress informational messages. Default getOption("eventstudy.verbose", TRUE).

Value

The task object with all results computed. When report = TRUE, the returned task additionally carries attr(task, "report_path") with the path(s) of the rendered report file(s). The return type is always a fitted EventStudyTask in both paths.

See Also

prepare_event_study, fit_model, calculate_statistics, MarketModel, ARTTest

Other eventstudy-pipeline: EventStudyTask, ParameterSet, calculate_statistics(), fit_model(), prepare_event_study()

Examples


data(dieselgate)
task <- EventStudyTask$new(dieselgate$firm, dieselgate$index, dieselgate$request)

# Run the pipeline and render a report to a temporary directory
out  <- file.path(tempdir(), "event_study_report.html")
task <- run_event_study(task, ParameterSet$new(), report = TRUE,
                        report_args = list(output_file = out))
attr(task, "report_path")  # path to the rendered HTML



EventStudy documentation built on Oct. 31, 2026, 1:07 a.m.