STATISTICSInference & TestsStatistics Calculator
๐Ÿ“Š

McNemar's Test Calculator

Free McNemar's test calculator. Paired 2ร—2 table, chi-square, exact binomial, odds ratio, continuity

Run CalculatorExplore data analysis and statistical calculations

Why This Statistical Analysis Matters

Why: Statistical calculator for analysis.

How: Enter inputs and compute results.

ฯ‡ยฒ
PAIRED NOMINAL DATAInference & Tests

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 โˆ’
mcnemar_results.sh
CALCULATED
$ mcnemar --table="45,12,8,35" --correction= --exact=
Decision
FAIL TO REJECT
p-value
0.8585
Method
Chi-square with continuity correction
Discordant pairs
20
ฯ‡ยฒ statistic
0.4500
df = 1
Odds ratio (b/c)
1.5000
95% CI: [0.613, 3.670]
Share:
McNemar's Test Result
Paired 2ร—2 Table
p = 0.8585
Not significantฯ‡ยฒ = 0.450Discordant: 20
numbervibe.com/calculators/statistics/mcnemar-test-calculator

Discordant Pairs Visualization (b vs c)

ฯ‡ยฒ(1) Distribution โ€” Rejection Region & p-value

Paired Table (Cell Counts a, b, c, d)

Calculation Breakdown

TABLE SUMMARY
Discordant pairs (b + c)
20
12 + 8 = 20
Concordant pairs (a + d)
80
45 + 35 = 80
Total N
100
a + b + c + d
CHI-SQUARE TEST
Method
Chi-square (Edwards correction)
ฯ‡ยฒ statistic
0.4500
(|12โˆ’8|โˆ’1)ยฒ/(12+8) = 0.4500
df
1
ext{Always} 1 ext{for} 2 imes 2 ext{McNemar}
p-value
0.8585
1 - F_ฯ‡^{2}(ฯ‡^{2}, 1)
DECISION
FAIL TO REJECT Hโ‚€ (not significant)
EFFECT SIZE
Odds ratio (b/c)
1.5000
12/8
95% CI for OR
[0.6131, 3.6696]
\text{exp}(\text{ln}( ext{OR}) pm 1.96 imes โˆš(1/b + 1/c))

โš ๏ธ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?

๐Ÿ”—McNemar's test is for paired/matched data โ€” same subjects measured twice. Not for independent groups.Source: McNemar 1947
๐Ÿ“ŠOnly discordant pairs (b and c) contribute to the test. Concordant pairs (a, d) are ignored.Source: Agresti
๐ŸงชCommon in before/after studies, diagnostic test comparison, crossover trials.Source: NIST Handbook
๐Ÿ“ฑA/B tests with same users (pre/post) should use McNemar, not chi-square for independence.Source: Best practice
โš ๏ธWhen b+c < 25, use exact binomial test. Chi-square approximation may be unreliable.Source: Agresti
๐Ÿ“Edwards' continuity correction subtracts 1 from |bโˆ’c| to improve approximation.Source: Edwards 1948

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.

Disclaimer: McNemar's test assumes paired data. Do not use for independent 2ร—2 tables โ€” use chi-square or Fisher exact instead.

๐Ÿ‘ˆ START HERE
โฌ…๏ธJump in and explore the concept!
AI