Icon

final project

Analysis

  • XLE

  • XLK

  • Volatility

  • CPI

Preprocessing

30 days return and spread

  • Spread > 0 = XLE (Energy) beat XLK (Tech) over that 30-day window

  • Spread < 0 = XLK (Tech) beat XLE (Energy)

  • Spread = 0 = they performed identically

Link to CPI event

  • CPI release dates are calendar dates — they don't align row-for-row with the price table

  • Needed a way to find "the price 30 trading days after this CPI release" using calendar dates

  • Why 42: 30 trading days = 6 trading weeks → 6 × 7 calendar days/week = 42 calendar days (converts trading-day count into a calendar-day shift)

  • Shifted each CPI release date +42 days, then joined that shifted date to the price table's Date column — this lines up each CPI event with the return that ends ~30 trading days later

The math:

  • A trading week = 5 days (Mon–Fri)

  • A calendar week = 7 days

  • So 30 trading days ÷ 5 days/week = 6 weeks

  • 6 weeks × 7 calendar days/week = 42 calendar days

  • In normal months, XLE slightly beats XLK on average (+0.8%)

  • In surprise months (hot CPI), XLE actually underperforms XLK by 3.1% on average

  • Hot CPI surprises don't push Energy (XLE) ahead of Tech (XLK) like expected — actually the opposite happens

  • In surprise months, Tech outperforms Energy by ~3-4 percentage points on average

  • This contradicts the common "inflation hurts tech, helps energy" narrative

  • Possible reasons: tech's AI-driven earnings growth offset rate fears; energy is driven more by oil supply/OPEC than CPI

  • p-value = 0.336 — far above the standard 0.05 threshold → the difference is NOT statistically significant

  • The 95% confidence interval (−0.045 to 0.124) includes zero — meaning we cannot rule out "no real difference" between surprise and normal months

  • In plain terms: the −3.1% vs +0.8% gap you saw earlier could plausibly just be random noise, not a real pattern

This is your key results table — let's read it carefully.

Group Mean Spread Std Dev Count Normal months (Flag=0) +0.008 (0.8%) 0.106 44 Surprise months (Flag=1) −0.031 (−3.1%) 0.120 11


This is the opposite of what your hypothesis predicted.

Your original question expected: when CPI surprises to the upside, XLE should outperform XLK (positive spread). Instead, you're finding:

  • In normal months, XLE slightly beats XLK on average (+0.8%)

  • In surprise months (hot CPI), XLE actually underperforms XLK by 3.1% on average

This is a genuinely interesting finding — it contradicts the simple "inflation surprise → rotate into energy" story. A few honest possible explanations to discuss in your report:

  1. Small sample — only 11 surprise months out of 55. One or two extreme observations could be swinging this a lot.

  2. Tech resilience — in 2021–2025, mega-cap tech (driving XLK) may have been resilient to rate fears due to strong earnings, especially AI-driven names.

  3. Energy-specific drivers — oil price swings (OPEC decisions, geopolitical shocks) may dominate XLE more than CPI surprises do.

Excel Reader
Excel Reader
Row Filter
Excel Reader
String to Date&Time
Sorter
String Manipulation
Lag Column
Math Formula
Joiner
Math Formula
Lag Column
Math Formula
GroupBy
Independent groups t-test
Date Shifter
Joiner
String Manipulation
String to Date&Time
Sorter
Excel Reader
String to Date&Time
Sorter
Math Formula
Math Formula
String Manipulation
String to Date&Time

Nodes

Extensions

Links