持久理解 (VAR-1): 鉴于变异可能是随机的,也可能不是随机的,因此结论具有不确定性。
学习目标 VAR-1.J: 识别由分类数据中观察值与期望值之间的计数差异所提出的问题。[技能 1.A]
- VAR-1.J.1 我们实际发现的结果与我们预期发现的结果之间的变异,可能是随机的,也可能不是随机的。
AP 统计学 · 知识点 8
7:49
分类数据的推断:卡方
掷一枚公平骰子六十次。每个面应出现十次。但从未如此——这里八次,那里十三次。差距始终存在。因此再掷一次…
英语旁白 · 英中内嵌字幕
持久理解 (VAR-1): 鉴于变异可能是随机的,也可能不是随机的,因此结论具有不确定性。
学习目标 VAR-1.J: 识别由分类数据中观察值与期望值之间的计数差异所提出的问题。[技能 1.A]
来源:College Board AP 课程与考试说明
Do Grade 10 and Grade 11 students study in different places? Ask 200 of them and the counts will never split perfectly evenly, even if grade makes no difference at all. The question this unit answers is how uneven the counts must be before chance stops being a good explanation.
When data are counts 频数 spread across several categories 类别, we test whether the observed counts 观测频数 differ from what a claim predicts. The tool is the chi-square 卡方 ($\chi^2$) statistic, which adds up the standardized gaps between observed and expected counts:
| English | 中文 | 拼音 |
|---|---|---|
| count | 频数 | pín shuò |
| observed count | 观测频数 | guān cè pín shuò |
| chi-square/kaɪ skweə/ | 卡方 | kǎ fāng |
| chi-square distribution | 卡方分布 | kǎ fāng fēn bù |
| right-skewed | 右偏的 | yòu piān de |
| degrees of freedom/dɪˈɡriːz ɒv ˈfriːdəm/ | 自由度 | zì yóu dù |
持久理解 (VAR-8): 卡方分布可用于对变异进行建模。
学习目标 VAR-8.A: 描述卡方分布。[技能 3.C]
VAR-8.A.1 分类数据的期望频数是与零假设一致的计数。通常,期望频数是样本量乘以概率。
卡方统计量衡量的是观测频数与期望频数之间的距离相对于期望频数的程度。
卡方分布具有正值且呈右偏态。在密度曲线族中,随着自由度的增加,偏斜程度会变得不那么明显。
学习目标 VAR-8.B: 识别关于一组分类数据中比例分布的检验中的零假设和备择假设。[技能 1.F]
学习目标 VAR-8.C: 识别适用于一组分类数据中比例分布的适当检验方法。[技能 1.E]
学习目标 VAR-8.D: 计算卡方拟合优度检验的期望频数。[技能 3.A]
学习目标 VAR-8.E: 验证在对卡方分布进行拟合优度检验时做出统计推断的条件。[技能 4.C]
来源:College Board AP 课程与考试说明
A goodness-of-fit (GOF) 拟合优度 test checks whether one categorical variable 分类变量 follows a claimed distribution (e.g. "the die is fair"). Hypotheses:

| English | 中文 | 拼音 |
|---|---|---|
| category/ˈkætɪɡəri/ | 类别 | lèi bié |
| goodness-of-fit/ˈɡʊdnəs ɒv fɪt/ | 拟合优度 | nǐ hé yōu dù |
| categorical variable | 分类变量 | fēn lèi biàn liàng |
| expected count/ekˈspektɪd kaʊnt/ | 期望频数 | qī wàng pín shuò |
| conditions/kənˈdɪʃnz/ | 条件 | tiáo jiàn |
持久性理解 (VAR-8): 卡方分布可用于建模变异。
学习目标 VAR-8.F: 计算拟合优度卡方检验的适当统计量。[技能 3.E]
学习目标 VAR-8.G: 确定拟合优度卡方检验显著性检验的 $p$ 值。[技能 3.E]
持久性理解 (DAT-3): 显著性检验使我们能够在特定背景下对假设做出决策。
学习目标 DAT-3.I: 解释拟合优度卡方检验的 $p$ 值。[技能 4.B]
学习目标 DAT-3.J: 根据拟合优度卡方检验的结果,就总体提出主张并提供理由。[技能 4.E]
来源:College Board AP 课程与考试说明
Compute $\chi^2=\sum\dfrac{(O-E)^2}{E}$ with $df=(\text{number of categories})-1$. Find the $p$-value P值 from the chi-square distribution (upper tail 右尾), compare to $\alpha$, and conclude in context. A large component of the sum points to the category that deviates most.

Worked example. A die rolled $60$ times gives counts $8,10,12,9,11,10$. If it is fair, each expected count is $60/6=10$, so
Worked example: unequal claimed proportions. A sweet maker claims its bags are $30\%$ red, $20\%$ green and $50\%$ yellow. A random sample of $200$ sweets has $70$ red, $30$ green and $100$ yellow.
| Colour | Red | Green | Yellow |
|---|---|---|---|
| Observed | $70$ | $30$ | $100$ |
| Expected | $200(0.30)=60$ | $200(0.20)=40$ | $200(0.50)=100$ |
The $p$-value is about $0.12>0.05$, so fail to reject $H_0$: there is not convincing evidence that the colour distribution differs from the maker's claim. The expected counts come from the claimed percentages, not from dividing $200$ equally by $3$.
p 值是测试统计量之后右尾中的面积,因此较大的 $\chi^2$ 意味着较小的 p 值。拖动 $\chi^2$ 观察该面积缩小,并拖动 df 观察整个族形的变化——小自由度时强烈右偏,随着自由度增长变得更加对称。
| English | 中文 | 拼音 |
|---|---|---|
| upper tail | 右尾 | yòu wěi |
| fail to reject/feɪl tə rɪˈdʒekt/ | 不拒绝 | bù jù jué |
持久性理解 (VAR-8): 卡方分布可用于建模变异。
学习目标 VAR-8.H: 计算分类数据的列联表中的期望频数。[技能 3.A]
来源:College Board AP 课程与考试说明
For a two-way table 双向表, the expected count in a cell (under "no association") is
Worked example. In a two-way table a cell's row total is $40$, its column total is $50$, and the grand total is $200$. Its expected count is $E=\dfrac{40\times50}{200}=10$. Repeating for every cell gives the expected table to compare against the observed one.


| English | 中文 | 拼音 |
|---|---|---|
| two-way table/tuː weɪ ˈteɪbl/ | 双向表 | shuāng xiàng biǎo |
| association/əˌsəʊsɪˈeɪʃn/ | 关联 | guān lián |
持久理解(VAR-8): 卡方分布可用于对变异进行建模。
学习目标 VAR-8.I: 识别卡方同质性检验或独立性检验的原假设与备择假设。[技能 1.F]
VAR-8.I.1 卡方同质性检验的适当假设为:
$H_0$:分类变量在不同总体或处理组中的分布没有差异。
$H_a$:分类变量在不同总体或处理组中的分布存在差异。
VAR-8.I.2 卡方独立性检验的适当假设为:
$H_0$:给定总体中两个分类变量之间不存在关联,或者这两个分类变量相互独立。
$H_a$:总体中的两个分类变量有关联或依赖。
学习目标 VAR-8.J: 识别用于比较分类数据二维表分布的适当检验方法。[技能 1.E]
学习目标 VAR-8.K: 验证在进行卡方独立性或同质性检验时的统计推断条件。[技能 4.C]
来源:College Board AP 课程与考试说明
Two tests use the same $\chi^2$ math but answer different questions:
The design (several samples vs one sample) decides which name and hypotheses to use.

| English | 中文 | 拼音 |
|---|---|---|
| test for homogeneity/test fɔː ˈhɒməʊdʒneɪti/ | 同质性检验 | tóng zhì xìng jiǎn yàn |
| test for independence/test fɔː ˌɪndɪˈpendəns/ | 独立性检验 | dú lì xìng jiǎn yàn |
持久性理解 (VAR-8): 卡方分布可用于建模变异。
学习目标 VAR-8.L: 计算适用于同质性或独立性卡方检验的统计量。[技能 3.E]
学习目标 VAR-8.M: 确定独立性或同质性卡方显著性检验的 $p$ 值。[技能 3.E]
持久性理解 (DAT-3): 显著性检验使我们能够在特定背景下对假设做出决策。
学习目标 DAT-3.K: 解释同质性或独立性卡方检验的 $p$ 值。[技能 4.B]
学习目标 DAT-3.L: 基于同质性或独立性卡方检验的结果,就总体主张提供理由。[技能 4.E]
来源:College Board AP 课程与考试说明
Compute expected counts, then $\chi^2=\sum\dfrac{(O-E)^2}{E}$ over all cells, with
Worked example: a test for independence. A random sample of 200 students at one school is classified by grade and by where they usually study.
| Library | Home | Café | Total | |
|---|---|---|---|---|
| Grade 10 | 30 | 50 | 20 | 100 |
| Grade 11 | 45 | 35 | 20 | 100 |
| Total | 75 | 85 | 40 | 200 |
The library cells contribute most: Grade 11 students chose the library more often than expected. That is worth noting as a pattern, but with this $p$-value it is not convincing evidence.
Common mistakes. Checking the condition with observed counts: it is the expected counts that must all be at least $5$. Running chi-square on percentages or means instead of counts. Using $df=n-1=199$ instead of $(r-1)(c-1)=2$. Writing $H_0$ as “grade and study place are associated”: the null hypothesis always says no association. Calling a one-sample, two-variable test “homogeneity”.
本主题旨在聚焦于在拥有多种选项后,选择恰当推断方法的技能。应为学生提供充分机会,练习何时以及如何应用所有与分类数据推断相关的学习目标。
来源:College Board AP 课程与考试说明
Decide by the setup: one categorical variable against a claimed distribution $\Rightarrow$ goodness-of-fit; one sample cross-classified by two variables $\Rightarrow$ independence; several samples/groups compared $\Rightarrow$ homogeneity. Comparing just two proportions can use either a two-proportion $z$-test or a chi-square test, but only for a two-tailed 双尾 alternative, where they agree exactly ($\chi^2=z^2$). The chi-square statistic is compared with the upper tail of its reference distribution. For two proportions it tests a non-directional alternative, so if $H_a$ is one-sided 单侧 (say $p_1>p_2$), use the $z$-test.

所有三种检验都使用相同的 $\chi^2$ 算术,因此得分关键在于命名正确的检验。设计决定了一切——取了多少个样本,以及每个单位测量了多少个变量。
| English | 中文 | 拼音 |
|---|---|---|
| two-tailed/tuː teɪld/ | 双尾 | shuāng wěi |
| one-sided | 单侧 | dān cè |
Answer each before reading the answers below.
| English | 中文 | 拼音 |
|---|---|---|
| p-value/piː ˈvæljuː/ | P值 | P zhí |
逐步完成,配合即时检查练习。
正在加载学科…