Calculator Inputs
Example Data Table
This sample shows paired classifications for the same subjects measured twice.
| Before \ After | After Positive | After Negative | Row total |
|---|---|---|---|
| Before Positive | 52 | 9 | 61 |
| Before Negative | 17 | 34 | 51 |
| Column total | 69 | 43 | 112 |
Here, the discordant cells are b = 9 and c = 17. McNemar’s test focuses on those two cells because they represent the actual paired changes.
Formula Used
χ² = (b − c)² / (b + c)
χ² = (|b − c| − 1)² / (b + c)
n = b + c, with success probability 0.5 under the null hypothesis.
p = 2 × Σ [ C(n, x) × 0.5ⁿ ] for x = 0 to min(b, c)
OR = b / c
Confidence interval is computed on the log scale and exponentiated back.
McNemar’s test evaluates marginal homogeneity in a paired 2×2 table. It is best for before-after studies, matched case-control designs, and paired classifier comparisons with binary outcomes.
How to Use This Calculator
- Enter labels for the first and second assessments.
- Fill the four paired counts a, b, c, and d.
- Choose your primary decision method and alpha level.
- Select a confidence level for the matched odds ratio.
- Click Calculate McNemar Test.
- Review the p-values, odds ratio, confidence interval, and chart.
- Use CSV for spreadsheet work and PDF for reporting.
Frequently Asked Questions
1. What does McNemar’s test measure?
It checks whether paired binary outcomes changed symmetrically. The test ignores concordant pairs and compares only the discordant cells, b and c.
2. When should I use the exact version?
Use the exact binomial method when discordant pairs are few. It is more reliable than the asymptotic approximation for small samples.
3. Why are cells a and d not central to the test?
They are concordant pairs, so they show no change between measurements. McNemar’s logic depends on the imbalance between b and c.
4. What does the matched-pairs odds ratio mean?
It summarizes directional change. Values above 1 indicate more b transitions than c transitions, while values below 1 indicate the reverse.
5. Can I use this for independent samples?
No. McNemar’s test requires paired observations from the same subjects, matched subjects, or repeated binary classifications.
6. What if b and c are both zero?
There are no discordant pairs, so no observed change exists. The calculator returns p = 1.0000 and shows no evidence of marginal difference.
7. Should I prefer corrected or uncorrected chi-square?
The corrected version is more conservative. Many analysts prefer it for moderate samples, while the exact method remains best for small discordant counts.
8. What kind of projects commonly use this test?
It is common in diagnostic studies, pre-post interventions, usability testing, classifier comparison, and matched case-control research with binary outcomes.