Chi-square test
Compares the proportion of patients with a yes/no outcome between independent groups.
Clinical example
Whether the proportion of patients with a postoperative wound infection differs between two types of dressing.
When to use it
- The outcome is yes or no, one per patient.
- You compare two or more independent groups.
- You don't need to adjust for other variables, and about 5 or more patients are expected in every cell of the table.
Assumptions to check
Independent observations
Each patient appears in the table once.
Expected counts of about 5 or more
Look at the expected counts in every cell of the group-by-outcome table. If some are below 5, use Fisher's exact test.
What to report
- Number and percentage with the outcome in each group
- Risk difference (or risk ratio) with 95% CI
- The exact p-value, not just "p < 0.05"
Common mistakes
Report the effect, not just the p-value
Give the estimate (difference, ratio) with its 95% confidence interval and the exact p-value.
An odds ratio is not a risk ratio
When the outcome is common (more than about 10% of patients), the odds ratio is further from 1 than the risk ratio. Log-binomial regression gives a risk or prevalence ratio instead. Don't describe an odds ratio of 2 as "twice the risk".
Alternatives
| If your situation is… | Use |
|---|---|
| Fewer than 5 expected in some cell | Fisher's exact test |
| You need to adjust for other variables | Logistic regression |
In your software
# R
tab <- table(trial$dressing, trial$infection)
chisq.test(tab)
CROSSTABS
/TABLES=dressing BY infection
/STATISTICS=CHISQ RISK
/CELLS=COUNT EXPECTED ROW.