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.
Use the McNemar Test Calculator
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
Only cells b and c (the discordant pair) drive the test statistic.
Fill in the table and click Run Test to see results.
Discordant Pair Summary
Marginal Proportions
Formula applied
Summary
McNemar's test checks whether the marginal frequencies of two binary outcomes are equal in paired or matched samples — for example, before-and-after measurements on the same subjects. It focuses only on the discordant cells (the off-diagonal counts where the two measurements disagree) and asks whether one direction of change is significantly more common than the other. A small p-value (typically below 0.05) means the proportions have changed significantly between the two conditions.
How it works
- Label your two conditions (e.g., Before / After or Test A / Test B).
- Fill in the four cells: how many subjects went from Yes→Yes, Yes→No, No→Yes, and No→No.
- Choose a significance level (default 0.05) and whether to apply the continuity correction.
- Click "Run Test" — the tool reads the discordant cells b (Yes→No) and c (No→Yes).
- McNemar's statistic χ² = (|b − c| − correction)² / (b + c), with 1 degree of freedom.
- 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.