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.
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.