SPSS command: SPSS CROSSTABS /STATISTICS
SPSS CROSSTABS statistics: chi-square, Fisher, kappa and McNemar
CROSSTABS /STATISTICS tests whether two categorical variables are associated and measures how strongly. Only need a quick 2×2 or r×c table of counts? Use the free chi-square calculator.
Free · No account · Files stay on your device · Updated 18 October 2026
What it tells you
In Crosstabs, build the table in Table mode and open All statistics to get the full set: chi-square tests, Fisher's exact tests, nominal and ordinal measures with asymptotic standard errors, correlations, kappa and McNemar, risk estimates, Cochran–Mantel–Haenszel tests across a layer, and cell residuals.
- Whether the row and column variables are independent: Pearson chi-square, continuity correction, likelihood ratio, and Fisher's exact test for 2×2 and larger tables.
- How strong the association is for nominal variables: phi, Cramér's V, contingency coefficient, lambda, Goodman–Kruskal tau and the uncertainty coefficient.
- For ordered categories, the direction and strength of the trend: gamma, Kendall's tau-b and tau-c, Somers' d, Spearman and Pearson correlations and the linear-by-linear test.
- Agreement between paired ratings (Cohen's kappa, McNemar or McNemar–Bowker) and, in 2×2 tables, odds ratios and relative risks with confidence intervals.
- Whether a 2×2 association holds across the levels of a third variable: Cochran's and Mantel–Haenszel tests, Breslow–Day and Tarone homogeneity tests and the common odds ratio.
When to use it
Use it when
- Testing whether answers to a survey question differ by segment, region or wave.
- Measuring a trend between two ordered variables, such as income band and satisfaction.
- Comparing two raters' classifications, or before/after categories on the same people.
- Checking whether an exposure–outcome 2×2 association is confounded by a third variable.
Use something else when
- Expected counts below 5 in many cells of a large table and an exact test exceeds the browser workload: merge sparse categories or use the Monte Carlo exact option.
- Survey data with a complex design (strata, clusters): use Complex Samples Crosstabs for design-based tests.
- Three or more variables whose joint associations you want to model: use hierarchical loglinear analysis.
- Multiple-response sets: table-level association statistics are not valid because rows are not mutually exclusive.
How to run it in Crosstabs
- 01
Open the data in Table mode
Load your file in the workspace and open Table mode, where tables and their statistics are built.
- 02
Assign the row and column variables
In the variable list, click Row on one variable and Col on another. The table and its chi-square summary appear below it.
- 03
Declare measurement levels
Ordinal measures and correlations need both variables ordered: numeric codes count as ordered, or declare text categories ordinal in the data dictionary. Kappa and McNemar appear for square tables whose rows and columns share categories.
- 04
Open All statistics
Expand All statistics (G-test, Fisher's exact, λ, γ, τ, d, U…) under the table to see the chi-square tests, nominal and ordinal measures, correlations, agreement and risk estimates.
- 05
Add a layer and residuals
In the Layer analysis section, choose a Layer (control) variable for the Cochran–Mantel–Haenszel tests. Under Display, set Residual in cells to Raw, Std. or Adjusted to show residuals in the table.
Worked example
Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.
Data
160 synthetic customers cross-classified by plan tier (Basic < Plus < Pro) and satisfaction (Low < Medium < High); both variables are declared ordinal in the data dictionary. The 3×3 counts are written out as one row per customer.
Input preview
| Item | Low | Medium | High | Total |
|---|---|---|---|---|
| Basic | 24 | 21 | 11 | 56 |
| Plus | 14 | 25 | 19 | 58 |
| Pro | 6 | 14 | 26 | 46 |
| Item | Value | df | p |
|---|---|---|---|
| Pearson chi-square | 19.579 | 4 | <.001 |
| Likelihood ratio | 19.512 | 4 | <.001 |
| Linear-by-linear association | 18.028 | 1 | <.001 |
| Item | Value | Asymp. SE | Approx. T | p |
|---|---|---|---|---|
| Phi | 0.350 | <.001 | ||
| Cramér's V | 0.247 | <.001 | ||
| Contingency coefficient | 0.330 | <.001 | ||
| Lambda (symmetric) | 0.158 | 0.076 | 1.978 | .048 |
| Uncertainty coefficient (symmetric) | 0.056 | 0.025 | 2.267 | <.001 |
| Item | Value | Asymp. SE | Approx. T | p |
|---|---|---|---|---|
| Gamma | 0.446 | 0.091 | 4.587 | <.001 |
| Kendall's tau-b | 0.303 | 0.066 | 4.587 | <.001 |
| Kendall's tau-c | 0.301 | 0.066 | 4.587 | <.001 |
| Somers' d (symmetric) | 0.303 | 0.066 | 4.587 | <.001 |
| Item | Value | Asymp. SE | Approx. T | p |
|---|---|---|---|---|
| Pearson's R | 0.337 | 0.072 | 4.495 | <.001 |
| Spearman correlation | 0.337 | 0.072 | 4.499 | <.001 |
Scores: category codes.
How to read it
The Pearson chi-square is 19.58 on 4 df (p < .001), and Cramér's V = 0.247 sizes the association. Because both variables are ordered, the ordinal measures add direction: gamma = 0.446 and tau-b = 0.303 are positive, so higher tiers go with higher satisfaction, and the linear-by-linear test (p < .001) carries most of the chi-square on a single df. The largest adjusted residual is 3.63 in the Pro × High cell.
Output tables explained
- Chi-square tests
- Pearson chi-square, continuity correction (2×2), likelihood ratio, Fisher's exact test (one- and two-sided for 2×2), the Fisher–Freeman–Halton exact test for larger tables with small expected counts, and linear-by-linear association for ordered variables.
- Nominal measures
- Phi, Cramér's V and the contingency coefficient with p, then lambda, Goodman–Kruskal tau and the uncertainty coefficient (symmetric and each direction) with asymptotic SE, approximate T and p.
- Ordinal measures
- Gamma, Kendall's tau-b and tau-c, and Somers' d (symmetric and each direction) with asymptotic SE, approximate T and p; withheld with the reason when a variable is not ordered.
- Correlations
- Pearson's R on category scores and the Spearman correlation on midranks, plus eta when a variable is interval-level.
- Agreement
- Cohen's kappa with SE and p, and the McNemar (2×2, exact binomial) or McNemar–Bowker symmetry test.
- Risk estimate
- For 2×2 tables: the odds ratio and the relative risk for each column category, with 95% confidence intervals.
- Layer analysis
- With a layer variable and a 2×2 table in each layer: Cochran's and Mantel–Haenszel tests, Breslow–Day and Tarone tests, and the Mantel–Haenszel common odds ratio with each layer's odds ratio.
Assumptions and notes
- Each case falls in exactly one cell; the chi-square approximation needs most expected counts of 5 or more, otherwise read the exact test.
- Ordinal measures and correlations use the displayed category order, so check that it runs from low to high.
- Exact tests need unweighted or whole-number frequency-weighted counts.
- Kappa and McNemar are valid only when rows and columns are paired ratings of the same cases.
How the results are validated
The statistics are checked against 31 published CROSSTABS reference cases in the public validation manifest, generated with SciPy 1.18, statsmodels 0.15, R 4.6.1 with DescTools 0.99.60 and stats::fisher.test, and a 50-digit mpmath delta method for standard errors. Every value agrees to a relative tolerance of 1e-10; the cases cover nominal, ordinal, correlation, agreement and risk measures, one-sided and R×C Fisher tests, residuals and stratified 2×2 tests. Validation evidence
Questions
Pearson chi-square or Fisher's exact test?
Use Pearson when expected counts are mostly 5 or more. For 2×2 tables Fisher's exact test is reported alongside; for larger tables the Fisher–Freeman–Halton test runs when an expected count is below 5, falling back to a seeded Monte Carlo estimate if exact enumeration is too heavy.
Cramér's V or gamma?
Cramér's V measures association strength for any table, ignoring order. Gamma, tau-b and Somers' d use the category order and give a direction, so prefer them when both variables are ordinal.
Why are the ordinal measures missing?
Both variables must have an authoritative order: numeric codes in ascending display order, or a declared ordinal or scale level. Text categories without a declared level, or a (Missing) category in the table, withhold them with the reason shown.
What do adjusted residuals tell me?
Each cell's adjusted residual is approximately standard normal under independence, so values beyond about ±1.96 point to the cells that drive a significant chi-square.
Does weighting change which tests I get?
Yes. A declared frequency weight is treated as case counts, so exact tests still run when the weighted counts are whole numbers. Other weighted counts keep the asymptotic statistics but drop the exact tests, and the panel says why.
Related procedures
- CTABLES Summary StatisticsCTABLES /COMPARETEST TYPE=MEAN
- Weighted KappaWEIGHTED KAPPA
- Hierarchical Loglinear AnalysisHILOGLINEAR
- Complex Samples CrosstabsCSTABULATE
- Bayesian Test of IndependenceBAYES LOGLINEAR
- ProportionsPROPORTIONS
- Free SPSS alternative: full coverage list
Run Crosstabs Statistics on your own data
Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.
SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.