Below are my event–study replication packages for the AFP withdrawal episodes in Peru. The code is organised in two self-contained directories of Jupyter notebooks: one for the multi-stock panel and one for the SPBVL index.
1. Multi-stock multifactor event study
Directory: /code/event-study/Multi_Stock_Reg_Multifactor/
This package implements the full pipeline for a panel of individual stocks: merging raw data, cleaning missing values, estimating multifactor regressions, and computing abnormal and cumulative abnormal returns at the stock and portfolio level.
Core notebooks (Python/Jupyter):
- 1_Merge_Dataset.ipynb – merges price, index, and factor data into a single panel.
- 2_Fill_Missing_Values.ipynb – handles missing observations and constructs balanced windows.
- 3_Regression.ipynb – estimates the baseline market (or multifactor) model.
- 3_Regression_with_significance.ipynb – extends the regression output with standard errors and significance flags.
- 4_AR.ipynb – computes abnormal returns for each stock and event.
- 4_AR_Portfolio.ipynb – aggregates abnormal returns at the portfolio level.
- 5_CAR.ipynb – constructs cumulative abnormal returns over event windows.
- 5_CAR_Portfolio_plot.ipynb – produces event-window plots for portfolio CARs.
- 6_CARs_Joint_Tests.ipynb – implements joint significance tests for CARs across stocks.
Input datasets and intermediate files are stored in the
Stocks/ subfolder,
together with Excel summaries of the main regression and CAR results.
2. SPBVL index event study
Directory: /code/event-study/SPBVL_Reg/
This package replicates the analysis at the market level using the SPBVL index, following the same structure as the multi-stock code but for a single time series.
Core notebooks:
- 01_Merging.ipynb – merges index returns, factors, and event indicators.
- 02_Events.ipynb – defines event dates and constructs event-time variables.
- 03_Regression.ipynb – estimates the market (or multifactor) model for the index.
- 04_ARs.ipynb – computes index abnormal returns around each AFP withdrawal announcement.
- 05_CAR_t-stat.ipynb – calculates CARs for several windows and their t-statistics.
- 06_Joint_CAR.ipynb – performs joint tests on CARs across events.
Additional utilities and robustness checks for alternative announcement dates
are collected in the
Announcement_Date_Analysis/
subfolder.
Working paper draft
A preliminary write-up of these results is available here: