QED
Statistics · step 11 of 13

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.

  1. State the hypothesesH₀: the variables are independent; H₁: they are associated. The test never says which direction.
  2. Compute expected countsE = (row total × column total)/n for each cell. They need not be whole numbers.
  3. Compute the statisticχ² = Σ(O − E)²/E across all cells. Every cell contributes a non-negative amount.
  4. 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.

  1. Cell (1,1): 60 × 50/100 = 30.
  2. Cell (1,2): 60 × 50/100 = 30. Row 1 totals 60 ✓.
  3. Cells (2,1) and (2,2): 40 × 50/100 = 20 each.
  4. 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.

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.

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 →