Calculateus

McNemar's Test Calculator

Test for a significant change in paired categorical data, such as before/after survey responses.

Result

McNemar's Chi-Square Statistic
3.38
Degrees of Freedom
1

The critical value at the common 95% confidence level (α = 0.05, df = 1) is 3.841. McNemar's test only uses the discordant (changed) pairs - subjects whose answer stayed the same in both directions don't affect the result.

About the McNemar's Test

McNemar's Test Calculator checks whether a binary outcome, measured on the same group of people or units twice, actually shifted between the two measurements. It is built for paired data, such as employees surveyed before and after a training program, or patients tested before and after a treatment, where each subject contributes one answer at each time point.

How It Works

You enter only the two "discordant" counts: subjects who switched from Yes to No, and subjects who switched from No to Yes. Subjects whose answer stayed the same in both directions are left out entirely, because they carry no information about a shift. The calculator converts those two counts into a chi-square statistic with 1 degree of freedom, which is then compared against a critical value to judge significance.

Chi-square = (|b - c| - 1)^2 / (b + c), where b is the Yes-to-No count and c is the No-to-Yes count. The "-1" is a continuity correction applied before squaring. Degrees of freedom is fixed at 1.

Examples

Employee survey

18 employees who said Yes before a policy change now say No, and 32 who said No now say Yes. Chi-square = (|18-32|-1)^2/(18+32) = 13^2/50 = 3.38, just under the 3.841 critical value at alpha = 0.05, so the shift falls short of significance at the 5% level.

Product satisfaction re-test

10 customers changed from satisfied to unsatisfied and 40 changed from unsatisfied to satisfied. Chi-square = (|10-40|-1)^2/(10+40) = 29^2/50 = 16.82, well above 3.841, indicating a statistically significant shift toward satisfaction.

Advantages

  • Isolates the actual change signal by ignoring subjects whose answer never moved, instead of diluting the test with unchanged responses.
  • Needs only two counts as input, so it can be calculated from a summary table without re-touching the raw paired dataset.
  • Applies a continuity correction automatically, the standard adjustment recommended for this test rather than a raw, uncorrected chi-square.

Common Mistakes

  • Feeding it the full 2x2 table totals (including the two concordant cells) instead of just the two discordant counts.
  • Using this test on independent groups measured once each, rather than the same subjects measured twice, which calls for a different test entirely.
  • Treating a result just under the 3.841 critical value as proof of "no effect," when it only means the specific sample did not clear the 5% significance threshold.

Edge Cases to Watch For

  • At least one discordant pair (b + c > 0) is required; if nobody switched in either direction, the calculator returns an error instead of dividing by zero.
  • Concordant pairs (same answer both times) never enter the formula at all, regardless of how large that group is.
  • The continuity correction subtracts 1 before squaring, which slightly lowers the statistic compared with tools that skip that adjustment, so results can look mismatched against sources that use the uncorrected version.
  • The chi-square approximation is a large-sample method; when b + c is small (commonly cited as under 25), an exact binomial version of McNemar's test is generally more reliable.

Common Use Cases

  • Researchers comparing before/after survey responses collected from the same panel of subjects.
  • Analysts evaluating whether a marketing or policy change shifted individual customer stances rather than just aggregate counts.
  • Clinical or behavioral studies tracking whether a binary status changed after an intervention in the same subjects.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

What is McNemar's test used for?

It tests whether there's a significant shift in a binary outcome measured on the SAME subjects at two points in time, such as before/after a campaign or intervention - unlike a standard chi-square test, it's specifically designed for paired (matched) categorical data rather than independent groups.

Conclusion

McNemar's test gives a focused answer to a specific question: did paired binary outcomes shift, based only on the subjects who actually changed. Because it uses just two discordant counts, it is a quick way to check for meaningful movement in repeated-measures categorical data without needing the full contingency table.