The chi-square distribution is a probability distribution used to describe sums of squared standard normal variables. It is important because many statistics used in hypothesis testing follow a chi-square distribution when the null hypothesis is true. Its shape depends on the degrees of freedom, so the curve changes as the number of independent pieces of information changes.
Students meet this distribution often in goodness-of-fit tests and tests of independence.
Understanding Statistics: The Chi-Square Distribution
A chi-square test starts with a model of what the counts should look like if a claim is true. In a survey of one hundred students, a claim might predict equal preferences for four lunch options. The expected count for each option would be twenty-five.
The test compares each observed count with that benchmark. A difference of ten matters more than a difference of two, but the size of a difference must be judged relative to the expected count.
Being off by ten when fifty are expected is less surprising than being off by ten when only twelve are expected. This is why each squared difference is divided by its expected count.
Squaring has two important effects. First, a count above expectation and a count below expectation both provide evidence of mismatch, so their contributions cannot cancel. Second, large gaps receive much more weight than small gaps.
A difference twice as large produces four times the squared contribution. The final test value therefore summarizes the total pattern of disagreement between data and model. It does not show which category caused the disagreement.
Students should inspect the individual observed and expected counts after finding a large test value. This helps identify the categories that differ most from the model.
The right tail of the distribution is used because larger test values mean greater disagreement with the null model. A p value is the chance of getting a result at least this extreme if random variation were the only reason for the differences. A small p value gives evidence against the null model.
It does not prove that a particular alternative explanation is correct. It also does not measure the size or practical importance of an effect.
With a very large sample, even a tiny difference can produce a small p value. With a small sample, a meaningful pattern may fail to reach the usual cutoff.
Degrees of freedom come from restrictions placed on the counts. In a table with fixed row and column totals, once enough cells are known, the remaining cells are forced by those totals. They are not free to vary independently.
This explains why the degrees of freedom are smaller than the number of cells. In real life, independence tests appear in studies of whether product choice differs by age group, whether transport method is linked to neighborhood, or whether a medical outcome differs between treatments.
For reliable results, observations should be independent, categories should not overlap, and expected counts should be large enough for the chi-square approximation to work well. Very small expected counts can make the usual p value inaccurate, so categories may need combining or another exact method may be needed.
Key Facts
- If Z1, Z2, ..., Zk are independent standard normal variables, then X = Z1^2 + Z2^2 + ... + Zk^2 follows a chi-square distribution with k degrees of freedom.
- A chi-square random variable is always nonnegative, so x >= 0.
- The mean of a chi-square distribution is μ = k, where k is the degrees of freedom.
- The variance of a chi-square distribution is σ^2 = 2k.
- For a goodness-of-fit test, χ^2 = Σ((O - E)^2 / E), where O is observed count and E is expected count.
- For a test of independence in an r by c table, degrees of freedom are df = (r - 1)(c - 1).
Vocabulary
- Chi-square distribution
- A probability distribution for the sum of squares of independent standard normal random variables.
- Degrees of freedom
- The number of independent values that are free to vary after constraints have been applied.
- Goodness-of-fit test
- A chi-square test that checks whether observed category counts match a claimed distribution.
- Test of independence
- A chi-square test that checks whether two categorical variables are associated in a two-way table.
- Expected count
- The count predicted for a category or table cell if the null hypothesis is true.
Common Mistakes to Avoid
- Using negative x-values for a chi-square graph is wrong because chi-square values come from squared quantities and cannot be negative.
- Forgetting to check expected counts is wrong because the chi-square approximation can be unreliable when expected counts are too small.
- Using df = n - 1 for every chi-square test is wrong because goodness-of-fit and independence tests use different degrees of freedom formulas.
- Interpreting a small p-value as proof that the null hypothesis is false is wrong because a hypothesis test gives evidence, not absolute proof.
Practice Questions
- 1 A goodness-of-fit test has observed counts 18, 22, and 10 with expected counts 20, 20, and 10. Compute the chi-square statistic χ^2 = Σ((O - E)^2 / E).
- 2 A survey table has 3 rows and 4 columns. Find the degrees of freedom for a chi-square test of independence.
- 3 A chi-square curve with df = 2 is strongly right-skewed, while one with df = 20 is more spread out and more symmetric. Explain why increasing degrees of freedom changes the shape of the distribution.