Exact McNemar's Test (small-sample binary paired)
VerifiedCategorical
Run this test straight away on a free built-in teaching dataset — no data of your own needed — or bring your own. Either opens the guided workspace: variable setup, assumption diagnostics, results with effect sizes and confidence intervals, figures, and APA-ready reporting.
Loading teaching datasets…
Or use your own dataset
Loading your datasets…
Exact binomial form of McNemar's paired-samples test for dichotomous outcomes.
Conditions on the discordant pair count b + c and tests whether b is drawn from Binomial(b + c, 0.5) under the null of no marginal change. Concordant pairs (both yes or both no) are uninformative and are conditioned out — power is driven entirely by b + c. Always valid; strictly preferred over the asymptotic χ² whenever b + c < 25 or when a defensible exact verdict is needed for regulatory / reviewer audiences. Reports the exact two-sided p plus the marginal-difference 95% CI.
Worked example
Did a paired binary outcome change, with few discordant pairs?
The exact McNemar test uses the exact binomial on discordant pairs — for when the χ² approximation is unsafe (small counts).
Support shifted: 9 no→yes versus 2 yes→no, exact p = .033.
An exact McNemar test showed a significant change (9 no→yes vs 2 yes→no), p = .033.
When to use it
- Small paired binary study (b + c < 25)A pilot evaluation of a training programme asks 18 employees to attempt a safety task before and after the programme.
- Diagnostic-test agreement (two tests on same patients)60 patients undergo both Test A and Test B for the same condition.
When NOT to — use instead
- Independent groups (different subjects per arm)Exact McNemar is paired by construction. → Two-Proportions Z-Test
- Multi-category paired outcome (k > 2)McNemar is restricted to 2×2. → Stuart-Maxwell / Bowker (paired k-category)
- Three or more related binary measurementsCochran's Q extends McNemar to ≥ 3 related binary outcomes. → Cochran's Q Test (repeated binary)
- Need covariate adjustment on paired outcomeMcNemar is unadjusted. → Binomial Logistic Regression \u2014 odds ratios + ROC AUC + classification
Hypotheses
Parameter tested: p₁ − p₂ (difference in marginal proportions) or equivalently b/(b+c) − 0.5
Assumptions (and what to do if they fail)
Check: Report b, c, and b + c.
If violated: All pairs are concordant (no change between measurements) — the test cannot detect a marginal shift.
Check: Report b + c; compare to the 25 guideline.
If violated: If b + c is large (≥ 25), the exact binomial and the continuity-corrected χ² agree closely; the exact form remains valid but the asymptotic form is also defensible.
Ready to run a Exact McNemar's Test (small-sample binary paired) on your own data?
Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.
Run this test →