Security scan is checking this page.

Lesson 32 of 1524

The chi-square distribution

Compare observed counts with expected counts. The test is right-tailed.

Practice this chapter

Goodness of fit asks whether category counts match one claimed distribution. Independence asks whether two categorical variables in a table are associated.

The expected count in a table cell is (row total × column total) / n. Each expected count should be at least 5. Degrees of freedom are k − 1 for a fit test with k categories, and (r − 1)(c − 1) for a table. Large values of the statistic are the evidence, so you only look at the right tail.

Expected count in a table

E = (row total × column total) / n

The count the cell would have if the variables were independent.

Worked example

A table has row totals 20 and 30, column totals 25 and 25, and n = 50. What is the expected count for the first row and first column?

  1. 1If the row variable and the column variable were independent, a cell’s expected count is (row total × column total) / n.
  2. 2The first row total is 20 and the first column total is 25.
  3. 3Multiply those totals: 20 × 25 = 500.
  4. 4Divide by the table total: 500 / 50 = 10.
  5. 5The first row is 20/50 of the table, and the first column is 25/50 of the table. The share that falls in both is what the formula just computed.

Result: 10

Why. Under independence, that cell should hold 10 of the 50 observations, because (20 × 25) / 50 = 10. The chi-square comparison is then between the observed count and this 10, not between the observed count and the row total.

Chi-square uses counts, not percentages. And a small statistic does not reject; only a large one does.

Practice margin

This chapter

A fresh set from this chapter only. Choose 10 or 20. Multiple choice and fill-in, with no repeat inside the set.