Unit 5 · Categories and non-parametrics

How to run a chi-square test in SPSS

Run a chi-square test of independence with Crosstabs in SPSS, check expected counts and report Cramér's V.

Free tutorialPro practiceAbout 5 minutes7 practice questions

Quick answer: How do you run a chi-square test in SPSS?

  1. Click Analyze › Descriptive Statistics › Crosstabs.
  2. Put one categorical variable in Row(s) and the other in Column(s).
  3. Under Statistics… tick Chi-square and Phi and Cramer’s V; under Cells… tick Expected and Row percentages.
  4. Click OK and read the Pearson Chi-Square row.

Report it in APA style: Course and preference were related, χ²(2, N = 150) = 8.79, p = .012, V = .24.

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

What is a chi-square test of independence?

The chi-square (χ²) test of independence checks whether two categorical variables are related, for example whether course and preferred teaching format are linked. It compares the counts you observed in each cell of a crosstab with the counts you’d expect if the variables were unrelated.

When to use it

  • Two categorical variables, each with two or more categories.
  • Each person counted once, in one cell only.
  • Expected counts are large enough; otherwise use Fisher’s exact test.

How it works

For each cell, the expected count is (row total × column total) ÷ grand total. χ² adds up (observed − expected)² ÷ expected across all cells, so big gaps between observed and expected produce a large χ². Degrees of freedom are (rows − 1) × (columns − 1). Cramér’s V (or phi for a 2 × 2 table) gives the effect size from 0 to 1.

Assumptions

  • Independent observations: each person appears in only one cell.
  • No more than 20% of cells with expected counts below 5, and none below 1.
  • Data are counts (frequencies), not percentages or means.

Worked example

Course and teaching preference were related, χ²(2, N = 150) = 8.79, p = .012, V = .24. Only 28% of nursing students preferred online teaching, compared with 56% of psychology students.

Key terms

Contingency table
A crosstab of two categorical variables.
Expected count
The cell count if the variables were unrelated.
Cramér’s V
Effect size for chi-square.
Standardised residual
How far a cell is from expected; beyond ±1.96 stands out.

Common mistakes

  • Running chi-square on percentages or means.
  • Ignoring the expected-count footnote.
  • Counting the same people more than once (use McNemar for repeated measures).

How to do it in SPSS

The Crosstabs dialog

Chi-square tests whether two categorical variables are related. In SPSS it lives inside Crosstabs.

Crosstabs
Variables
Participant ID [id]
Age in years [age]
▶
Row(s):1
Course [course]
▶
Column(s):
Preference [preference]
▶
Layer 1 of 1
Exact…Statistics…2Cells…3Format…Style…Bootstrap…
✓Display clustered bar charts4
Suppress tables
OKPasteResetCancelHelp
  1. 1
    Row(s) and Column(s)One categorical variable in each. It doesn't change the test, only the layout.
  2. 2
    Statistics…Tick Chi-square, plus Phi and Cramer's V for the effect size.
  3. 3
    Cells…Tick Expected counts to check the assumption, and Row percentages to describe the pattern.
  4. 4
    Clustered bar chartA quick picture of the pattern to include in your report.

Reading Chi-Square Tests

Read the top row of the Chi-Square Tests table, then check the footnote.

Output1 [Document1] – SPSS Statistics Viewer
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp
Output
Log
Crosstabs
Case Processing Summary
Crosstabulation
Chi-Square Tests
Symmetric Measures
Chi-Square Tests
ValuedfAsymptotic Significance (2-sided)
Pearson Chi-Square8.793a122.0123
Likelihood Ratio9.0312.011
N of Valid Cases150

4a. 0 cells (0.0%) have expected count less than 5. The minimum expected count is 22.33.

Symmetric Measures
ValueApproximate Significance
Nominal by NominalPhi.242.012
Cramer's V.2425.012
  1. 1
    Pearson Chi-SquareThe test statistic, χ² = 8.79.
  2. 2
    df(rows − 1) × (columns − 1) = (3 − 1) × (2 − 1) = 2.
  3. 3
    Significance.012 is below .05, so course and preference are related.
  4. 4
    FootnoteThe key assumption: no more than 20% of cells should have an expected count below 5. Here 0%, so it's met.
  5. 5
    Cramer's VThe effect size. Around .10 is small, .30 medium, .50 large (for the smallest table dimension of 2).

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.

CROSSTABS
  /TABLES=course BY preference
  /STATISTICS=CHISQ PHI
  /CELLS=COUNT EXPECTED ROW SRESID.

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.

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