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

Contingency Tables in Chi-Square Tests | 列联表在卡方检验中的应用

2026-08-30 12:21 · 本文部分内容由AI辅助创作

📚 Contingency Tables in Chi-Square Tests | 列联表在卡方检验中的应用

In A-Level Further Mathematics, the chi-square (χ²) test is one of the most versatile tools for analysing categorical data. When we wish to determine whether two categorical variables are associated, we organise the observed frequencies into a contingency table and apply the chi-square test of independence. This article provides a complete, exam-focused guide to constructing, analysing, and interpreting contingency tables, tailored specifically to the Edexcel specification.

在A-Level进阶数学中,卡方检验(χ²)是分析分类数据最灵活、最强大的工具之一。当我们希望判断两个分类变量之间是否存在关联时,我们会将观测频数整理成列联表,并运用卡方独立性检验。本文将针对Edexcel考试大纲,提供一份完整且紧扣考点的指南,涵盖列联表的构建、分析和结果解读。


1. What Is a Contingency Table? | 什么是列联表?

A contingency table, also known as a cross-tabulation or two-way table, displays the frequency distribution of two categorical variables simultaneously. The categories of one variable define the rows, while the categories of the other variable define the columns. Each cell contains the observed frequency O — the number of individuals falling into that particular combination of categories.

列联表又称交叉分类表或二维表,它同时展示两个分类变量的频数分布。一个变量的各个类别构成行,另一个变量的各个类别构成列。每个单元格中包含观测频数O,即落入该类别组合的个体数量。

The totals at the end of each row and each column are called marginal totals. The overall total N is the grand total of all observations. Marginal totals are essential because they are used to calculate expected frequencies, as we shall see in Section 4.

每一行末尾和每一列末尾的合计称为边际合计。全部观测值的总和称为总计N。边际合计至关重要,因为我们将用它们来计算期望频数,详见第4节。

For example, a 2 × 3 contingency table has the following general layout:

例如,一个2×3列联表的基本布局如下:

Column 1Column 2Column 3Row Total
Row 1O₁₁O₁₂O₁₃R₁
Row 2O₂₁O₂₂O₂₃R₂
Column TotalC₁C₂C₃N

Here, Oᵢⱼ neral, an r × c contingency table has r rows and c columns, giving a total of r × c cells.

其中Oᵢⱼ表示第i行第j列的观测频数。一般而言,r×c列联表有r行c列,共包含r×c个单元格。


2. The Chi-Square Test Statistic | 卡方检验统计量

The chi-square test of independence compares the observed frequencies O with the frequencies we would expect if the two variables were independent. The test statistic measures the overall discrepancy between O and E across all cells.

卡方独立性检验将观测频数O与两个变量相互独立时应当出现的期望频数E进行比较。检验统计量衡量所有单元格中O与E之间的总体偏差。

The test statistic is defined as:

检验统计量的定义为:

χ² = Σ (O − E)² / E

ed frequency in each cell, and E is the corresponding expected frequency. The statistic follows a chi-square distribution with (r − 1)(c − 1) degrees of freedom, provided the expected frequencies are sufficiently large.

其中求和覆盖表中全部r×c个单元格,O是每个单元格的观测频数,E是相应的期望频数。在期望频数足够大的前提下,该统计量服从自由度为(r − 1)(c − 1)的卡方分布。

A small value of χ² indicates that the observed frequencies are close to the expected frequencies, suggesting that the variables may indeed be independent. A large value of χ² indicates a substantial discrepancy, providing evidence against the null hypothesis of independence.

χ²的值较小说明观测频数与期望频数接近,提示变量之间可能确实相互独立。χ²的值较大则说明存在显著差异,为拒绝独立性原假设提供了证据。


3. Degrees of Freedom | 自由度

quare test of independence on an r × c contingency table are calculated using the formula:

对于r×c列联表的卡方独立性检验,自由度(df)的计算公式为:

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

where r is the number of rows and c is the number of columns. The logic is that once the marginal totals are fixed, only (r − 1)(c − 1) of the cell frequencies are free to vary independently.

其中r为行数,c为列数。其原理在于:当边际合计固定后,只剩下(r − 1)(c − 1)个单元格频数可以自由变化。

对于2×2表:df = (2 − 1)(2 − 1) = 1;对于2×3表:df = (2 − 1)(3 − 1) = 2;对于3×4表:df = (3 − 1)(4 − 1) = 6。

The degrees of freedom determine which critical value from the chi-square distribution table should be used for the test. In the Edexcel exam, you will be given a table of critical values for various significance levels and degrees of freedom.

自由度决定了应查阅卡方分布表中哪一个临界值。在Edexcel考试中,试题会提供不同显著性水平和自由度对应的临界值表。


4. Calculating Expected Frequencies | 计算期望频数

Under the null hypothesis that the two variables are independent, the expected frequency for the cell in row i and column j is given by:

在原假设认为两个变量相互独立的前提下,第i行第j列的期望频数由下式给出:

Eᵢⱼ = (Rᵢ × Cⱼ) / N

where Rᵢ is the total of row i, Cⱼ nd column j is P(row i) × P(column j), and the expected count is N times this probability.

其中Rᵢ为第i行合计,Cⱼ为第j列合计,N为总计。该公式直接源于概率乘法法则:若事件相互独立,落入第i行和第j列的概率为P(第i行) × P(第j列),期望计数即为N乘以该概率。

It is important to remember that expected frequencies do not have to be integers — they are often decimal values. In your calculations, keep at least two decimal places throughout, and round only at the final stage if necessary.

务必注意:期望频数不一定是整数,通常为小数。在计算过程中请至少保留两位小数,仅在最终结论时按需四舍五入。

If any expected frequency is less than 5, the chi-square approximation may not be valid. In such cases, adjacent categories may need to be combined, provided this is meaningful. This condition will be examined in greater detail in Section 5.

若任一期望频数小于5,卡方近似可能失效。此时可考虑合并相邻类别(前提是合并具有实际意义)。这一条件将在第5节中详细讨论。


广告 / Sponsored

5. Conditions and Assumptions | 检验条件与假设

Before applying the chi-square test of independence, the following conditions must be satisfied:

在运用卡方独立性检验之前,必须满足以下条件:

Violating these conditions can lead to an unreliable test statistic and incorrect conclusions. In the exam, always explicitly state that you have checked these conditions before proceeding with the test.

违反这些条件可能导致检验统计量不可靠,进而得出错误结论。考试中,请务必明确说明你已检查这些条件,然后再进行检验。


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

The chi-square test of independence follows a standard hypothesis-testing procedure. Master the following six steps to secure full marks:

卡方独立性检验遵循标准的假设检验步骤。掌握以下六个步骤,即可在考试中稳拿满分:


7. Worked Example | 例题精解

Let us work through a complete example to illustrate the full procedure.

让我们通过一个完整例题来演示整个过程。

A researcher wishes to investigate whether there is an association between gender and subject preference among Sixth Form students. A random sample of 200 students was asked to choose their favourite subject from Mathematics, Physics, and Chemistry. The results are shown below.

某研究者希望调查高中生性别与科目偏好之间是否存在关联。随机抽取200名学生,要求他们在数学、物理和化学中选出最喜欢的科目。结果如下表所示。

MathematicsPhysicsChemistryTotal
Male40302090
Female354035110
Total757055200

Step 1: State the hypotheses.

第1步:写出假设。

H₀: Gender and subject preference are independent.

H₁: Gender and subject preference are not independent.

We test at the 5% significance level.

我们以5%的显著性水平进行检验。

Step 2: The observed frequencies are already given in the table above, with row totals 90 and 110, column totals 75, 70 and 55, and grand total 200.

第2步:观测频数已在上表中给出,行合计为90和110,列合计为75、70和55,总计为200。

Step 3: Calculate the expected frequencies using E = (row total × column total) / 200.

第3步:使用E = (行合计 × 列合计) / 200计算期望频数。

男性-数学:E = (90 × 75) / 200 = 33.75;男性-物理:E = (90 × 70) / 200 = 31.50;男性-化学:E = (90 × 55

Published by TutorHao | A-Level 进阶数学 Revision Series | aleveler.com

广告 / Sponsored
培生爱德思考试教材 统计数学3 Edexcel International A Level Mathematics S…
数学 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥156.0

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

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