Case Study 07

S&P 500 Fundamentals Analytics

Cross-sector valuation & volatility study

PythonPandasMatplotlib
View on GitHub (opens in new tab)

The Problem

Company fundamentals like EPS, P/E, and P/B are widely used for valuation, but their relationships to each other and to sector context aren't always intuitive. This project set out to quantify those relationships across the full S&P 500 rather than rely on rules of thumb.

Approach

  1. 01Collected and cleaned fundamentals data (EPS, P/E, P/B, dividends, volatility) across S&P 500 constituents.
  2. 02Ran correlation analysis between valuation metrics — including EPS vs. market cap and P/E vs. EPS — to surface which relationships actually hold across the index.
  3. 03Broke results down by sector to see how valuation relationships shift across industries, rather than treating the S&P 500 as one homogeneous group.
  4. 04Visualized findings with Matplotlib scatter and correlation plots for interpretability.

Visuals

Correlation matrix heatmap of S&P 500 financial metrics including Price, P/E, EPS, Dividend Yield, Market Cap, EBITDA, P/S, and P/B
Correlation matrix across core valuation metrics — Market Cap and EBITDA correlate at 0.90.
Box plot showing EPS distribution by sector across the S&P 500, with Financials showing the highest median and widest spread
EPS distribution by sector — Financials leads on both median and spread; overall median is $5.24.

Results

Market Cap and EBITDA are the strongest pair in the matrix at 0.90 correlation — largely mechanical, since EBITDA drives valuation.

EPS correlates with Price at 0.47 but only 0.08 with P/E — a stock's earnings power says almost nothing about how expensive it is relative to peers.

Financials had both the highest median EPS and the widest spread across companies; Real Estate the lowest and most compressed.

Overall median EPS across the index sits at $5.24, with big dispersion by sector rather than a single 'typical' company.

Reflection

This project was a reminder that treating an index like the S&P 500 as one uniform group hides a lot of signal — the same valuation relationship can look completely different once you slice by sector.