Home · Statistics · Inference & Tests · McNemar's Test Calculator
McNemar's Test Calculator
McNemar's test for paired binary data: a chi-square statistic built only from the pairs that changed, with the standard continuity correction.
What this calculator does
McNemar's test for paired binary data: a chi-square statistic built only from the pairs that changed, with the standard continuity correction. Every figure on this page is computed from the standard definition stated below — the same definition used in textbooks and reference tables — with no hidden rounding steps, and the method notes name the exact convention where more than one exists.
The formula and method
Only the discordant pairs matter: b pairs that switched one way and c pairs that switched the other. Pairs that stayed the same carry no information about change.
The −1 is the continuity correction, standard for this test because the statistic is discrete but judged against the continuous chi-square distribution.
Compare the result with the chi-square distribution on 1 degree of freedom (3.84 at the 5% level). The approximation needs b + c reasonably large, roughly 25 or more.
Worked example
With the example inputs this page opens with (discordant pairs b (changed one way) 25, discordant pairs c (changed the other way) 9), the result is 6.6176. Change any figure and the result updates with the same formula.
Quick reference
| Discordant pairs b (changed one way) | Result |
|---|---|
| 20 | 3.4483 |
| 25 | 6.6176 |
| 50 | 27.1186 |
| 26 | 7.3143 |
| 27 | 8.0278 |
| 30 | 10.2564 |
Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.
Common questions
Why do the unchanged pairs not count?
McNemar's question is whether change runs one way more than the other. A pair that reads the same before and after is consistent with any balance of switching, so it cannot evidence a direction; only the b-versus-c imbalance can.
What if b + c is small?
Below roughly 25 discordant pairs the chi-square approximation is unreliable. The exact version treats b as binomial with p = 0.5 out of b + c trials and reports that exact probability instead.
How does the McNemar's Test Calculator work?
McNemar's test for paired binary data: a chi-square statistic built only from the pairs that changed, with the standard continuity correction. Discordant pairs b · Discordant pairs c → McNemar chi-square. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.
What inputs does the McNemar's Test Calculator need?
Discordant pairs b · Discordant pairs c → McNemar chi-square. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.