We believe math and science education should be free and accessible to everyone. Why education matters >

McNemar's Test Calculator

Enter a 2x2 table of matched pairs (before/after or two raters) to test whether the row and column marginal proportions are equal. McNemar's test focuses only on the discordant pairs.

What is McNemar's Test?

McNemar's test is used when you have paired binary data and want to determine if there is a significant change between two conditions. Common applications include before/after treatment studies and comparing two diagnostic tests on the same subjects.

Formula:

χ² = (b - c)² / (b + c)

Where b and c are the discordant pairs (subjects who changed status). Cells a and d (concordant pairs) do not enter the calculation.

With continuity correction (Edwards):

χ² = (|b - c| - 1)² / (b + c)

The corrected version is more conservative and recommended when the total number of discordant pairs is small.

The 2x2 Table:

After + After -
Before + a (+/+) b (+/-)
Before - c (-/+) d (-/-)

Odds Ratio:

The odds ratio for McNemar's test equals b/c and measures the direction and magnitude of change between conditions.

When to use McNemar's test:

  • Before/after treatment comparisons on the same subjects
  • Comparing two diagnostic tests applied to the same patients
  • Matched case-control studies
  • Any paired dichotomous outcome

Did this solve your problem?

Frequently Asked Questions

Search Calculators

Search across all calculator categories