[Durgical](https://durgical.com/en/) › [DurgiPedia](https://durgical.com/en/durgipedia/) › [Epidemiology](https://durgical.com/en/epidemiology/) › [Biostatistics](https://durgical.com/en/epidemiology/areas/stats/) › McNemar test

# McNemar test

- Statistical test

It compares two proportions measured in the same people (before and after) or in matched pairs. Only the pairs that change count.

Updated Nov 5, 2026

## Key points

- For paired proportions; the usual χ² does not apply because the observations are not independent.
- It uses only the discordant pairs: b (yes → no) and c (no → yes).
- McNemar χ² = (b − c)² / (b + c), with 1 degree of freedom; critical value 3.84 at α = 0.05.
- Continuity-corrected version: (|b − c| − 1)² / (b + c).
- With few discordant pairs the exact (binomial) version is used.
- In 1:1 matched case-control studies, OR = b / c (pairs where only the case was exposed / pairs where only the control was exposed).

## What it is

The McNemar test compares paired proportions: the same binary outcome measured twice in the same people, two diagnostic tests applied to the same patients, or matched cases and controls. Pairs that agree (yes-yes, no-no) say nothing about change; the test uses only the discordant pairs and compares how many change one way against the other.

## When to use it

- A binary outcome measured twice in the same people (before and after).
- Two diagnostic tests applied to the same patients.
- One-to-one matched case-control studies.

## Worked example

- Data: 100 smokers receive counselling; smoking is recorded before and 6 months later.
- 50 still smoke; 20 quit (b); 5 started or went back to smoking (c); 25 did not smoke at either time.
- The 50 + 25 = 75 concordant pairs are not used in the test.
- χ² = (20 − 5)² / (20 + 5) = 225 / 25 = 9.0 with 1 df.
- It exceeds 3.84; p ≈ 0.003. With continuity correction: (15 − 1)² / 25 = 7.84; p ≈ 0.005.
- Share of smokers: before (50 + 20) / 100 = 70%; after (50 + 5) / 100 = 55%.
- Reading: the net shift toward quitting is larger than chance would explain; with no control group, it does not prove counselling caused it.

## The example’s paired table (the same 100 people)

| Before / after | After: smokes | After: does not smoke | Total |
| --- | --- | --- | --- |
| Before: smokes | 50 | 20 (b) | 70 |
| Before: does not smoke | 5 (c) | 25 | 30 |
| Total | 55 | 45 | 100 |

## Markers

- b
- c
- χ²
- discordant pairs

## Assumptions and pitfalls

- Applying the χ² test of independence to paired data.
- Including the concordant pairs in the calculation.
- Using the large-sample version with very few discordant pairs (use the exact one).

## Memory aid

‘Only the side-switchers count’: McNemar ignores those who answered the same both times.

## Test yourself

Think of the answer, then tap the question to see it.

## When is the McNemar test used?

To compare two paired proportions: a binary outcome measured twice in the same people, or in matched pairs.

## Which cells of the table does the test use?

Only the discordant pairs (b and c); concordant pairs carry no information about change.

## With b = 12 and c = 4, what is the uncorrected McNemar χ²?

(12 − 4)² / (12 + 4) = 64 / 16 = 4.0, above 3.84: significant at α = 0.05.

## In a 1:1 matched case-control study, how is the OR calculated?

As b / c: pairs where only the case was exposed divided by pairs where only the control was exposed.

[Add to my cards (4)](https://durgical.app/estudiar/?add=/en/epidemiology/mcnemar-test/)

## Connections

## Related 4

- [Chi-square test](https://durgical.com/en/epidemiology/chi-square-test/)
- [Choosing a statistical test](https://durgical.com/en/epidemiology/choosing-a-statistical-test/)
- [Nested case-control study](https://durgical.com/en/epidemiology/nested-case-control-study/)
- [Student's t test](https://durgical.com/en/epidemiology/student-s-t-test/)

[← All of epidemiology](https://durgical.com/en/epidemiology/)

Educational content on epidemiological and statistical methods; the examples use made-up numbers to teach the calculation. Not a clinical or legal guide: current Colombian rules are in the official sources.

Sources: [How can we compare the results of classifying according to several categories?](https://www.itl.nist.gov/div898/handbook/prc/section4/prc45.htm) (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012); [What are statistical tests?](https://www.itl.nist.gov/div898/handbook/prc/section1/prc13.htm) (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012).

## **Spotted a mistake?** We are always improving for the community. Tell us what is wrong and our team will review it. Report a mistake

Representative model, for educational purposes only.

---
Source: https://durgical.com/en/epidemiology/mcnemar-test/
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite as: DurgiPedia (durgical.com), https://durgical.com/en/epidemiology/mcnemar-test/
