EventStudy R Package v0.50.0: Synthetic Control, Modern DiD, and More
What's New in v0.50.0
EventStudy v0.50.0 is the latest major release of the R package for event study analysis, expanding the toolkit to 15 return models, 12 test statistics, and 6 panel DiD estimators. This release adds synthetic control methods, wild bootstrap inference, Monte Carlo power analysis, and modern difference-in-differences estimators that address the negative weighting problem identified by Goodman-Bacon (2021).
Building on the foundation of v0.40.0, this release adds time-varying parameter models, modern DiD estimators, synthetic control methods, and robust inference tools. Here is everything new.
EventStudy v0.50.0 delivers 6 panel DiD estimators that address the negative weighting bias identified by Goodman-Bacon (2021) in traditional TWFE regressions. The release also introduces Monte Carlo power analysis, enabling researchers to estimate detection rates before data collection -- a critical capability given that, as documented by Kothari and Warner (2007), event studies with fewer than 30 events often fail to detect abnormal returns of 1% or less with adequate power.
2 New Return Models (15 total)
- Rolling Window Model (
RollingWindowModel) -- time-varying and via rolling OLS. Captures structural breaks without parametric assumptions. - DCC-GARCH Model (
DCCGARCHModel) -- Dynamic Conditional Correlation GARCH for time-varying beta and volatility. Based on Engle (2002).
# Rolling window with 60-day window
ps <- ParameterSet$new(return_model = RollingWindowModel$new(window_size = 60))
# DCC-GARCH for time-varying correlation
ps <- ParameterSet$new(return_model = DCCGARCHModel$new())Kolari-Pynnonen Test (12 test statistics total)
The new KolariPynnonenTest adjusts the BMP test for cross-sectional correlation caused by event clustering. Essential when multiple events occur on the same calendar date.
ps <- ParameterSet$new(
multi_event_statistics = MultiEventStatisticsSet$new(
tests = list(BMPTest$new(), KolariPynnonenTest$new())
)
)3 New Panel DiD Estimators (6 total)
The panel event study module now includes three modern DiD estimators alongside the existing TWFE and Sun & Abraham methods:
- Callaway & Sant'Anna (2021) -- doubly robust group-time ATTs with flexible aggregation. Requires
did. - de Chaisemartin & D'Haultfoeuille (2020) -- robust estimation for switchers, handles treatment reversals. Requires
DIDmultiplegt. - Borusyak, Jaravel & Spiess (2024) -- efficient imputation estimator for staggered adoption. Requires
didimputation.
result <- estimate_panel_event_study(
panel_task,
method = "callaway_santanna",
leads = 5, lags = 5
)Synthetic Control Methods
A completely new module for single-unit causal inference. Construct a weighted combination of donor units to approximate the treated unit's counterfactual, then assess significance via placebo tests.
sc_task <- SyntheticControlTask$new(treated_data, donor_data, treatment_time = 25)
result <- estimate_synthetic_control(sc_task)
placebo <- sc_placebo_test(sc_task)
plot_synthetic_control(placebo, type = "placebo")Wild Bootstrap Inference
When asymptotic p-values are unreliable (short estimation windows, non-normal residuals, small samples), the wild bootstrap provides more accurate inference:
boot_result <- bootstrap_test(task, n_boot = 999, weight_type = "rademacher")Multiple Testing Corrections
Control false discovery when testing multiple windows, subgroups, or statistics:
adjusted <- adjust_p_values(task, method = "BH") # Benjamini-Hochberg
adjusted <- adjust_p_values(task, method = "holm") # Holm (step-down Bonferroni)Power Analysis via Monte Carlo Simulation
Design your study with confidence. As emphasized by Kothari and Warner (2007), event studies with fewer than 20-30 events often have power below 50% to detect economically meaningful effects. The new simulation module lets you estimate detection power before collecting data:
sim <- simulate_event_study(
n_events = 30,
n_simulations = 1000,
abnormal_return = 0.01
)
sim$power # e.g., 0.82 = 82% detection rateSummary
| Feature | v0.40.0 | v0.50.0 |
|---|---|---|
| Return models | 13 | 15 |
| Test statistics | 11 | 12 |
| Panel DiD estimators | 3 | 6 |
| Synthetic control | -- | New |
| Wild bootstrap | -- | New |
| Multiple testing corrections | -- | New |
| Power analysis | -- | New |
- Synthetic Control
- A method that constructs a counterfactual for a treated unit from a weighted combination of untreated donor units. Used for single-unit causal inference when traditional event study methods lack power.
- Wild Bootstrap
- A resampling method for constructing p-values that is robust to heteroskedasticity and non-normality. Provides more accurate inference than asymptotic tests in small samples.
Getting Started
Install from GitHub:
# install.packages("devtools")
devtools::install_github("sipemu/eventstudy")Check the GitHub repository for the latest updates and full documentation.
Get the latest R package
Install the newest version from GitHub to access all the features described above.