How do I measure abnormal returns around an event?
Count trading days relative to an event in a long pandas panel, estimate a market model on the days before it, and compute abnormal and cumulative abnormal returns with a benchmark that leaves out the event stock.
After this lesson, you can measure how much a stock’s returns around an event differ from its normal returns, day by day and in total.
How do I count trading days relative to the event?
The event day is day 0, the trading day before it day −1 and the one after it day 1, so a weekend counts as no days. AAA announces its earnings before the open on Monday 10 March 2025, so Friday 7 March is day −1.
The example is a long panel, as in the lesson on long and wide panels, of three made-up stocks over nine trading days, with daily returns in percent. AAA’s benchmark is the mean return of BBB and CCC, which leaves out AAA, so that AAA’s own event does not move it.
panel["ticker"] != "AAA" keeps the other stocks, and .groupby("date").mean() gives the benchmark of each date. .map(market_return) puts each date’s benchmark on AAA’s rows. AAA’s rows are in date order, so its day is the row position minus the number of rows before the event, which (aaa["date"] < "2025-03-10").sum() counts.
The following box builds the panel and counts AAA’s relative days.
On 10 March, the benchmark returns 0.5%, while AAA returns 5.8%.
How do I compute the abnormal returns?
A market model estimated on the days before the event gives AAA’s expected return, and the abnormal return is the actual return minus the expected one. Estimated on days −6 to −2, the model is \(0.2 + 1.2\,R_{m,t}\), so on the event day AAA’s expected return is \(0.2 + 1.2 \times 0.5 = 0.8\%\) and its abnormal return 5.0 percentage points.
Here \(R_t\) is AAA’s return on day \(t\), \(R_{m,t}\) the benchmark’s, \(\hat\alpha\) and \(\hat\beta\) the estimates from the days before the event, and \(CAR_{[a,b]}\) the cumulative abnormal return from day \(a\) to day \(b\).
abnormal_returns fits the market model on the estimation days, as in the lesson on OLS, and predicts the event days, as in the lesson on predicting with OLS. .between(*estimation_days) keeps the days from the first to the last number of the pair, both included, and .cumsum() adds up the abnormal returns.
The following box computes AAA’s abnormal returns on days −1 to 1.