Advanced McNemar Test Calculator

Analyze matched before after outcomes with confidence. Review chi square tests, odds ratios, and assumptions. Download clean summaries, charts, and tables for faster decisions.

McNemar Test Calculator

Input guide

Enter paired counts from a 2×2 table. The test uses only discordant pairs B and C.

Example Data Table

After Positive After Negative Total
Before Positive 42 12 54
Before Negative 5 31 36
Total 47 43 90

This example has 17 discordant pairs. Because B and C differ, the test checks whether the paired proportions changed after the intervention.

Formula Used

Uncorrected McNemar statistic: χ² = (B − C)² / (B + C)

Continuity corrected statistic: χ² = (|B − C| − 1)² / (B + C)

Exact option: The calculator also reports the two sided exact binomial p value using the discordant total B + C and probability 0.5.

Matched odds ratio: OR = B / C when both discordant cells are above zero.

The null hypothesis states that the discordant probabilities are equal. That means B and C should be similar if no paired change exists.

How to Use This Calculator

  1. Build a paired 2×2 table from the same subjects measured twice.
  2. Enter counts for A, B, C, and D.
  3. Choose an alpha level.
  4. Keep continuity correction on for conservative asymptotic testing.
  5. Enable the exact option when discordant counts are small.
  6. Press the calculate button.
  7. Review the result section above the form.
  8. Download the result as CSV or PDF if needed.

About This McNemar Test Calculator

Why the McNemar test matters

The McNemar test is built for paired nominal data. It is often used with before and after studies. It also fits matched case designs. The method checks whether a binary outcome changed across two linked measurements. It does not treat the observations as independent. That is why it is different from a standard chi square test.

What the calculator evaluates

This calculator starts with the classic 2×2 table. Cell A holds pairs that stayed positive. Cell D holds pairs that stayed negative. Cell B shows a change from yes to no. Cell C shows a change from no to yes. The McNemar statistic uses only B and C. Concordant counts still matter for totals and context, but not for the core test statistic.

When exact testing helps

Small discordant totals can make asymptotic results less stable. That is why this page also reports an exact binomial p value. The exact method focuses on the imbalance between B and C under a null probability of one half. Many analysts prefer this option when discordant pairs are limited. The continuity corrected statistic is also shown for a more conservative large sample approximation.

How to interpret the output

Start with the selected p value. Compare it with the chosen alpha level. A smaller p value suggests evidence of change in paired proportions. Next, review the discordance rate and positive shift. These values explain how much movement occurred. The matched odds ratio adds direction when both discordant cells are nonzero. Use the chart and tables to report results clearly in audits, medical studies, survey comparisons, quality control reviews, and intervention tracking.

Common use cases

The calculator supports many practical settings. Clinicians can compare symptom status before and after treatment. Researchers can study paired diagnostic outcomes. Survey teams can test whether respondents changed a yes or no answer over time. Quality teams can compare pass and fail results before and after process updates. Education teams can assess paired mastery checks. Any design with the same subject measured twice can benefit from this approach.

Reporting tips

Good reporting should show the four cell counts, the discordant total, the selected method, and the p value. It is also helpful to mention whether continuity correction or exact testing was used. Include a short interpretation in plain language. State whether the paired proportions changed. When relevant, report the matched odds ratio and the direction of change. Clear reporting makes audits, manuscripts, and internal reviews easier to understand.

FAQs

1. What does the McNemar test measure?

It tests whether paired binary outcomes changed between two related measurements. The method compares discordant counts only, not the full table equally.

2. When should I use the exact option?

Use the exact option when the total discordant count is small. It avoids relying only on the large sample chi square approximation.

3. Why are cells A and D not in the main statistic?

A and D are concordant pairs. They show no within pair change. McNemar testing focuses on changes, so only B and C drive significance.

4. What is the null hypothesis?

The null hypothesis states that the probability of a yes to no change equals the probability of a no to yes change.

5. Can I use this for independent groups?

No. Independent groups need a different method, such as a standard chi square test or Fisher exact test, depending on the design.

6. What does a matched odds ratio above one mean?

It means B exceeds C. In practical terms, yes to no changes are more common than no to yes changes in discordant pairs.

7. What if B and C are both zero?

There are no discordant pairs. The data show no observed paired change. The test statistic becomes zero and the p value is one.

8. Can this support medical or survey reporting?

Yes. It is useful for pre and post treatment studies, matched diagnostics, repeated survey responses, and paired quality assessments.

Related Calculators

Mann-Whitney U Test CalculatorKruskal-Wallis H Test CalculatorKendall Tau Correlation CalculatorChi-Square Goodness of Fit CalculatorSign Test CalculatorKolmogorov-Smirnov One Sample Test CalculatorKolmogorov-Smirnov Two Sample Test CalculatorJonckheere-Terpstra Trend Test CalculatorFisher Exact Test CalculatorBinomial Sign Test Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.