Carrying Out a Goodness-of-Fit Test
| English | Chinese | Pinyin |
|---|---|---|
| chi-square statistic | 卡方统计量 | kǎ fāng tǒng jì liàng |
The chi-square statistic
- The chi-square statistic 卡方统计量 adds up the standardized gaps across all categories:
-
$$\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}$$
- Each term compares one category's observed and expected counts.
- Squaring makes every gap positive; dividing by expected scales it.
Bigger gaps, bigger chi-square
- If observed $\approx$ expected everywhere, each term is tiny → $\chi^2$ is small.
- Large mismatches make terms large → a big $\chi^2$.
- So a large $\chi^2$ is evidence against the claimed distribution.
- $\chi^2$ is always $\ge 0$ (a sum of squares over positives).
Find the p-value
- The p-value is the area to the right of $\chi^2$ under the chi-square curve at the right $df$.
- Chi-square is a right-tailed test — only large values are "extreme."
- A big $\chi^2$ sits far right → small p-value → strong evidence against $H_0$.
- Use technology or a table with $df = \text{categories} - 1$.
Decide and conclude
- Compare the p-value to $\alpha$: p $\le \alpha$ → reject $H_0$; else fail to reject.
- Reject: convincing evidence the true distribution differs from the claim.
- Fail to reject: not convincing evidence against the claimed fit.
- State it in context — about the model's fit to the data.
Chi-square is always a right-tailed test — never double the tail. Only large $\chi^2$ values are surprising, so the p-value is the right-tail area only (unlike a two-sided $z$ or $t$). Also, plug counts into the formula, not proportions, and use expected (not observed) in each denominator.
Die test: observed $8, 12, 9, 11, 10, 10$; expected $10$ each; $df = 5$.
- $\chi^2 = \tfrac{(8-10)^2}{10} + \tfrac{(12-10)^2}{10} + \cdots = \tfrac{4+4+1+1+0+0}{10} = 1.0$.
- p-value: right-tail area beyond $1.0$ at $df=5$ is large ($\approx 0.96$).
- Decide: $0.96 > 0.05$ → fail to reject; no evidence the die is unfair.
The chi-square statistic $\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}$ measures total mismatch. Its p-value is the right-tail area at $df = \text{categories} - 1$. Compare to $\alpha$: reject $H_0$ if p $\le \alpha$ (the model fits poorly), else fail to reject — stated in context.
A right-skewed test distribution
Chi-square is right-tailed — only large values are extreme.
One category has observed 8, expected 10. Compute (observed − expected)²/expected.
(8−10)²/10 = 4/10 = 0.4.
A chi-square test is...
Only large χ² is extreme → right tail only.
A large chi-square statistic is evidence against the claimed distribution.
Big gaps → big χ² → evidence against H0.
In the chi-square formula, each denominator is the ___ count.
Divide the squared gap by the expected count.
The chi-square statistic can be negative.
It's a sum of squares over positive expecteds — always ≥ 0.