Iterative Event Study

This project implements an automated event study framework to analyze stock price reactions around corporate events such as earnings releases, mergers, and regulatory announcements.

Drawing inspiration from A/B testing in software engineering, the model compares individual stock returns against a market benchmark using rolling estimation and event windows to isolate abnormal performance.

A Python-based pipeline processes Excel price data, iterates across multiple event dates, runs linear regressions on estimation windows, and computes Abnormal Returns (AR), Cumulative Abnormal Returns (CAR), and Average Abnormal Returns (AAR).

Statistical significance is evaluated using t-statistics, where |t-stat| > 1.96 flags market reactions significant at the 95% confidence level. Outputs are automatically written to Excel with structured formatting for analysis readability.

Project Highlights

  • Methodology

    Market model regression, sliding estimation windows, abnormal return calculation, and hypothesis testing.

  • Engineering Approach

    Iterative processing, automated Excel generation, error handling, and scalable design for multiple event dates.

  • Insight

    Identifies market efficiency gaps around corporate events using reproducible, code-driven financial analysis.

Python Implementation (Core Logic)

The following snippet highlights the core logic used to estimate abnormal returns and generate automated Excel outputs.


        import numpy as np
import pandas as pd
from scipy import stats

def event_study_analysis_iterative():
    """
    Iterative Event Study Analysis Code
    Reads data from data.xlsx and calculates AR for multiple event pointers
    """

    print("=" * 60)
    print("ITERATIVE EVENT STUDY ANALYSIS")
    print("=" * 60)

    # Read data from Excel file
    try:
        df = pd.read_excel('data.xlsx')
        print(f"\nāœ“ Successfully loaded data.xlsx")
        print(f"  Rows: {len(df)}")
        print(f"  Columns: {list(df.columns)}")
    except FileNotFoundError:
        print("\nERROR: data.xlsx not found in the current directory!")
        print("Please ensure data.xlsx is in the same folder as this script.")
        return None
    except Exception as e:
        print(f"\nERROR: Could not read data.xlsx - {e}")
        return None

.
        .
        .
        .
        .
        .
      
Download Python Script

Event Study Output (Excel)

The embedded Excel file below contains abnormal returns, CAR, AAR, regression parameters, and highlighted statistically significant market reactions.

Download Excel Output
← Back to Portfolio