Does study preference depend on gender? Does treatment outcome depend on which clinic a patient attended? Whenever the question is "are these two categorical variables associated," the chi-square test of independence is the answer, and in SPSS it hides inside the Crosstabs dialog rather than any menu with "chi-square" in the name. Here is the full procedure: data setup, the dialog options that matter, the expected frequency rule that trips up most students, and the APA sentence at the end.
When to Use the Chi-Square Test of Independence
The test needs two categorical variables. Gender (male/female), preference (visual/auditory/reading), smoking status (yes/no), diagnosis group — anything measured as membership in a category. It compares the frequencies you observed against the frequencies you would expect if the two variables had nothing to do with each other. A large gap between observed and expected produces a large χ² statistic and a small p-value.
Two conditions must hold. First, both variables are genuinely categorical. If one of them is continuous (age, test score), chi-square is the wrong tool — you want a t-test, ANOVA, or correlation, and our test selection guide walks through that decision. Do not chop a continuous variable into categories just to force it into a crosstab; you throw away information and statistical power. Second, observations are independent: each participant appears exactly once, in exactly one cell. Measuring the same people twice (before and after an intervention, say) violates this and calls for McNemar's test instead.
Setting Up Your Data
One row per participant, one column per variable. For a study of 150 students where you recorded gender and study preference, the file looks like this:
| participant | gender | preference |
|---|---|---|
| 1 | 1 | 2 |
| 2 | 2 | 1 |
| 3 | 2 | 3 |
| 4 | 1 | 1 |
| 5 | 2 | 2 |
Here gender is coded 1 = male, 2 = female, and preference is coded 1 = visual, 2 = auditory, 3 = reading. Define these codes under Values in Variable View so the output tables show labels instead of numbers.
The common mistake: entering the data as a summary table of counts, with one row saying "male, visual, 24" and so on. SPSS will happily run Crosstabs on that file and report N = 6 instead of N = 150, because it counts rows, not the numbers inside them. If a summary table is all you have, it can still work — you tell SPSS to weight each row by its count. The procedure is in the FAQ at the bottom. But if you are entering data from scratch, use one row per participant.
Running the Test
Go to Analyze > Descriptive Statistics > Crosstabs. Then:
- Move gender into Row(s) and preference into Column(s). Which variable goes where does not change the test result; conventionally the independent or grouping variable goes in rows.
- Click Statistics. Check Chi-square and Phi and Cramér's V. Click Continue.
- Click Cells. Under Counts, check Expected in addition to Observed. This is the box everyone forgets, and you need it to verify the expected frequency rule. Click Continue.
- Click OK.
Three tables appear: the Crosstabulation, Chi-Square Tests, and Symmetric Measures. Before interpreting the p-value, check whether the test was valid to begin with.
The Expected Frequency Rule
Chi-square is an approximation, and the approximation breaks down when expected cell counts get small. The standard rule: at least 80% of cells must have an expected count of 5 or more, and no cell may have an expected count below 1. Note that this applies to expected counts, the values SPSS computes under the independence assumption — not to the observed counts you collected. An observed cell of 2 is fine as long as its expected count clears the bar.
SPSS checks this for you. Look at footnote "a" directly under the Chi-Square Tests table. It reads something like: "0 cells (0.0%) have expected count less than 5. The minimum expected count is 11.20." If the percentage is 0% (or anything up to 20%) and the minimum is at least 1, proceed. If more than 20% of cells fall below 5, the Pearson chi-square p-value is not trustworthy. You then have two options. For a 2×2 table, report Fisher's Exact Test, which SPSS has already printed in the same output. For larger tables, merge sparse categories where it makes conceptual sense — collapsing "strongly agree" and "agree" into one level, for instance — and rerun.
Reading the Output
Crosstabulation. Each cell shows the observed count and, because you checked Expected under Cells, the expected count beneath it. Reading the two against each other tells you the direction of the association before you look at any p-value. If 38 women chose visual learning but only 29.5 were expected, women are overrepresented in that category. The chi-square statistic summarizes these gaps across all cells.
Chi-Square Tests. Read the top row, Pearson Chi-Square. Suppose it shows Value = 8.42, df = 2, Asymptotic Significance (2-sided) = .015. The df comes from (rows − 1) × (columns − 1); with a 2×3 table that is 1 × 2 = 2. Since .015 is below .05, gender and study preference are associated in this sample. Ignore the Likelihood Ratio and Linear-by-Linear rows for a standard analysis; they answer slightly different questions. The Continuity Correction row appears only for 2×2 tables, and most current guidance says to report the uncorrected Pearson value or Fisher's exact rather than the Yates-corrected one.
Symmetric Measures. This is where Cramér's V lives — say V = .24 with the same p-value. The chi-square statistic itself grows with sample size, so it cannot tell you how strong the association is. V can.
Effect Size: Cramér's V
Cramér's V ranges from 0 (no association) to 1 (perfect association). The interpretation thresholds depend on the size of the table, expressed as df* = min(rows − 1, columns − 1):
| Table size | df* | Small | Medium | Large |
|---|---|---|---|---|
| 2×2, 2×3, 2×4 … | 1 | .10 | .30 | .50 |
| 3×3 and larger | 2+ | .07 | .21 | .35 |
Our 2×3 example has df* = min(1, 2) = 1, so the first row applies and V = .24 falls between small and medium. Students routinely apply the strictest thresholds to every table, which misjudges effects in larger designs. Check df* first. And report V whenever the test is significant — with N = 500, even a trivial association will produce p < .05, and the effect size is what keeps the interpretation honest.
Reporting in APA Format
The APA template packs the statistic, degrees of freedom, sample size, p-value, and effect size into one sentence:
A chi-square test of independence showed a statistically significant association between gender and study preference, χ²(2, N = 150) = 8.42, p = .015, V = .24.
The 2 inside the parentheses is the df from the Chi-Square Tests table; N is the total sample. Italicize N, p, and V in your document. Follow the statistic with a plain-language sentence describing the pattern from the crosstab: "Women were more likely than men to prefer visual materials (51% vs 32%)." Percentages within each gender group communicate the direction far better than raw counts. More templates, including non-significant results and Fisher's exact reporting, are in our guide to reporting chi-square results in APA.
When to Use Fisher's Exact Test
Fisher's exact test computes the exact probability of the observed table instead of relying on the chi-square approximation, which makes it valid no matter how small the expected counts are. Its practical home is the 2×2 table with a small sample — a pilot study with 12 patients per arm, an adverse-event comparison where one cell holds 2 cases. SPSS prints it automatically in the Chi-Square Tests table for any 2×2 crosstab; no extra clicks needed. Report the "Exact Sig. (2-sided)" value: "Fisher's exact test indicated a significant association between treatment group and remission, p = .031." There is no test statistic or df to report.
For tables larger than 2×2, the base version of SPSS does not provide Fisher's test; the Exact Tests add-on module can compute it, but most university licenses do not include it. In that case, merging sparse categories remains the workable fix.
Frequently Asked Questions
My data are already a table of counts. Can I still run chi-square in SPSS?
Yes, using case weighting. Enter three columns: the row category code, the column category code, and the count for that cell. Then go to Data > Weight Cases, select "Weight cases by," and move the count variable into the Frequency Variable box. Run Crosstabs as usual and SPSS treats each row as that many participants.
What is the difference between the chi-square test of independence and the goodness-of-fit test?
The test of independence examines whether two categorical variables are associated, using a crosstab. The goodness-of-fit test examines whether the frequencies of a single categorical variable match some expected distribution, such as equal proportions. In SPSS the goodness-of-fit version lives under Analyze > Nonparametric Tests > Legacy Dialogs > Chi-square, a different menu from Crosstabs.
Does a significant chi-square tell me which cells drive the association?
Not by itself. The test is an omnibus result across the whole table. To locate the source, compare observed and expected counts cell by cell, or request adjusted standardized residuals in the Cells dialog; values beyond plus or minus 1.96 mark cells contributing significantly to the association.
Key takeaway: One row per participant, two coded columns. Analyze > Descriptive Statistics > Crosstabs, with Chi-square and Cramér's V under Statistics and Expected counts under Cells. Check the footnote: at least 80% of cells need an expected count of 5+, none below 1. Report χ²(df, N) = value, exact p, and V — using the df*-adjusted thresholds. Small 2×2 table? Fisher's exact is already in your output.