Unit 5 · Categories and non-parametrics
Fisher's exact test and McNemar's test in SPSS
When to use Fisher's exact test instead of chi-square in SPSS, and how to run McNemar's test for before-and-after yes/no data.
Quick answer: When should you use Fisher's exact test or McNemar's test in SPSS?
- Click Analyze › Descriptive Statistics › Crosstabs and add your two variables.
- For Fisher’s exact test, read the Fisher’s Exact Test row (SPSS adds it for 2 × 2 tables).
- For McNemar, tick McNemar under Statistics… for two related yes/no variables.
Report it in APA style: More treatment patients improved (9 of 10) than controls (3 of 10), Fisher’s exact test, p = .020.
Fisher’s exact test and McNemar’s test
Both are tests for categorical data that handle situations chi-square can’t. Fisher’s exact test calculates the exact probability of a 2 × 2 table, so it works with small samples. McNemar’s test compares two yes/no measurements from the same people, such as pass/fail before and after a course.
When to use it
- Fisher: a 2 × 2 table where expected counts are too small for chi-square.
- McNemar: a binary outcome measured twice on the same people, or in matched pairs.
How it works
Fisher’s test works out every possible table with the same row and column totals and adds up the probabilities of those as extreme as yours, so it doesn’t rely on an approximation. McNemar ignores people who stayed the same and looks only at those who changed: if a course has no effect, as many should switch from fail to pass as from pass to fail.
Assumptions
- Fisher: independent observations; fixed totals (in practice widely used regardless).
- McNemar: paired observations and a two-category outcome.
Worked example
9 of 10 treated patients improved compared with 3 of 10 controls, Fisher’s exact test p = .020. Separately, 14 students went from fail to pass after a workshop and only 4 from pass to fail, McNemar p = .031.
Key terms
- Exact test
- Calculates the probability directly instead of approximating it.
- Discordant pairs
- People who changed category between the two measurements.
Common mistakes
- Reporting the Pearson chi-square when the expected-count footnote says it’s unreliable.
- Using a chi-square test of independence for before-and-after data from the same people.
How to do it in SPSS
The SPSS syntax
Prefer typing to clicking? Open File › New › Syntax, paste this in, select it and choose Run › Selection. Every dialog's Paste button writes the same kind of code.
* Fisher's exact test (fisher.sav). SPSS adds it automatically for 2 x 2 tables.
CROSSTABS
/TABLES=group BY improved
/STATISTICS=CHISQ
/CELLS=COUNT EXPECTED.
* McNemar's test (mcnemar.sav).
CROSSTABS
/TABLES=before BY after
/STATISTICS=MCNEMAR
/CELLS=COUNT.Practice data
Download the file used in this lesson and run it yourself in SPSS: you should get the same results as the screens above.
- fisher.savTreatment vs control and whether patients improved (N = 20)
- mcnemar.savPass or fail before and after a workshop (N = 40)
Now practise it interactively →
Reading is only half of it. Tap through the real SPSS menus, read the output and pick the right write-up in 7 quick questions, with instant feedback on every answer.
Practice for this lesson is part of Pro, with every unit, unlimited hearts and saved progress.