McNemar Test Calculator

Enter the four cells of a 2×2 paired contingency table to compute McNemar's chi-squared statistic, p-value, and decide if marginal proportions differ.

2×2 Paired Contingency Table

After: Yes After: No
Before: Yes
a (Yes→Yes)
b (Yes→No)
Before: No
c (No→Yes)
d (No→No)

Table notation

aBoth measurements positive (concordant)
bPositive on Condition 1, negative on Condition 2 (discordant)
cNegative on Condition 1, positive on Condition 2 (discordant)
dBoth measurements negative (concordant)

Only cells b and c (the discordant pair) drive the test statistic.

Fill in the table and click Run Test to see results.

Summary

Enter the four cells of a 2×2 paired contingency table to compute McNemar's chi-squared statistic, p-value, and decide if marginal proportions differ.

How it works

  1. Label your two conditions (e.g., Before / After or Test A / Test B).
  2. Fill in the four cells: how many subjects went from Yes→Yes, Yes→No, No→Yes, and No→No.
  3. Choose a significance level (default 0.05) and whether to apply the continuity correction.
  4. Click "Run Test" — the tool reads the discordant cells b (Yes→No) and c (No→Yes).
  5. McNemar's statistic χ² = (|b − c| − correction)² / (b + c), with 1 degree of freedom.
  6. The p-value is read from the chi-squared distribution; the verdict tells you whether to reject the null hypothesis of equal marginals.

Use cases

  • Compare pass/fail rates on the same exam before and after a training intervention.
  • Test whether a medical treatment changes the proportion of positive diagnoses.
  • Evaluate whether two diagnostic tests disagree asymmetrically on the same patients.
  • Assess opinion change (agree/disagree) before and after an advertisement.
  • Measure whether a software UI change shifts task success rates for the same users.
  • Validate survey re-test consistency on binary yes/no questions.

Frequently Asked Questions

Last updated: 2026-06-11 · Reviewed by Nham Vu