McNemar's Test Calculator

Perform McNemar's test for paired nominal data. Determine if there is a significant difference between two related proportions using a 2x2 contingency table.

CHI-SQUARE STATISTIC
--
P-Value
--
Decision (α=0.05)
--
Discordant Pairs
--
Exact (b+c)
--

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

χ² = (|b - c| - 1)² / (b + c)
Without continuity correction: χ² = (b - c)² / (b + c)

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

ScenarioExample
Before/AfterTreatment response before vs after intervention
Paired TestsComparing two diagnostic tests on same patients
Matched CasesTwin 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.