Deeper Dive · Methodology Supplement
The Sports Page
Where the math lives
Supplement to Issue No. 24 The Phi-Coefficient Search For readers who want the math

How We Found the S&P 500 / Mets Spurious Correlation

The companion piece to Issue #24, “Want to Know If the Mets Lost? Check the S&P 500.” The article is a joke. The method behind it is serious: a phi coefficient for six teams’ win-loss records against the market’s daily direction, with the strongest one reported. A free lesson in why the best of several searches always looks better than it is.
Methodology Supplement · Issue #24 · Originally published April 21, 2026
The Idea

Why any two yes-or-no records can look like a relationship

Take any two yes-or-no records over the same days — coin flips, the market up or down, a team’s wins and losses — and one number, the phi coefficient, measures how closely one tracks the other. Phi runs from −1 (always opposite) through 0 (unrelated) to +1 (always together). Over 13 days, two records that have nothing to do with each other still wander off zero: a typical miss is about 0.29 either way.

Now test several teams and report the strongest. The best of six is not a typical draw; it is the most extreme one you found. That is the multiple-comparisons trap, and it is the engine behind every “Bears win, market falls” column you have ever read.

How this is commonly misread. Spurious correlations get told as cute coincidences. The real story is the search. Test enough candidates and something always looks “significant”: test 30 teams at the usual 5% bar and you get at least one false alarm about 79 times in 100. The phi is real arithmetic. The implied cause is not.

Issue #24 is a joke piece, but the joke does real teaching work. It said plainly that we tested six teams against the S&P 500 over the same 16 trading days and reported the strongest. Most columns like it hide the search. We named it.

The Math

The phi coefficient and why running it six times finds something

For two yes-or-no records (X, Y) over n days, build the 2×2 table:

Y = 1Y = 0Row sum
X = 1aba+b
X = 0cdc+d
Col suma+cb+dn

The phi coefficient is:

φ = (ad − bc) / sqrt((a+b)(c+d)(a+c)(b+d))

It is the ordinary correlation between two 0/1 variables. When the two are unrelated, its spread is about 1/sqrt(n). For the Mets’ 13 matched days, that is about 0.28; simulation of the actual setup gives 0.29.

Now run it for six teams against the S&P 500 over the 16 trading days from March 26 to April 17 (12 or 13 game days per team) and keep the largest, whatever its sign. Simulating six teams with no connection to the market at all:

Largest |φ| of 6 unrelated teams, on average ≈ 0.47 Chance the largest reaches 0.57 or more ≈ 23 in 100

So even with no real relationship anywhere, a search like ours turns up a phi as strong as the Mets’ almost one time in four. The right reading of “phi = −0.57, best of six” is “the most extreme result of a small search”, not “a connection.”

Worked example: the actual Mets vs. S&P run

Over the 16 trading days from March 26 to April 17, the Mets played on 13. They went 3–10 on those days; the S&P 500 rose on 10 of them and fell on 3.

S&P upS&P down
Mets win1 (a)2 (b)
Mets loss9 (c)1 (d)
Phi: (1×1 − 2×9) / sqrt((1+2)(9+1)(1+9)(2+1))  =  −17 / sqrt(900)  =  −17 / 30  =  −0.57
Was this the largest of the six? Yes. The next was the Braves at −0.30.
One more catch. The issue called this “p < 0.05”, from a chi-square test. That test needs about five days expected in every cell; the Mets-win, market-down cell expects fewer than one. Fisher’s exact test, made for tables this small, gives p = 0.11.
A phi of −0.57 looks impressive. Across six teams, pure noise gets that far about 23 times in 100, and the exact test does not clear the 5% bar. We found nothing like a market signal.
The Code

Phi across six teams, and what noise would do

The full script, scripts/spurious-correlation.py, holds each day’s market direction and each team’s result, keyed by date, and keeps only the days that have both. This sample runs on that data, adds the exact test, and simulates what an unrelated team would produce.

import importlib.util, math, io, contextlib
import numpy as np
from scipy.stats import fisher_exact

# Load the issue's data (dates -> 1/0) without printing its report
spec = importlib.util.spec_from_file_location("sc", "scripts/spurious-correlation.py")
sc = importlib.util.module_from_spec(spec)
with contextlib.redirect_stdout(io.StringIO()):
    spec.loader.exec_module(sc)

def table(team, market):
    days = sorted(set(team) & set(market))       # game days the market was open
    a = sum(team[d] == 1 and market[d] == 1 for d in days)
    b = sum(team[d] == 1 and market[d] == 0 for d in days)
    c = sum(team[d] == 0 and market[d] == 1 for d in days)
    d_ = sum(team[d] == 0 and market[d] == 0 for d in days)
    return a, b, c, d_

def phi(a, b, c, d):
    den = math.sqrt((a+b) * (c+d) * (a+c) * (b+d))
    return (a*d - b*c) / den if den else 0.0

for name, games in sc.teams.items():
    a, b, c, d = table(games, sc.sp500)
    p = fisher_exact([[a, b], [c, d]])[1]
    print(f"{name:22s} phi {phi(a, b, c, d):+.2f}   exact p {p:.2f}")
# New York Mets  phi -0.57  exact p 0.11 ... next largest: Braves -0.30

# What six unrelated teams produce: coin-flip results on 13 days, market up 10 of 13
rng = np.random.default_rng(1)
mkt = [1] * 10 + [0] * 3
best = []
for _ in range(20_000):
    sims = []
    for _ in range(6):
        x = rng.integers(0, 2, 13)
        a = sum(xi == 1 and m == 1 for xi, m in zip(x, mkt))
        b = sum(xi == 1 and m == 0 for xi, m in zip(x, mkt))
        c = sum(xi == 0 and m == 1 for xi, m in zip(x, mkt))
        d = sum(xi == 0 and m == 0 for xi, m in zip(x, mkt))
        sims.append(abs(phi(a, b, c, d)))
    best.append(max(sims))
best = np.array(best)
print(f"average best |phi|: {best.mean():.2f}")            # about 0.47
print(f"best reaches 0.57: {(best >= 0.567).mean():.0%}")  # about 23%
The data lives in scripts/spurious-correlation.py: six teams’ game-by-game results and the S&P 500’s daily direction, March 26 to April 17, 2026. Run this from the repository’s top folder.

To run it on a different pair of records: swap in any two yes-or-no records keyed by date. Then be honest, like the article was, about how many candidates you tested — and run the noise simulation with that many.

Caveats and known limitations


Read the article that uses this analysis: Want to Know If the Mets Lost? Check the S&P 500. →