# McNemar's Test Calculator

Perform McNemar's test for paired nominal data from a 2x2 table. Calculate chi-square statistic, p-value, and odds ratio for before/after studies.

## What this calculates

Enter a 2x2 table of matched pairs (before/after or two raters) to test whether the row and column marginal proportions are equal. McNemar's test focuses only on the discordant pairs.

## Inputs

- **Both Positive (+/+)** — min 0 — Both before and after are positive (or both raters agree positive).
- **Positive then Negative (+/-)** — min 0 — Positive before, negative after (or rater 1 positive, rater 2 negative).
- **Negative then Positive (-/+)** — min 0 — Negative before, positive after (or rater 1 negative, rater 2 positive).
- **Both Negative (-/-)** — min 0 — Both before and after are negative (or both raters agree negative).

## Outputs

- **McNemar's χ²** — The McNemar chi-square test statistic.
- **χ² with Continuity Correction** — Edwards' continuity-corrected McNemar statistic.
- **P-Value (uncorrected)** — P-value from chi-square distribution (1 df).
- **P-Value (corrected)** — P-value with continuity correction.
- **Odds Ratio (b/c)** — Ratio of discordant pairs.
- **Significant at α = 0.05?** — formatted as text — Whether the result is statistically significant.
- **Calculation** — formatted as text — Step-by-step McNemar computation.

## Details

**What is McNemar's Test?**

McNemar's test is used when you have paired binary data and want to determine if there is a significant change between two conditions. Common applications include before/after treatment studies and comparing two diagnostic tests on the same subjects.

**Formula:**

**χ² = (b - c)² / (b + c)**

Where b and c are the discordant pairs (subjects who changed status). Cells a and d (concordant pairs) do not enter the calculation.

**With continuity correction (Edwards):**

**χ² = (|b - c| - 1)² / (b + c)**

The corrected version is more conservative and recommended when the total number of discordant pairs is small.

**The 2x2 Table:**

|  | After + | After - |
|--|---------|---------|
| **Before +** | a (+/+) | b (+/-) |
| **Before -** | c (-/+) | d (-/-) |

**Odds Ratio:**

The odds ratio for McNemar's test equals b/c and measures the direction and magnitude of change between conditions.

**When to use McNemar's test:**

- Before/after treatment comparisons on the same subjects
- Comparing two diagnostic tests applied to the same patients
- Matched case-control studies
- Any paired dichotomous outcome

## Frequently Asked Questions

**Q: Why does McNemar's test only use the discordant pairs?**

A: The concordant pairs (both positive or both negative) provide no information about change between conditions. The question is whether the pattern of change is symmetric (equally likely to go from + to - as from - to +). Only the discordant pairs (b and c) are informative for this comparison.

**Q: When should I use the continuity correction?**

A: The continuity correction (Edwards' correction) is recommended when the total number of discordant pairs (b + c) is small, typically under 25. It makes the test more conservative. For large samples, the corrected and uncorrected results will be very similar.

**Q: How is McNemar's test different from the chi-square test of independence?**

A: The regular chi-square test is for independent observations. McNemar's test is specifically designed for paired (dependent) observations where the same subjects are measured twice. Using a regular chi-square test on paired data would violate the independence assumption and produce incorrect results.

---

Source: https://vastcalc.com/calculators/statistics/mcnemar
Category: Statistics
Last updated: 2026-04-08
