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.

Free tutorialPro practiceAbout 5 minutes7 practice questions

Quick answer: When should you use Fisher's exact test or McNemar's test in SPSS?

  1. Click Analyze › Descriptive Statistics › Crosstabs and add your two variables.
  2. For Fisher’s exact test, read the Fisher’s Exact Test row (SPSS adds it for 2 × 2 tables).
  3. 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.

Last updated November 2026 · Not sure this is the right test? Try the Which statistical test? tool.

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

Fisher's exact test

With small samples the chi-square test becomes unreliable. For a 2 × 2 table SPSS adds Fisher’s exact test automatically.

Output1 [Document1] – SPSS Statistics Viewer
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp
Output
Log
Crosstabs
Crosstabulation
Chi-Square Tests
group * improved Crosstabulation · Count
ImprovedNot improvedTotal
Treatment91110
Control3710
Total12820
Chi-Square Tests
ValuedfAsymp. Sig.
(2-sided)
Exact Sig.
(2-sided)
Exact Sig.
(1-sided)
Pearson Chi-Square7.500a1.006
Continuity Correction5.2081.022
Fisher's Exact Test.0202.010
N of Valid Cases20

3a. 2 cells (50.0%) have expected count less than 5. The minimum expected count is 4.00.

  1. 1
    Small cellsOnly 20 people, and some cells have very few in them.
  2. 2
    Fisher's Exact TestUse the two-sided exact p: .020. Treatment patients were more likely to improve.
  3. 3
    The footnoteHalf the cells have expected counts below 5, well over the 20% limit, so the Pearson chi-square p (.006) isn’t trustworthy.

McNemar's test

McNemar compares two yes/no measurements from the same people, such as pass or fail before and after a workshop.

Output1 [Document1] – SPSS Statistics Viewer
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp
Output
Log
Crosstabs
Crosstabulation
Chi-Square Tests
before * after Crosstabulation · Count
beforeafter: Failafter: PassTotal
Fail1014124
Pass421216
Total142640
Chi-Square Tests
ValueExact Sig. (2-sided)
McNemar Test.031b3
N of Valid Cases40

b. Binomial distribution used.

  1. 1
    Changed to pass14 students failed before and passed after.
  2. 2
    Changed to fail4 students went the other way. McNemar only uses these changers; people who stayed the same don’t count.
  3. 3
    Exact Sig..031 is below .05, so significantly more students improved than got worse. Tick McNemar in Crosstabs › Statistics.

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.

More in Categories and non-parametrics