Expected Counts in Two-Way Tables
引入
7:48
分类数据的推断:卡方
掷一枚公平骰子六十次。每个面应出现十次。但从未如此——这里八次,那里十三次。差距始终存在。因此再掷一次…
英文讲解 · 可切换中英文字幕
本课内容
| English | 释义 | 拼音 |
|---|---|---|
| Expected counts/ekˈspektɪd kaʊnts/ | 期望频数 | qī wàng pín shù |
| two-way table/tuː weɪ ˈteɪbl/ | 双向列联表 | shuāng xiàng liè lián biǎo |
| cell/sel/ | 单元格 | dān yuán gé |
| null/nʌl/ | 原假设 | yuán jiǎ shè |
| variables/ˈveərɪəblz/ | 变量 | biàn liàng |
| grand total | 总计 | zǒng jì |
| row total | 行合计 | xíng hé jì |
| column total | 列合计 | liè hé jì |
| observed counts/ɒbˈzɜːvd kaʊnts/ | 观测频数 | guān cè pín shuò |
| Degrees of freedom/dɪˈɡriːz ɒv ˈfriːdəm/ | 自由度 | zì yóu dù |
| margins | 边际合计 | biān jì hé jì |
| sample size/ˈsæmpl saɪz/ | 样本量 | yàng běn liàng |
| null model | 原假设模型 | yuán jiǎ shè mó xíng |
表格中的期望频数
- 对于双向列联表,在“无关系”的原假设下,每个单元格都有自己的期望频数。
- 公式:
-
$$\text{expected} = \frac{(\text{row total})(\text{column total})}{\text{grand total}}$$
- 对每个单元格分别计算。
为什么是这个公式?
- 在原假设下,两个变量无关——每一行中的列分布都相同。
- 因此,一个单元格的期望频数 =(该行的合计)$\times$(该列在总体中所占的比例)。
- 该列所占的比例是 $\dfrac{\text{column total}}{\text{grand total}}$。
- 相乘后就得到行合计$\times$列合计$\div$总计的公式。

期望频数 = 行合计 × 列合计 ÷ 总计
检查每个单元格
- 大频数条件适用于每个单元格的期望频数 $\ge 5$。
- 检查的不是观测频数,也不只是部分单元格,而是所有单元格。
- 只要有一个期望频数小于 5,就不符合这条近似计算的准则;可能需要使用其他方法。
- 计算完整的期望频数表并逐一检查。
自由度
- 对于双向列联表,$df = (\text{rows} - 1)(\text{columns} - 1)$。
- 一个 $2 \times 3$ 表 → $df = (2-1)(3-1) = 2$。
- 它表示边际合计固定后,可以“自由”变化的单元格数量。
- 它取决于表格的形状,而不是样本量。
Expected counts in a two-way table
Compute the count you would expect in a cell if the two variables were independent.
双向列联表的 $df$ 是 $(\text{rows}-1)(\text{columns}-1)$,是一个乘积,而不是(单元格数 $-1$)。一个 $2\times2$ 表的自由度是 $df=1$,而不是 $3$。对于每个单元格,期望频数公式使用行合计 $\times$ 列合计 $\div$ 总计;常见错误是弄混哪些合计应放在分子上。检查每个期望频数 $\ge 5$。
一个 $2\times2$ 表:行合计为 $60, 40$;列合计为 $50, 50$;总计为 $100$。
- 左上角单元格的期望频数:$\dfrac{60 \times 50}{100} = 30$。
- 对全部四个单元格重复计算:$30, 30, 20, 20$——全部 $\ge 5$ ✓。
- $df$:$(2-1)(2-1) = 1$。
在双向列联表中,每个单元格的期望频数 $= \frac{(\text{row total})(\text{column total})}{\text{grand total}}$(根据无关系的原假设计算)。检查每个期望频数是否都 $\ge 5$。自由度是 $(\text{rows} - 1)(\text{columns} - 1)$。
根据数据作答:求期望频数
- 一行的合计为 40,一列的合计为 30,表格总计为 100。
- 求原假设模型下该单元格的期望频数。
Under the null of independence, a cell has row total 40, column total 30 and grand total 100. What is its expected count?
Expected count is row total times column total divided by the table total.
Under the null of independence, a cell has row total 40, column total 30 and grand total 100. What is its expected count?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
1200 divided by 100 is 12.
Row total 60, column total 50, grand total 100. Find the expected count (row·col/grand).
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
60 × 50 / 100 = 30.
For a 2×3 two-way table, what are the degrees of freedom (r−1)(c−1)?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
(2−1)(3−1) = 1×2 = 2.
For a 2×2 two-way table, what are the degrees of freedom?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
(2−1)(2−1) = 1.
The large counts condition for a two-way table requires...
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
All expected cells must be at least 5.
The degrees of freedom for a two-way table are the number of cells minus 1.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
It's (rows−1)(columns−1), a product.
出了什么问题?只有网站团队能看到这些信息。