Event Study Analysis in R

A comprehensive, modular R package for financial event study analysis. Implements the classical methodology (MacKinlay 1997) and extends it with modern multi-factor models, long-horizon methods, panel (DiD) event studies, and more.
Ecosystem
EventStudy is part of the eventstudy.de toolkit -- "Event Study Analysis Made Simple":
- Google Sheets Template -- quick, no-code event study for small samples
- R Package (this package) -- full programmatic pipeline with 15+ models, 12 test statistics, AI advisor, and publication-ready export
- WebAssembly App -- browser-based analysis with no installation required
Installation
GitHub
install.packages("devtools")
devtools::install_github("sipemu/eventstudy")
🤖 Claude Code Skills (AI pair-programming)
Two Claude Code Agent Skills ship with this repo as
an installable plugin, giving your AI assistant grounded knowledge of the package API:
es-capabilities -- discover the full API surface: return models, test
statistics, task types, function signatures, and method-for-task routing.
es-advisor -- run the grounded load -> run -> diagnose -> advise -> re-run ->
compare loop (offline degrade path, never fabricates a number).
Install via the built-in plugin marketplace:
/plugin marketplace add sipemu/eventstudy
/plugin install eventstudy@eventstudy
The skills are then auto-invoked from their descriptions, or callable as
/eventstudy:es-capabilities and /eventstudy:es-advisor.
Features
-
AI Advisor: Grounded, LLM-agnostic advice via es_advise() plus offline es_diagnostics(). Interprets only package-computed numbers and never fabricates results. Works fully offline with no API key required; optional LLM providers (Anthropic, OpenAI-compatible, custom) can be supplied via provider().
-
One-Call Reporting: Generate a complete, multi-format event study report in a single call: es_report(task) -- deep-clones the task, harvests diagnostics, and renders HTML/PDF/Word/Markdown with a grounded narrative (offline by default). Also available as run_event_study(..., report = TRUE).
-
15+ Return Models: Market Model, Market Adjusted, Mean Adjusted, Fama-French 3- and 5-factor, Carhart 4-factor, GARCH(1,1), DCC-GARCH, Rolling-Window, Buy-and-Hold Abnormal Returns (BHAR), Volume, and Volatility models.
-
12 Test Statistics: Parametric (AR T, CAR T, BHAR T, Cross-Sectional T, Patell Z, BMP, Kolari-Pynnonen) and non-parametric (Sign, Generalized Sign, Rank, Calendar-Time Portfolio).
-
Diagnostics: Shapiro-Wilk normality, Durbin-Watson, Ljung-Box autocorrelation, pre-trend testing.
-
Visualization: Event study plots (AR, CAR, AAR, CAAR) with confidence bands, diagnostic plots, CAR distribution histograms, panel event study plots.
-
Result Export: CSV, Excel (multi-sheet), and LaTeX (publication-ready tables). Broom-compatible tidy() method for tidyverse workflows.
-
Cross-Sectional Analysis: Regress CARs on firm characteristics with HC-robust standard errors. Group comparisons, quantiles, and distribution plots.
-
Intraday Event Studies: POSIXct timestamp support with minute/second-level windows.
-
Panel Event Studies (DiD): Two-way fixed effects (static and dynamic), Sun & Abraham (2021) interaction-weighted estimator for staggered treatment.
-
Extensible Design: Add custom models (inherit ModelBase) and test statistics (inherit TestStatisticBase).
Quick Start
library(EventStudy)
# Create task from your data
task <- EventStudyTask$new(firm_tbl, index_tbl, request_tbl)