event-study-cars

Solid

Complete methodology for computing publication-quality cumulative abnormal returns with proper event-study test statistics, matching the robustness of Kaspereit's eventstudy2 for Stata. Covers dateline construction, event-date mapping, estimation and event windows, thin-trading adjustment, OLS with Theil prediction error correction, abnormal return computation, CAR/CAAR/AAR accumulation, boundary contamination guards, and common tests such as Patell, BMP, Kolari-Pynnonen, generalized sign, Wilcoxon, and GRANK-T. Use when the user mentions abnormal returns, event windows, market-model regressions, CARs, CAAR, AAR, eventstudy2, thin trading, trade-to-trade returns, or event-study test statistics.

AI & Automation 57 stars 0 forks Updated 5 days ago MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
59
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Event Study: Cumulative Abnormal Returns (CARs) A complete methodology reference for computing publication-quality CARs with robust test statistics, matching the rigor of Kaspereit's eventstudy2 (v3.2b) for Stata. This skill is **generic** — applicable to any market, asset class, or event type. ## Use the shipped engine first (do not rewrite it) `scripts/eventstudy.py` is a complete, runnable Python replication of eventstudy2, validated against the Stata package to floating-point precision (AR ~1e-8, CAR ~6e-8, CAAR and the implemented test statistics ~1e-7) on a generic CRSP sample across all four models (FM, COMEAN, MA, RAW). It is generic — all column names, the model, windows, thin-trading, and log handling are CLI flags. When a user wants CARs computed, **run this engine**; do not author a new pipeline. ```bash python scripts/eventstudy.py --selftest # synthetic self-check, no inputs python scripts/eventstudy.py \ --returns returns.csv --market market.csv --events events.csv \ --id-col permno --ret-col ret --event-date-col event_date --mkt-col vwretd \ --model FM --car-windows "-1,1;-5,5;-10,10" \ --eswlb -250 --eswub -30 --evwlb -10 --evwub 10 --out-dir out/ ``` Inputs are CSV/Parquet: returns (`id, date, ret`), market/factors (`date, mkt[, factors]`), events (`id, event_date`). Outputs: `ar_panel.csv`, `car_panel.csv`, `test_statistics.csv`. Requires numpy/pandas/scipy. Run `--help` for all flags (`--factor-cols smb,hml`, `--model MA`, `...

Details

Author
kennethkhoocy
Repository
kennethkhoocy/applied-micro-skills
Created
6 days ago
Last Updated
5 days ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category