AI ENGVisual Encyclopedia

MODULE 7: STATISTICAL RIGOR · SCENE 20

Paired Tests & McNemar

Same items, two models: compare the discordant pairs. Paired tests are sharper than two independent confidence intervals.

ONLY A RIGHT (b)30ONLY B RIGHT (c)10χ² · 9.03p ≈ 0.011
SAME ITEMS · ONLY THE DISCORDANT PAIRS TEST THE DIFFERENCEBOTH RIGHT40ONLY A (b)30ONLY B (c)10BOTH WRONG20χ² = (|3010|−1)²/(30+10) = 9.03SIGNIFICANT: A GENUINELY BEATS B HEREGRAY CELLS CARRY ZERO INFORMATION ABOUT THE DIFFERENCE

Two overlapping intervals can still hide a decisive paired result — pairing deletes the item-difficulty variance both models share.

TECHNICAL BREAKDOWNModule 7: Statistical Rigor

Paired tests compare models on the same items

When two models answer the same items, only the items where they disagree carry information about the difference. McNemar's test analyzes those discordant pairs, removing item-difficulty variance and producing a much sharper test than comparing two independent confidence intervals.

The 2×2 table

b = items only A got right, c = items only B got right. Concordant cells (both right, both wrong) add nothing.

McNemar statistic

χ² = (|b − c| − 1)² / (b + c), compared against a chi-square distribution with one degree of freedom.

Sharper by construction

Pairing removes the variance shared by the items, so the same n detects smaller differences.

MATHEMATICAL FORMULATION · MCNEMAR'S TEST
χ² = (|b − c| − 1)² / (b + c)

With b = 30 and c = 10, χ² = 19²/40 = 9.03, comfortably significant at p < 0.01. Comparing two independent 70%–62% intervals on the same items would likely find nothing.

REAL-WORLD PRODUCTION ENGINEERING
  • Paired bootstrap and McNemar are standard in NLP when comparing two systems on a shared test set.
  • Models run on identical item sets should always be analyzed with paired methods.