EventStudy R Package
A free, open-source R package for rigorous event study analysis. From simple market models to panel DiD and synthetic control -- everything you need for academic research and industry applications.
15 return models · 12 test statistics · 6 DiD estimators · MIT license
Capabilities
Comprehensive Event Study Toolkit
Everything you need to design, execute, and report event studies in R.
15 Expected Return Models
Market Model, Market Adjusted, Mean Adjusted, Fama-French 3/5-Factor, Carhart 4-Factor, GARCH(1,1), EGARCH, GJR-GARCH, and more. Simple and log returns supported.
12 Test Statistics
Parametric and non-parametric tests: t-tests, Patell Z, BMP, Kolari-Pynnonen, Sign Test, Generalized Sign Test, Rank Test, Wilcoxon, and Calendar-Time Portfolio.
Panel Difference-in-Differences
Six DiD estimators for staggered treatment designs: TWFE, Callaway-Sant'Anna, Sun-Abraham, de Chaisemartin-D'Haultfoeuille, Borusyak-Jaravel-Spiess, and Gardner.
Synthetic Control Method
Counterfactual estimation with donor pool optimization and placebo-based inference. Ideal for single-unit case studies.
Power Analysis & Simulation
Monte Carlo simulation to determine the statistical power of your event study design before collecting data. Optimize sample size and event windows.
Publication-Ready Export
Export results as LaTeX tables, styled Excel workbooks, CSV files, and publication-quality plots. Ready for academic papers and reports.
Models
15 Expected Return Models
Choose the expected return model that best fits your research design. All models support both simple and log returns.
| Model | Description |
|---|---|
| Market Model | OLS regression: R_i = alpha + beta * R_m + epsilon |
| Market Adjusted | AR = R_firm - R_index (zero alpha/unit beta) |
| Mean Adjusted | AR = R_firm - mean(R_firm) over estimation window |
| Fama-French 3-Factor | Market, SMB, HML factor model |
| Fama-French 5-Factor | FF3 + RMW (profitability) + CMA (investment) |
| Carhart 4-Factor | FF3 + MOM (momentum factor) |
| GARCH(1,1) | Conditional variance with GARCH(1,1) errors |
| EGARCH | Exponential GARCH for asymmetric volatility |
| GJR-GARCH | Threshold GARCH capturing leverage effects |
| Scholes-Williams | Thin-trading adjusted beta estimation |
| Dimson | Multi-period beta for infrequent trading |
| Comparison Period Mean Adjusted | AR based on mean return from comparison period |
| BHAR | Buy-and-hold abnormal returns |
| Abnormal Volume | Abnormal trading volume relative to benchmark |
| Abnormal Volatility | Abnormal return volatility relative to estimation window |
Testing
12 Statistical Tests
Parametric and non-parametric significance tests for single-event and multi-event studies.
| Test | Type | Description |
|---|---|---|
| AR t-Test | Single-event | Standard t-test on individual abnormal returns |
| CAR t-Test | Single-event | Cumulative abnormal return significance test |
| BHAR t-Test | Single-event | Buy-and-hold abnormal return significance test |
| Cross-Sectional t-Test | Multi-event | Cross-sectional mean test on AARs |
| Patell Z-Test | Multi-event | Standardized residual test (Patell, 1976) |
| BMP Test | Multi-event | Boehmer-Musumeci-Poulsen (1991) robust to event-induced variance |
| Kolari-Pynnonen Test | Multi-event | Adjusted BMP with cross-correlation correction |
| Sign Test | Multi-event | Non-parametric test on sign of abnormal returns |
| Generalized Sign Test | Multi-event | Adjusted sign test accounting for estimation period fraction |
| Rank Test | Multi-event | Corrado (1989) rank-based non-parametric test |
| Wilcoxon Signed-Rank | Multi-event | Non-parametric test on magnitude and sign of ARs |
| Calendar-Time Portfolio | Multi-event | Calendar-time portfolio approach (Jaffe, 1974; Mandelker, 1974) |
Getting Started
Install in Seconds
Install the EventStudy R package directly from GitHub using devtools.
# Install from GitHub
devtools::install_github("sipemu/eventstudy")Example
Run Your First Event Study
A complete example: load data, run a Market Model event study, view the summary, and export results.
library(EventStudy)
# Load example data
data(EventStudyData)
# Run a Market Model event study
result <- EventStudy(
firm_data = firm_data,
market_data = market_data,
event_list = event_list,
return_model = "market_model",
return_type = "log",
est_window = 250,
event_window = c(-10, 10)
)
# View summary
summary(result)
# Export to Excel
export_excel(result, file = "event_study_results.xlsx")
# Export LaTeX tables
export_latex(result, file = "tables.tex")FAQ
Frequently Asked Questions
Is the R package free to use?
Yes. The EventStudy R package is completely free and open source under the MIT license. You can use it for academic research, commercial projects, and teaching without any restrictions.
What R version is required?
The package requires R >= 4.0.0 and depends on standard CRAN packages. It works on Windows, macOS, and Linux.
How does the R package compare to the web app?
The R package offers full programmatic control, reproducible scripts, and access to advanced features like panel DiD, synthetic control, intraday analysis, and power simulation. The web app is ideal for quick interactive analyses without coding.
Can I use it for panel Difference-in-Differences?
Yes. The R package includes 6 DiD estimators for staggered adoption designs: TWFE, Callaway-Sant'Anna, Sun-Abraham, de Chaisemartin-D'Haultfoeuille, Borusyak-Jaravel-Spiess, and Gardner.
Where can I find detailed documentation?
Comprehensive documentation is available on this website under the Docs section. You can also find R function-level help using ?EventStudy in R after installing the package.
Start Your Event Study in R
Install the package from GitHub and run your first analysis in minutes. Full documentation and example datasets included.