McNemar's Test Calculator
Free McNemar's test calculator. Paired 2ร2 table, chi-square, exact binomial, odds ratio, continuity
Why This Statistical Analysis Matters
Why: Statistical calculator for analysis.
How: Enter inputs and compute results.
McNemar's Test โ Paired 2ร2 Tables
Before/after, matched pairs. Tests marginal homogeneity. Discordant pairs drive the test. Chi-square or exact binomial.
Real-World Scenarios โ Click to Load
2ร2 Paired Table
| After + | After โ | |
|---|---|---|
| Before + | ||
| Before โ |
Discordant Pairs Visualization (b vs c)
ฯยฒ(1) Distribution โ Rejection Region & p-value
Paired Table (Cell Counts a, b, c, d)
Calculation Breakdown
โ ๏ธFor educational and informational purposes only. Verify with a qualified professional.
Key Takeaways โ Paired Nominal Data
- โข 2ร2 paired table: Rows = Before (+/โ), Columns = After (+/โ). Cells a,b,c,d. Only discordant pairs (b, c) matter.
- โข McNemar's ฯยฒ (with correction): ฯยฒ = (|bโc|โ1)ยฒ / (b+c). df = 1.
- โข McNemar's ฯยฒ (no correction): ฯยฒ = (bโc)ยฒ / (b+c).
- โข Exact binomial: Under Hโ, b ~ Binomial(b+c, 0.5). p-value = 2รP(X โค min(b,c)). Preferred when b+c is small.
- โข Odds ratio (discordant): OR = b/c. 95% CI: exp(ln(OR) ยฑ 1.96รโ(1/b + 1/c)).
- โข Interpretation: Significant result means the treatment/intervention changed the outcome proportions.
Did You Know?
Formulas
ฯยฒ = (|b โ c| โ 1)ยฒ / (b + c)
With continuity correction (Edwards)
ฯยฒ = (b โ c)ยฒ / (b + c)
Without correction
OR = b / c
Odds ratio (discordant pairs)
95% CI: exp(ln(OR) ยฑ 1.96 ร โ(1/b + 1/c))
Woolf method
Frequently Asked Questions
When to use McNemar vs chi-square?
McNemar: paired/matched data (same subjects, two time points or two conditions). Chi-square: independent groups.
When to use exact test?
When b+c is small (e.g., < 25). Exact binomial gives accurate p-values; chi-square can be unreliable.
What does continuity correction do?
Subtracts 1 from |bโc| to improve the chi-square approximation. Often used for small samples.
How to interpret the odds ratio?
OR = b/c. OR > 1 means more changed from + to โ than โ to +. OR < 1 means the opposite.
What is Hโ?
Hโ: marginal proportions are equal โ P(Before +) = P(After +), i.e., b = c on average.
McNemar vs Chi-Square Independence
Chi-square test of independence assumes two independent samples. McNemar assumes paired data โ same subjects measured twice. Using chi-square on paired data inflates the test statistic and gives incorrect p-values. Always use McNemar for before/after or matched designs.
Official Data Sources
Disclaimer: McNemar's test assumes paired data. Do not use for independent 2ร2 tables โ use chi-square or Fisher exact instead.