Table of Contents
What Is McNemar's Test?
McNemar's test is a non-parametric statistical test used to determine whether there is a significant difference between paired proportions. It is applied to 2x2 contingency tables with matched-pair data, such as before-and-after studies or comparing two diagnostic tests on the same subjects.
The test focuses on the discordant pairs (cells b and c) where the two measurements disagree. Under the null hypothesis, the number of discordant pairs should be equally split between the two types of disagreement.
Formula
The test statistic follows a chi-squared distribution with 1 degree of freedom. The continuity correction (-1 in the numerator) is recommended when b + c is small.
When to Use McNemar's Test
| Scenario | Example |
|---|---|
| Before/After | Treatment response before vs after intervention |
| Paired Tests | Comparing two diagnostic tests on same patients |
| Matched Cases | Twin studies with binary outcomes |
Frequently Asked Questions
What are discordant pairs?
Discordant pairs are cases where the two measurements disagree: one is positive and the other is negative. These are represented by cells b and c. Concordant pairs (cells a and d) do not contribute to the test statistic.
When should I use the continuity correction?
The continuity correction is recommended when the total number of discordant pairs (b + c) is small (typically less than 25). For large samples, the correction has minimal effect.
What if b + c is very small?
When b + c is less than 25, consider using the exact binomial test instead. Test whether b follows a binomial distribution with n = b + c and p = 0.5.