← 返回资讯屏轩教育 · 行业资讯

Using Contingency Tables | 列联表的应用

2026-08-02 17:18 · 本文部分内容由AI辅助创作

📚 Using Contingency Tables | 列联表的应用

A contingency table is a powerful tool in statistics for summarising the relationship between two categorical variables. In the Edexcel A-Level Mathematics syllabus, you will learn how to construct these tables, calculate probabilities, and carry out chi-squared tests for independence. This revision guide walks you through every essential concept, from basic probability to hypothesis testing, ensuring you are fully prepared for exam questions on contingency tables.

列联表是统计学中用于概括两个分类变量之间关系的重要工具。在 Edexcel A-Level 数学大纲中,你将学习如何构建这些表格、计算概率并执行卡方独立性检验。这篇复习指南将带你走遍每一个重要概念,从基础概率到假设检验,确保你为列联表相关的考试题目做好充分准备。


1. Introduction to Contingency Tables | 列联表简介

A contingency table (also called a two-way table) displays the frequencies of observations for two categorical variables. Each cell shows the count of individuals that belong to a particular combination of categories. These tables help us investigate whether there is an association between the variables.

列联表(也称双向表)展示两个分类变量的观测频数。每个单元格显示属于特定类别组合的个体计数。这些表格有助于我们研究变量之间是否存在关联。


2. Constructing a Contingency Table | 构建列联表

To build a contingency table, choose one variable for the rows and the other for the columns. Count how many data points fall into each intersection and record the totals. Always include row totals, column totals, and the overall grand total, as these are vital for further calculations.

构建列联表时,选择一个变量作为行,另一个作为列。统计数据点落入每个交叉点的数量并记录频数。务必包含行合计、列合计以及总合计,因为它们对后续计算至关重要。

For example, a survey asks 200 students about their gender (Male/Female) and whether they enjoy mathematics (Yes/No). The observed frequencies can be arranged as:

例如,一项调查询问了 200 名学生关于性别(男/女)和是否喜欢数学(是/否)。观测频数可排列如下:

YesNoTotal
Male7040110
Female603090
Total13070200

3. Joint, Marginal, and Conditional Probabilities | 联合概率、边际概率与条件概率

Joint probability refers to the probability of two events occurring together, calculated as cell frequency divided by grand total. Marginal probability looks at the probability of a single event, using row or column totals. Conditional probability is the probability of one event given that another event has occurred, found by restricting the table to a specific row or column.

联合概率指两个事件同时发生的概率,用单元格频数除以总合计计算。边际概率着眼于单个事件的概率,使用行合计或列合计。条件概率是在已知另一事件发生的情况下某事件发生的概率,通过将表格限制在特定行或列来求得。

. The conditional probability that a student enjoys maths given they are Male is 70/110 ≈ 0.636.

在我们的例子中,男性且喜欢数学的联合概率是 70/200 = 0.35。喜欢数学的边际概率是 130/200 = 0.65。在已知学生为男性的条件下喜欢数学的条件概率是 70/110 ≈ 0.636。


4. Expected Frequencies and Association | 期望频数与关联性

If the two variables are independent, we can calculate the expected frequency for each cell using the formula:

如果两个变量独立,我们可以使用以下公式计算每个单元格的期望频数:

Eᵢⱼ = (Row Totalᵢ × Column Totalⱼ) / Grand Total

The expected frequencies represent what we would expect to see if there were no association. Comparing observed and expected values helps us assess independence.

期望频数表示在没有关联的情况下我们预期会看到的数值。比较观测值与期望值有助于我们评估独立性。

= 71.5. The expected number for Females who do not enjoy maths is (90 × 70) / 200 = 31.5.

使用第 2 节的表格,预期喜欢数学的男性人数为 (110 × 130) / 200 = 71.5。预期不喜欢数学的女性人数为 (90 × 70) / 200 = 31.5。


5. The Chi-squared Test for Independence | 卡方独立性检验

To formally test whether an association exists, we use the chi-squared (χ²) test for independence. The null hypothesis H₀ states that the two variables are independent, while the alternative hypothesis H₁ states they are not independent (they are associated).

为了正式检验是否存在关联,我们使用卡方(χ²)独立性检验。原假设 H₀ 声明两个变量独立,而备择假设 H₁ 声明它们不独立(存在关联)。

The test compares observed frequencies, O, with expected frequencies, E, across all cells. A large discrepancy leads to a large χ² statistic, providing evidence against H₀.

检验比较所有单元格的观测频数 O 与期望频数 E。差异较大会导致较大的 χ² 统计量,从而提供反对 H₀ 的证据。


6. Calculating the Chi-squared Statistic | 计算卡方统计量

The test statistic is given by:

检验统计量由下式给出:

χ² = ∑ (Oᵢⱼ − Eᵢⱼ)² / Eᵢⱼ

where Oᵢⱼ is the observed frequency in the i-th row and j-th column, Eᵢⱼ is the corresponding expected frequency, and the sum is taken over all cells. Always use the unrounded expected values to avoid rounding errors.

其中 Oᵢⱼ 是第 i 行第 j 列的观测频数,Eᵢⱼ 是对应的期望频数,求和涵盖所有单元格。始终使用未四舍五入的期望值以避免舍入误差。

5 + (60−58.5)²/58.5 + (30−31.5)²/31.5 ≈ 0.031 + 0.058 + 0.038 + 0.071 = 0.198 (to 3 d.p.).

对于一个 2×2 表格,计算很直接。使用我们的数据: 40−38.5)²/38.5 + (60−58.5)²/58.5 + (30−31.5)²/31.5 ≈ 0.031 + 0.058 + 0.038 + 0.071 = 0.198(保留三位小数)。


广告 / Sponsored

7. Degrees of Freedom and Critical Values | 自由度与临界值

The degrees of freedom (df) for a contingency table with r rows and c columns is:

对于有 r 行和 c 列的列联表,自由度(df)为:

df = (r − 1)(c − 1)

e the calculated χ² statistic with a critical value from the χ² distribution table, typically at a 5% significance level.

对于 2×2 表格,df = 1。你将把计算出的 χ² 统计量与 χ² 分布表中的临界值进行比较,通常在 5% 显著性水平下。

The critical value for df = 1 at the 5% n our example, 0.198 < 3.841, so there is insufficient evidence to suggest an association.

在 5% 水平下,df = 1 的临界值为 3.841。如果 χ² > 3.841,我们拒绝 H₀。在我们的例子中,0.198 < 3.841,因此没有足够证据表明存在关联。


8. Hypothesis Testing Procedure | 假设检验步骤

Follow these steps systematically in an exam:

在考试中系统性地遵循以下步骤:


9. Interpreting Results and P-values | 解读结果与P值

If your calculator provides a p-value, you can compare it directly with the significance level α (usually 0.05). Reject H₀ if p < α. A small p-value indicates that the observed deviation from independence is unlikely to have occurred by chance.

如果你的计算器提供了 p 值,你可以直接将其与显著性水平 α(通常为 0.05)进行比较。若 p < α 则拒绝 H₀。小的 p 值表明观测到的偏离独立性不太可能由偶然因素造成。

In our worked example, the p-value would be approximately 0.656, which is much larger than 0.05, confirming we do not reject H₀.

在我们的案例中,p 值约为 0.656,远大于 0.05,确认我们不拒绝 H₀。


10. Assumptions and Conditions | 假设与条件

The chi-squared test for independence relies on certain conditions. All expected frequencies should be at least 5. If this is not met, consider merging categories or using an alternative test. The data must be independent random samples, and the variables categorical.

卡方独立性检验依赖于特定条件。所有期望频数应至少为 5。若不满足,可考虑合并类别或使用替代检验。数据必须是独立的随机样本,且变量为分类变量。

For a 2×2 table, some exam boards apply Yates' continuity correction, but Edexcel does not require this for A-Level Mathematics. Always rely on the standard formula unless instructed otherwise.

对于 2×2 表格,某些考试局使用 Yates 连续性校正,但 Edexcel 在 A-Level 数学中不要求此校正。除非另有指示,始终使用标准公式。


11. Worked Example | 案例分析与例题

A researcher wishes to test whether voting preference (Party A, Party B) is independent of gender. A sample of 300 people yields the following contingency table:

一位研究者想要检验投票偏好(政党 A、政党 B)是否独立于性别。一个 300 人的样本得到如下列联表:

Party AParty BTotal
Male9060150
Female8070150
Total170130300

Step 1: Hypotheses. H₀: Gender and voting preference are independent. H₁: They are not independent.

步骤 1:假设。H₀:性别与投票偏好独立。H₁:它们不独立。

Step 2: Expected frequencies. 130)/300 = 65. Female & Party A: (150×170)/300 = 85. Female & Party B: (150×130)/300 = 65.

步骤 2:期望频数。男性 & 政党 A:(150×170)/300 = 85。男性 & 政党 B:(150×130)/300 = 65。女性 & 政党 A:(150×170)/300 = 85。女性 & 政党 B:(150×130)/300 = 65。

Step 3: χ² calculation. 0−65)²/65 = (25/85) + (25/65) + (25/85) + (25/65) ≈ 0.294 + 0.385 + 0.294 + 0.385 = 1.358.

步骤 3:计算 χ²。 70−65)²/65 = (25/85) + (25/65) + (25/85) + (25/65) ≈ 0.294 + 0.385 + 0.294 + 0.385 = 1.358。

Step 4: Degrees of freedom. df = (2−1)(2−1) = 1. Critical value at 5% level is 3.841.

步骤 4:自由度。df = (2−1)(2−1) = 1。5% 水平的临界值为 3.841。

Step 5: Conclusion. Since 1.358 < 3.841, we do not reject H₀. There is insufficient evidence of an association between gender and voting preference.

步骤 5:结论。因为 1.358 < 3.841,我们不拒绝 H₀。没有足够证据表明性别与投票偏好之间存在关联。


12. Common Mistakes and Tips | 常见错误与技巧

Many students forget to subtract 1 from both rows and columns when computing degrees of freedom. Always check that expected frequencies are at least 5; if not, state that the test may be invalid. Use precise values in the χ² sum — do not round intermediate expected frequencies.

许多学生在计算自由度时忘记从行数和列数各减 1。务必检查期望频数是否至少为 5;如果不满足,应说明检验可能无效。在 χ² 求和中使用精确值——不要对中间的期望频数进行四舍五入。

When writing conclusions, refer back to the context of the problem. Avoid saying 'accept H₀'; instead say 'do not reject H₀' or 'insufficient evidence to reject H₀'. Also be careful to state the correct critical value for the given significance level.

撰写结论时,要回到问题背景。避免说“接受 H₀”,而要说“不拒绝 H₀”或“证据不足以拒绝 H₀”。还要注意在给定的显著性水平下陈述正确的临界值。

Published by TutorHao | Mathematics Revision Series | aleveler.com

广告 / Sponsored
英文原版 Collins International Primary Computing 柯林斯国际小学计算机科学学生…
计算机 备考教辅 · 正版现货 · 与本文同科同级别
查看详情 / View on Taobao

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao