McNemar's Test Calculator
Enter counts from a 2×2 matched-pairs table to assess whether the marginal probabilities differ between paired conditions.
Total pairs: 89
Discordant pairs (b + c): 17
Chi-square (no correction): 2.8824
p-value (approx): 2.944790
Chi-square (continuity corrected): 2.1176
p-value (continuity): 2.212037
Exact binomial p-value: 0.143463
How to Use This Calculator
- Record paired outcomes in a 2×2 table and input the counts.
- Ensure that the off-diagonal counts (b and c) are not both zero.
- Review the chi-square statistic, continuity-corrected version, and exact p-value.
- Compare p-values with your significance level to assess whether marginal probabilities differ.
Formula
McNemar test statistic: χ² = (b − c)² / (b + c)
Continuity correction: χ²cc = (|b − c| − 1)² / (b + c)
Exact binomial p-value: 2 × Σk=0min(b,c) (n choose k) (0.5)n, where n = b + c
Full Description
McNemar's test evaluates paired nominal data, commonly from before/after studies or matched case-control designs. It examines whether the probability of a positive outcome differs between paired conditions by focusing on discordant pairs (b and c).
For small discordant counts, the exact binomial p-value is preferred. The chi-square approximation with continuity correction offers a quick alternative for larger samples.
Frequently Asked Questions
When should I use the exact p-value?
Use the exact test when discordant pairs are few (b + c ≤ 25) or when the approximation assumptions are questionable.
Why ignore diagonal cells a and d?
McNemar's test only considers discordant outcomes because concordant pairs do not provide evidence of change between conditions.
Is the test one-tailed or two-tailed?
The chi-square version is inherently two-tailed. The exact p-value reported here is also two-tailed.
Can I analyze more than two categories?
McNemar's test applies to binary outcomes. For multicategory data, consider the Cochran's Q test or marginal homogeneity tests.