| 学习指南 EN
统计学 · CED 第8单元:分类数据的推断 · 阅读约 14 分钟 · 更新于 2026-05-11

卡方独立性检验 — AP 统计学

AP 统计学 · CED 第8单元:分类数据的推断 · 14 min read

1. 什么是卡方独立性检验? ★★☆☆☆ ⏱ 3 min

卡方独立性检验是一种假设检验方法,用于检验来自同一样本群体的两个分类变量在更大总体中是存在关联(不独立)还是相互独立。该主题占AP统计学考试总分的6-12%,通常以一道完整的4-5分简答题形式出现。

与检验单个分类变量假设分布的卡方拟合优度检验不同,该检验用于研究两个变量之间的关联,因此在社会科学和生命科学研究中被广泛使用。

2. 假设、条件与检验准备 ★★☆☆☆ ⏱ 4 min

在进行任何计算之前,你必须正确构建假设、整理观测计数的列联表,并验证所有条件。这一步在AP考试中占的分数和最终计算一样多,因此做对至关重要。

  • **原假设 ($H_0$)**: 两个分类变量在目标总体中是相互独立的(无关联)。
  • **Alternative Hypothesis ($H_a$)**: 两个分类变量在目标总体中是不独立的(存在关联)。
  • **Random**: 数据来自随机样本或随机化实验。
  • **Independence**: 个体观测之间相互独立。无放回抽样时,需要满足10%条件:样本量 < 总体的10%。
  • **Large Counts**: 所有期望单元格计数都至少为5(符合AP考试要求)。

3. 期望计数与检验统计量计算 ★★★☆☆ ⏱ 4 min

确认假设和条件后,下一步是计算期望单元格计数(即独立性原假设成立时每个单元格预期的计数)和卡方检验统计量。

期望计数的公式为:

E = \frac{(\text{Row Total}) \times (\text{Column Total})}{\text{Grand Total}}

卡方检验统计量衡量观测计数与期望计数的差异程度。任何偏离期望的情况(无论观测比期望高还是低)都会因为差值平方而增大检验统计量,公式为:

\chi^2 = \sum \frac{(O - E)^2}{E}

检验的自由度计算公式为:

df = (r - 1)(c - 1)

where $r$ is the number of rows and $c$ is the number of columns in the contingency table.

4. P值和情境化结论 ★★★☆☆ ⏱ 3 min

The final step of the test is calculating the p-value and writing a valid conclusion in context. Because any deviation from expected counts increases the $\chi^2$ test statistic, all chi-square tests for independence are right-tailed. The p-value is the probability of observing a $\chi^2$ statistic as large or larger than the one you calculated, assuming the null hypothesis is true.

Compare your p-value to the significance level $\alpha$ (almost always 0.05, unless stated otherwise):

  • If $p < \alpha$: Reject $H_0$, there is sufficient evidence of an association.
  • If $p \geq \alpha$: Fail to reject $H_0$, there is not sufficient evidence of an association.

5. 概念检测 ★★★☆☆ ⏱ 4 min

Common Pitfalls

Why: 推断是将样本结果推广到更大的总体;你已经知道样本中的计数了

Why: 学生将卡方独立性检验的自由度公式与t检验或卡方拟合优度检验的公式混淆

Why: 学生只关注卡方检验特有的大计数条件,遗漏了所有无放回抽样推断都需要的通用10%条件

Why: Students generalize that all hypothesis tests can be two-tailed, forgetting the structure of the chi-square test statistic

Why: 学生混淆了关联和因果关系,而且大多数卡方独立性检验使用观测数据

Quick Reference Cheatsheet

← 返回章节主页

某道题卡住了?
拍照或粘贴题目 — 小欧(我们的 AI 学习助手)会一步步讲解并配示意图。
免费试用小欧 →