Carrying Out a Goodness-of-Fit Test · 执行拟合优度检验
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| chi-square statistic/kaɪ skweə stəˈtɪstɪk/ | 卡方统计量 | 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.
卡方统计量
- 卡方统计量把所有类别上标准化后的差距加起来:
-
$$\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}$$
- 每一项比较一个类别的观察计数和期望计数。
- 平方让每个差距为正;除以期望值给它缩放。
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).
差距越大,卡方越大
- 如果处处观察 $\approx$ 期望,每一项都很小 → $\chi^2$ 很小。
- 大的不匹配让各项变大 → 一个大的 $\chi^2$。
- 所以大的 $\chi^2$ 是反对宣称分布的证据。
- $\chi^2$ 永远 $\ge 0$(正数上的平方和)。
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$.
求 p 值
- p 值是在正确 $df$ 下卡方曲线中 $\chi^2$ 右侧的面积。
- 卡方是右尾检验——只有大值才“极端”。
- 大的 $\chi^2$ 位于最右 → 小的 p 值 → 反对 $H_0$ 的强证据。
- 用技术或用 $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.
决策与结论
- 把 p 值与 $\alpha$ 比较:p $\le \alpha$ → 拒绝 $H_0$;否则不拒绝。
- **拒绝:**有令人信服的证据表明真实分布与宣称不同。
- **不拒绝:**没有令人信服的证据反对宣称的拟合。
- 结合语境陈述——关于模型对数据的拟合。
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.
卡方永远是右尾检验——绝不把尾部加倍。只有大的 $\chi^2$ 值才意外,所以 p 值是仅右尾的面积(不同于双侧的 $z$ 或 $t$)。此外,把计数代入公式,而非比例,并在每个分母里用期望(而非观察)。
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.
骰子检验:观察 $8, 12, 9, 11, 10, 10$;期望每面 $10$;$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 值:$df=5$ 时超过 $1.0$ 的右尾面积很大($\approx 0.96$)。
- 决策:$0.96 > 0.05$ → 不拒绝;没有证据表明骰子不均匀。
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.
卡方统计量 $\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}$ 度量总的不匹配。它的 p 值是 $df = \text{categories} - 1$ 处的右尾面积。与 $\alpha$ 比较:p $\le \alpha$ 则拒绝 $H_0$(模型拟合差),否则不拒绝——结合语境陈述。
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。计算 (observed − expected)²/expected。
(8−10)²/10 = 4/10 = 0.4. · (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. · 大差距 → 大 χ² → 反对 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. · 它是正期望值上的平方和——永远 ≥ 0。