All tools

McNemar test

McNemar compares a yes/no variable measured twice on the same people: for example, how many passed before and after a workshop, or how many knew a brand before and after a campaign. Fill in the table with how many people gave each combination.

After
BeforeYesNo
Yes
No

Each cell is a number of people. Highlighted cells are the ones who changed their answer.

The calculation runs in your browser. We don’t store what you type.

How it’s calculated

Only the people who changed count: b (yes → no) and c (no → yes). People who answered the same both times carry no information about change.

Continuity-corrected chi-square: χ² = (|b − c| − 1)² / (b + c), with 1 degree of freedom.

Exact p comes from the binomial distribution with b + c cases and probability .5. SPSS reports it for 2 × 2 tables, and it’s the one to use when b + c is 25 or less.

The odds ratio c / b tells you how many times more common one change was than the other.

How to read the result

  • p < .05: the percentage of “yes” changed significantly between the two measurements.
  • Report the percentage of “yes” before and after so the direction of change is clear.
  • If almost nobody changed (b + c very small), the test can’t detect differences even if they exist.

In the glossary: p-value · Effect size · Parametric and non-parametric tests

Step-by-step guideWhich statistical test to use in your thesis: a decision-tree guideHow to choose your thesis’s statistical test: decision tree, table of parametric and non-parametric tests and common mistakes. With a free test selector.

Frequently asked questions

Does it match SPSS?
Yes. Under Analyze > Descriptive Statistics > Crosstabs > Statistics > McNemar, SPSS gives the exact binomial p. Under Nonparametric Tests > 2 Related Samples it gives the corrected chi-square with many cases.
McNemar or chi-square?
The chi-square test of independence is for different people in each group. If they are the same people measured twice, use McNemar.
What if I have three or more measurements?
With yes/no answers at three or more points in time, use Cochran’s Q.

Know what you want to ask?

Build the survey in SurvIQ, share it by link, WhatsApp or QR code, and watch results come in live. The Free plan is free forever.

Create a free survey

More tools