Expected Counts in Two-Way Tables · 二维表中的期望频数
Expected counts in a table
- For a two-way table, each cell has its own expected count under the null of "no relationship."
- The formula:
-
$$\text{expected} = \frac{(\text{row total})(\text{column total})}{\text{grand total}}$$
- Compute it separately for every cell.
表格中的期望计数
- 对双向表,在“无关系”的零假设下,每个单元格都有它自己的期望计数。
- 公式:
-
$$\text{expected} = \frac{(\text{row total})(\text{column total})}{\text{grand total}}$$
- 对每个单元格分别计算。
Why that formula?
- Under the null, the two variables are unrelated — the column split is the same in every row.
- So a cell's expected count = (that row's total) $\times$ (that column's overall fraction).
- That column fraction is $\dfrac{\text{column total}}{\text{grand total}}$.
- Multiply out and you get the row$\times$column$\div$grand-total formula.
为什么是这个公式?
- 在零假设下,两个变量无关——每一行里的列分布都相同。
- 所以一个单元格的期望计数 =(该行的合计)$\times$(该列的总体占比)。
- 那个列占比是 $\dfrac{\text{column total}}{\text{grand total}}$。
- 乘开就得到行$\times$列$\div$总计数的公式。
Check every cell
- The large counts condition applies to every cell's expected count $\ge 5$.
- Not the observed counts, and not just some cells — all of them.
- One small expected cell can invalidate the whole test.
- Compute the full table of expected counts and scan it.
检查每个单元格
- 大计数条件适用于每个单元格的期望计数 $\ge 5$。
- 不是观察计数,也不只是某些单元格——是全部。
- 一个小的期望单元格就能使整个检验失效。
- 算出完整的期望计数表并扫一遍。
Degrees of freedom
- For a two-way table, $df = (\text{rows} - 1)(\text{columns} - 1)$.
- A $2 \times 3$ table → $df = (2-1)(3-1) = 2$.
- It counts the "free" cells once the margins are fixed.
- It depends on the table's shape, not the sample size.
自由度
- 对双向表,$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. · 计算若两变量独立时在单元格中预期的计数。
Two-way $df$ is $(\text{rows}-1)(\text{columns}-1)$, a product — not (cells $-1$). A $2\times2$ table has $df=1$, not $3$. And the expected-count formula uses row total $\times$ column total $\div$ grand total for each cell; mixing up which totals go on top is the usual error. Check every expected count $\ge 5$.
双向表的 $df$ 是 $(\text{rows}-1)(\text{columns}-1)$,一个乘积——不是(单元格数 $-1$)。一个 $2\times2$ 表的 $df=1$,而非 $3$。而期望计数公式对每个单元格用行合计 $\times$ 列合计 $\div$ 总计数;弄混哪些合计放在分子上是常见错误。检查每个期望计数 $\ge 5$。
A $2\times2$ table: row totals $60, 40$; column totals $50, 50$; grand total $100$.
- Expected for the top-left cell: $\dfrac{60 \times 50}{100} = 30$.
- Repeat for all four cells: $30, 30, 20, 20$ — all $\ge 5$ ✓.
- $df$: $(2-1)(2-1) = 1$.
一个 $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$。
In a two-way table, each cell's expected count $= \frac{(\text{row total})(\text{column total})}{\text{grand total}}$ (from the null of no relationship). Check that every expected count is $\ge 5$. The degrees of freedom are $(\text{rows} - 1)(\text{columns} - 1)$.
在双向表中,每个单元格的期望计数 $= \frac{(\text{row total})(\text{column total})}{\text{grand total}}$(来自无关系的零假设)。检查每个期望计数都 $\ge 5$。自由度是 $(\text{rows} - 1)(\text{columns} - 1)$。
Row total 60, column total 50, grand total 100. Find the expected count (row·col/grand). · 行总计 60,列总计 50,总合计 100。求期望计数 (行·列/总合计)。
60 × 50 / 100 = 30.
For a 2×3 two-way table, what are the degrees of freedom (r−1)(c−1)? · 对于 2×3 二维表,自由度 (r−1)(c−1) 是多少?
(2−1)(3−1) = 1×2 = 2.
For a 2×2 two-way table, what are the degrees of freedom? · 对于 2×2 二维表,自由度是多少?
(2−1)(2−1) = 1.
The large counts condition for a two-way table requires... · 二维表的大样本条件要求...
All expected cells must be at least 5. · 所有期望单元格必须至少为 5。
The degrees of freedom for a two-way table are the number of cells minus 1. · 二维表的自由度是单元格数减 1。
It's (rows−1)(columns−1), a product. · 它是 (行数−1)(列数−1),一个乘积。