Setting Up a Goodness-of-Fit Test · 设立拟合优度检验
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| expected count/ekˈspektɪd kaʊnt/ | 期望频数 | qī wàng pín shuò |
The goodness-of-fit hypotheses
- A goodness-of-fit test checks one variable against a claimed distribution.
- Null $H_0$: the claimed distribution is correct (e.g. all proportions as stated).
- Alternative $H_a$: the distribution is not as claimed (at least one proportion differs).
- $H_a$ is a single "something's off" statement — not a direction.
拟合优度假设
- 拟合优度检验用一个变量对照宣称的分布。
- **零假设 $H_0$:**宣称的分布是正确的(例如所有比例都如所述)。
- 备择假设 $H_a$:分布不如所称(至少一个比例不同)。
- $H_a$ 是一句“有什么不对劲”的陈述——不是方向。
Expected counts
- The expected count 期望频数 for a category = $n \times$ (its claimed proportion).
- For $100$ candies at $25\%$ each: expected $= 100 \times 0.25 = 25$ per color.
- Expected counts need not be whole numbers — keep them exact.
- They're what the null model predicts, on average.
期望计数
- 一个类别的期望计数 = $n \times$(它宣称的比例)。
- 对 $100$ 颗糖、每种 $25\%$:期望 $= 100 \times 0.25 =$ 每种 $25$。
- 期望计数不必是整数——保持精确。
- 它们是零假设模型平均而言预测的。
Check the conditions
- Random: the data come from a random sample or randomized process.
- 10%: $n \le 0.10N$ if sampling without replacement.
- Large counts: every expected count $\ge 5$ (this is the chi-square version).
- All expected counts must clear $5$, or the $\chi^2$ model is unreliable.
检查条件
- **随机:**数据来自随机样本或随机化过程。
- **10%:**不放回抽样时 $n \le 0.10N$。
- 大计数:****每个期望计数 $\ge 5$(这是卡方版本)。
- 所有期望计数都必须过 $5$,否则 $\chi^2$ 模型不可靠。
Degrees of freedom
- For goodness-of-fit, $df = (\text{number of categories}) - 1$.
- Four candy colors → $df = 4 - 1 = 3$.
- The $df$ picks which chi-square curve to use for the p-value.
- It depends on categories, not on the sample size.
自由度
- 对拟合优度,$df = (\text{categories}) - 1$。
- 四种糖果颜色 → $df = 4 - 1 = 3$。
- $df$ 决定用哪条卡方曲线求 p 值。
- 它取决于类别数,而非样本量。
The large-counts condition for chi-square is "every EXPECTED count $\ge 5$," not observed. Check the expected counts, and check them all — one small expected count invalidates the test. And $df = \text{categories} - 1$ here (a common slip is to use $n-1$, which is for $t$, not chi-square goodness-of-fit).
卡方的大计数条件是“每个期望计数 $\ge 5$”,而非观察计数。检查期望计数,并且全部检查——一个小的期望计数就会使检验失效。而且这里 $df = \text{categories} - 1$(常见失误是用 $n-1$,那是 $t$ 的,不是卡方拟合优度的)。
Test whether a die is fair with $60$ rolls. $H_0$: each face has probability $1/6$.
- Expected count per face: $60 \times \tfrac{1}{6} = 10$ (all $\ge 5$ ✓).
- $df$: $6 - 1 = 5$ (six faces).
- $H_a$: the die is not fair — at least one face's probability differs.
用 $60$ 次投掷检验一个骰子是否均匀。$H_0$:每面的概率为 $1/6$。
- 每面的期望计数:$60 \times \tfrac{1}{6} = 10$(都 $\ge 5$ ✓)。
- $df$:$6 - 1 = 5$(六个面)。
- **$H_a$:**骰子不均匀——至少一面的概率不同。
A goodness-of-fit test has $H_0$: the claimed distribution holds, vs. $H_a$: it doesn't. Expected count $= n \times$ (claimed proportion); check random, 10%, and every expected count $\ge 5$. The degrees of freedom are $(\text{categories}) - 1$.
拟合优度检验的 $H_0$:宣称的分布成立,对 $H_a$:不成立。期望计数 $= n \times$(宣称的比例);检查随机、10%、每个期望计数 $\ge 5$。自由度是($\text{categories}$)$- 1$。
The claimed distribution · 宣称的分布
Expected counts come from the null distribution's proportions. · 期望计数来自零假设分布的比例。
A fair die is rolled 60 times. What is the expected count for each face (60 × 1/6)? · 一个均匀骰子投 60 次。每面的期望计数是多少(60 × 1/6)?
60 × 1/6 = 10. · 60 × 1/6 = 10。
For a goodness-of-fit test with 6 categories, what are the degrees of freedom? · 对有 6 个类别的拟合优度检验,自由度是多少?
df = categories − 1 = 6 − 1 = 5. · df = 类别数 − 1 = 6 − 1 = 5。
The large counts condition for a chi-square test requires... · 卡方检验的大计数条件要求……
All EXPECTED counts must be at least 5. · 所有期望计数都必须至少为 5。
Expected counts must always be whole numbers. · 期望计数必须总是整数。
Keep them exact — they need not be integers. · 保持精确——它们不必是整数。
The alternative hypothesis for a goodness-of-fit test says... · 拟合优度检验的备择假设说……
Ha is a non-directional 'the distribution isn't as claimed'. · Ha 是非方向性的“分布不如所称”。