Chi-square tests for independence
The chi-square test for independence asks whether two categorical variables are related. Under H₀ (independence) the expected count in each cell is (row total × column total)/grand total, and the statistic Σ(O − E)²/E measures the total mismatch. The degrees of freedom are (r−1)(c−1), which is far fewer than the number of cells.
✓ Unlimited questions · marked criterion by criterion · no card needed
Method: how to approach it
The order below is what examiners expect to see, and each step carries its own marks.
- State the hypothesesH₀: the variables are independent; H₁: they are associated. The test never says which direction.
- Compute expected countsE = (row total × column total)/n for each cell. They need not be whole numbers.
- Compute the statisticχ² = Σ(O − E)²/E across all cells. Every cell contributes a non-negative amount.
- Compare with the critical valuedf = (r−1)(c−1). Check every expected count is at least 5 before trusting the approximation.
Worked example
In a 2×2 table, row totals are 60 and 40, column totals 50 and 50, n = 100. Find the expected counts and the degrees of freedom.
- Cell (1,1): 60 × 50/100 = 30.
- Cell (1,2): 60 × 50/100 = 30. Row 1 totals 60 ✓.
- Cells (2,1) and (2,2): 40 × 50/100 = 20 each.
- df = (2−1)(2−1) = 1.
Answer. Expected counts 30, 30, 20, 20 with df = 1. The 5% critical value is 3.841.
Where marks get dropped
These are the specific errors that cost credit on chi-square tests for independence questions — QED's rubric penalises each of them separately.
- Using the number of cells as the degrees of freedom. It is (r−1)(c−1) — just 1 for a 2×2 table, not 4.
- Applying the test when expected counts fall below 5. Combine categories or use Fisher’s exact test instead.
- Running the test on percentages instead of raw counts. The statistic depends on the actual sample size.
Practise this until it is automatic
Unlimited fresh questions
QED generates new chi-square tests for independence problems on demand at warm-up, exam and challenge level, so you can drill this one skill until it stops costing you marks.
Marked like an examiner
Every answer is scored against a point-by-point rubric with partial credit, so you see exactly which step of the method broke down — not just a tick or a cross.
Answer in real notation
A one-tap symbol palette, a visual equation editor and a truth-table builder — or photograph your handwritten working and QED converts it to LaTeX.
Saved to your library
Every question you generate is kept and re-takeable as a timed exam, and your Statistics mastery is tracked so you know when this is exam-ready.
Chi-square tests for independence — frequently asked questions
Why is df = (r−1)(c−1)?
Because the row and column totals are fixed, so once (r−1)(c−1) cells are known the rest are determined. That is the count of freely varying cells.
What if a cell has an expected count below 5?
The chi-square approximation becomes unreliable. Merge adjacent categories, or use Fisher’s exact test for a 2×2 table.
Does a significant result show causation?
No. It shows association only, and a lurking variable can produce it. This is exactly where Simpson’s paradox lives.
The rest of Statistics
Describing data, distributions, estimation and hypothesis tests. Each subtopic below has its own method, worked example and mark-losing traps.
- 1Mean, median & mode
- 2Variance, standard deviation & spread
- 3Shape, skew & outliers
- 4Boxplots, histograms & quartiles
- 5The normal distribution & z-scores
- 6Sampling, bias & the sampling distribution
- 7The central limit theorem
- 8Confidence intervals for a mean
- 9Hypothesis testing & p-values
- 10t-tests & comparing two means
- 11Chi-square tests for independence
- 12Correlation & least-squares regression
- 13Type I / Type II errors & power
Ready to make chi-square tests for independence exam-proof?
Generate your first questions free — no card, no setup, no personal data stored. Practise until the method is second nature.
Start practising free →