Crosstabs and chi-square
Crosstabs cross-tabulates two categorical variables and tests whether they are associated with Pearson's chi-square (plus continuity correction and Fisher's exact test for 2×2 tables), with Phi and Cramér's V as effect sizes.
Menu: Analyze → Descriptive Statistics → Crosstabs…
When should I use Crosstabs and chi-square?
- Two categorical variables, e.g. smoking (yes/no) by gender.
- Independent observations — each case appears in one cell only.
What are the assumptions?
- Expected counts: no more than 20% of cells below 5 and none below 1. If violated in a 2×2 table, report Fisher’s exact test (StatLab tells you).
- For paired categorical data (before/after on the same people) use McNemar instead (planned).
How do I run it in StatLab?
- Choose the row and column variables.
- Keep chi-square ticked; add row or column percentages to describe the pattern.
- Optionally add expected counts, adjusted residuals and a clustered bar chart.
How do I read the output?
| Output | Meaning |
|---|---|
| Pearson Chi-Square | Value, df and asymptotic p. The main test. |
| Continuity Correction | Yates-corrected chi-square (2×2 only); more conservative. |
| Likelihood Ratio | G-test alternative; usually agrees with Pearson. |
| Fisher's Exact Test | Exact p for 2×2 tables; use when expected counts are small. |
| Linear-by-Linear Association | Trend test when both variables are ordered numeric codes. |
| Phi / Cramér's V | Effect size 0–1. Rough guide for V: .10 small, .30 medium, .50 large (for df = 1). |
| Adjusted Residual | Cells beyond ±1.96 contribute most to a significant result. |
| Footnote b | How many cells have expected count < 5 — check it before trusting the asymptotic p. |
Worked example
Crosstab smoker by gender in the bundled sample dataset (File → Sample dataset: 150 survey respondents with gender, programme group, age, pre/post test scores, five satisfaction items, income, smoking and education): χ²(1) = 0.09, p = .765; 0 cells have expected counts below 5.
How would I report it in APA style?
A chi-square test of independence showed no significant association between smoking and gender, χ²(1, N = 150) = 0.09, p = .765, Cramér's V = .02.
Numbers above were computed by StatLab’s validated engine from the sample dataset when this page was built.
What are common mistakes?
- Using percentages in the wrong direction: compare percentages within the groups you are comparing (row % if the row variable is the group).
- Running chi-square on scale data split into many arbitrary categories.