Course contentsShow
← Data Science
Lesson 435 of 2,14511. Hypothesis Tests for Proportions and CategoriesFree lesson

McNemar's Test: Paired Categorical Data

Understand when to use McNemar's Test for analyzing matched pairs or repeated measures with binary outcomes.

McNemar's Test: Paired Categorical Data

What You'll Learn

You'll learn when to use McNemar's Test to analyze matched pairs or repeated measures with binary outcomes.

The Problem with Regular Chi-Squared for Paired Data

Imagine testing whether a training program changes employees' pass/fail performance on a certification exam. Each person takes the test before and after training. The Chi-Squared Test of Independence assumes observations are independent, but here each person contributes two related measurements. Using Chi-Squared would be wrong—you need a test designed for paired categorical data.

What McNemar's Test Does

McNemar's Test is specifically designed for situations where:

  • You have binary outcomes (yes/no, pass/fail, positive/negative)
  • The same subjects are measured twice (before/after, treatment A vs treatment B)
  • Or you have matched pairs of subjects (twins, spouses, matched controls)

Think of it like the paired t-test, but for categorical data instead of continuous measurements.

The Key Question

McNemar's Test focuses on disagreements between the two measurements. It asks: "Among people who changed their response, did significantly more change in one direction than the other?"

If 20 people went from Fail→Pass but only 3 went from Pass→Fail, that asymmetry suggests a real effect. McNemar's Test determines if this imbalance is statistically significant or could happen by chance.

Common Applications

  • Before/after intervention studies (smoking cessation, symptom presence)
  • Comparing two diagnostic tests on the same patients
  • Evaluating change in opinion after an event
  • Matched case-control studies with binary outcomes

Key Takeaway: Use McNemar's Test when you have paired or matched binary categorical data—it's the correct alternative to Chi-Squared when observations aren't independent.