Decision guide

Which Statistical Test Should I Use? (Categorical Data)

To test whether two categorical variables are related, use the chi-square test of independence — or Fisher's exact test for a small 2×2 table. Then report an effect size (Cramér's V or phi) for strength, and an ordinal measure(gamma, Kendall's tau, or Somers' d) if both variables are ordered.

Reviewed by the crosstabs.com methods team · Last updated

Run this on your own data — free, no signup

Upload a CSV or XLSX. Everything runs in your browser; your file never leaves your device.

Open the workspace →

Are your variables categorical?

This guide is for categorical data — variables that sort observations into groups (e.g. treatment vs control, or low/medium/high), usually summarized in a cross-tabulation.

  • If bothvariables are categorical, you're in the right place — keep reading to pick a test and an effect size.
  • If onevariable is continuous (a number like age or income), a crosstab test isn't the right tool — you likely want a t-test, ANOVA, or correlation/regression instead.

Step 1 — Test for association

First ask whether there is any association at all between the two variables. Choose a significance test based on the size of your table and your expected counts:

  • Two categorical variables, reasonable sample size → the chi-square test of independence.
  • A small 2×2 table or low expected cell counts → use Fisher's exact test instead, since chi-square's approximation can be unreliable.
  • Want a likelihood-ratio alternative to chi-square → the G-test.

Not sure which to pick? See chi-square vs Fisher's exact.

Step 2 — Measure strength (effect size)

A p-value tells you whether an association is real, not how strong it is. Always pair your test with an effect size:

For the difference between the two most common choices, see Cramér's V vs phi.

When to use it

Use it when

  • Run a significance test (chi-square / Fisher / G-test) when you want to know IF two variables are associated.

Not the right tool when

  • A p-value alone isn't enough — also report an effect size (Cramér's V, phi) to say HOW STRONG the association is.

How to interpret it

Rule of thumb

Significance tells you whether an association is real; effect size tells you whether it's big enough to matter — always report both.

Step 3 — If both variables are ordinal

When both variables have a natural order (e.g. low/medium/high), use a measure that accounts for that ordering rather than a nominal one:

If you want a prediction-style (PRE) measure for nominal data

Proportional-reduction-in-error (PRE) measures tell you how much knowing one variable improves prediction of the other:

2×2 risk and effect

For a 2×2 table comparing an exposure or treatment against an outcome, you often want a measure of effect rather than just association:

Frequently asked questions

What test do I use for two categorical variables?
Use the chi-square test of independence. For a small 2×2 table or low expected cell counts, use Fisher's exact test instead, then report an effect size such as Cramér's V or phi.
What test for two ordinal variables?
Use an ordinal measure of association: Goodman and Kruskal's gamma, Kendall's tau-b/tau-c, or Somers' d for a directional measure. These account for the ordering of categories, unlike chi-square.
Do I need an effect size as well as a p-value?
Yes. The p-value only tells you whether an association is statistically real; an effect size such as Cramér's V or phi tells you how strong it is. Always report both.

References & further reading

Try it on your own data — free, no signup

Upload a CSV or XLSX. Everything runs in your browser; your file never leaves your device.

Open the workspace →

Related calculators

← All calculators & guides