Finance
2026-03-209 min read

Event Studies in Stata: Finance and Economics Applications

How to implement event studies in Stata for finance and economics research — abnormal returns, CAR estimation, and visualization.

Sytra Team
Research Engineering Team, Sytra AI

The event study is one of the oldest and most widely used methodologies in empirical finance. When a firm announces a merger, when the SEC issues a new regulation, when a CEO resigns — the event study measures whether and how much the stock price reacted. It leverages the semi-strong efficient markets hypothesis: all publicly available information is immediately incorporated into stock prices, so the price reaction at the event is the market’s assessment of the event’s value.

The methodology extends far beyond finance: economists use event study designs to measure the impact of policy changes, epidemiologists use them to study the effect of public health interventions, and political scientists use them to assess the market reaction to elections.

The Framework

An event study has three time windows:

  • Estimation window: A period before the event (e.g., days -250 to -30) used to estimate “normal” returns.
  • Event window: The period around the event (e.g., days -5 to +5) where you measure abnormal returns.
  • Post-event window: Optional period to measure longer-term effects.

The abnormal return is the difference between the actual return and the expected return (predicted from the estimation window). A positive abnormal return means the market reacted favorably; a negative one means it didn’t.

Step 1: Data Preparation

* Load stock return data (panel: firm × date)
use stock_returns, clear
 
* Generate relative event time
gen event_time = date - event_date
 
* Define windows
gen est_window = (event_time >= -250 & event_time <= -30)
gen event_window = (event_time >= -5 & event_time <= 5)

Step 2: Expected Returns — The Market Model

* Estimate the market model on the estimation window
regress ret market_ret if est_window == 1
 
* Predict expected returns for the full sample
predict expected_ret, xb
 
* Compute abnormal returns
gen ar = ret - expected_ret

For multi-event studies (many firms, each with their own event date), loop over firms:

* Firm-by-firm market model estimation
levelsof firm_id, local(firms)
gen ar = .
foreach f of local firms {
quietly reg ret market_ret if est_window == 1 & firm_id == `f'
predict temp_xb if firm_id == `f', xb
replace ar = ret - temp_xb if firm_id == `f'
drop temp_xb
}

Stop fighting with syntax.

Sytra is an AI research assistant built specifically for statistical computing. No more copy-pasting code into ChatGPT.

Get Early Access

Step 3: Cumulative Abnormal Returns (CAR)

* CAR over the event window [-5, +5]
bysort firm_id (event_time): gen car = sum(ar) if event_window
 
* Average CAR across firms
collapse (mean) avg_car = car (semean) se_car = car, by(event_time)
 
* t-test: is average CAR significantly different from zero?
gen t_stat = avg_car / se_car

Step 4: Visualization

* Event study plot
gen ci_upper = avg_car + 1.96 * se_car
gen ci_lower = avg_car - 1.96 * se_car
 
twoway (rcap ci_upper ci_lower event_time, lcolor(gs12)) ///
(scatter avg_car event_time, mcolor(navy) msymbol(circle)), ///
xline(0, lpattern(dash) lcolor(red)) ///
yline(0, lcolor(gs12) lpattern(solid)) ///
title("Event Study: Cumulative Abnormal Returns") ///
xtitle("Event Time (days)") ytitle("CAR")

Testing Significance

Standard approaches:

  • Cross-sectional t-test: Compute CAR for each firm over the event window, then test whether the mean CAR is different from zero: ttest car = 0
  • Boehmer, Musumeci, and Poulsen (1991) test: Standardizes each firm’s AR by its estimation-window standard deviation before averaging. More powerful when event-window variance varies across firms.
  • Kolari and Pynnönen (2010) adjusted test: Corrects for cross-sectional correlation when events cluster in calendar time (e.g., all firms affected by the same regulation on the same day).

Using estudy Package

* The estudy package automates much of this
ssc install estudy, replace
 
estudy ret, datevar(date) evdate(event_date) ///
lb1(-250) ub1(-30) lb2(-5) ub2(5) ///
marketfile(market_returns) marketvar(market_ret)

estudy handles the estimation window, market model, AR/CAR computation, and significance testing in one command. It’s useful for standard event studies but less flexible for custom specifications.

How Sytra Handles Event Studies

Tell Sytra: “Run an event study for merger announcements. Estimation window is [-250, -30]. Event window is [-5, +5]. Market model with CRSP value-weighted returns.”

Sytra generates the full pipeline — data prep, firm-by-firm market model estimation, AR/CAR computation, cross-sectional test, and the event study plot — in one loop. It flags if the estimation window has too few observations for any firm and handles firms with missing trading days automatically.

#Event Study#Stata#Finance#Economics

Enjoyed this article?