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

The χ² (chi-squared) test | χ²(卡方)检验

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

📚 The χ² (chi-squared) test | χ²(卡方)检验

The χ² (chi-squared) test is a fundamental statistical tool used extensively in A‑Level Biology to compare observed experimental data with expected theoretical results. It allows biologists to determine whether any deviation between observation and expectation is due to random chance or whether it points to a significant underlying factor, such as a different inheritance pattern, sampling bias, or an incorrect hypothesis. Mastering this test equips students with the ability to handle quantitative data, interpret biological variation, and draw evidence‑based conclusions from experiments like genetic crosses, ecological surveys, and enzyme‑activity measurements.

χ²(卡方)检验是 A‑Level 生物学中广泛使用的基础统计工具,用以比较实验观察数据与理论预期结果。它帮助生物学家判断观察值与预期值之间的偏离究竟是随机偶然导致,还是指向某个显著的内在因素,例如不一样的遗传模式、取样偏差或者错误的假设。掌握这一检验能让学生具备处理定量数据的能力,能解读生物学中的变异,并能从遗传杂交、生态调查和酶活性测量等实验中得出基于证据的结论。


1. What is the chi‑squared test? | 什么是卡方检验?

The chi‑squared test is a non‑parametric statistical procedure that assesses how well a set of observed frequencies matches a set of expected frequencies. In biology, it is most frequently employed for categorical data – phenotypes, genotypes, presence/absence records – rather than continuous measurements. The test produces a test statistic, χ², which is then compared against a critical value from the chi‑squared distribution to judge the goodness of fit between data and a hypothesis.

卡方检验是一种非参数统计方法,用来评价一组观察频数与一组预期频数的吻合程度。在生物学中,它最常用于分类数据——如表型、基因型、有/无记录——而非连续测量值。检验会计算出一个检验统计量 χ²,随后将其与卡方分布中的临界值比较,从而判断数据与假设之间的拟合优度。


2. When to use the χ² test in biology | 生物学中何时使用卡方检验

The test is appropriate when you have counts (frequencies) of individuals or events that fall into discrete categories. Common A‑Level scenarios include testing Mendelian ratios in genetic crosses (e.g. 9:3:3:1, 3:1, 1:1), checking whether the distribution of organisms in a habitat fits a random or expected pattern, and evaluating whether observed mortality rates match a predicted value. The data must be independent, meaning each observation belongs to only one category, and the total sample size should be reasonably large (typically at least 20, with no expected frequency below 5).

当你拥有落入不同离散类别的个体或事件的计数(频数)时,即可使用卡方检验。A‑Level 常见的场景包括检验遗传杂交中的孟德尔比率(如 9:3:3:1、3:1、1:1),检查栖息地中生物分布是否符合随机或预期模式,以及评估观察到的死亡率是否与预测值匹配。数据必须相互独立,即每个观测只属于一个类别,且总样本量应足够大(通常至少为 20,且没有任何预期频数低于 5)。


3. Formulating null and alternative hypotheses | 提出零假设与备择假设

Every χ² test begins with a null hypothesis (H₀): there is no significant difference between the observed and expected frequencies – any deviation is purely due to chance. The alternative hypothesis (H₁) states that a significant difference does exist, implying the factor under investigation (such as a particular gene linkage) has a real effect. For a monohybrid cross expecting a 3:1 ratio, H₀ would be ‘the observed offspring ratio conforms to a 3:1 Mendelian ratio’, while H₁ would be ‘the observed ratio deviates significantly from 3:1’.

每一次卡方检验都始于零假设 (H₀):观察频数与预期频数之间没有显著差异——任何偏离纯属偶然。备择假设 (H₁) 则声称存在显著差异,意味着所研究的因素(如某个基因连锁)确实产生了效应。对于一个预期 3:1 比率的单基因杂交,H₀ 可以是“后代表现型比率符合 3:1 孟德尔比率”,而 H₁ 则为“观察比率显著偏离 3:1”。


4. The χ² formula | 卡方公式

The test statistic is computed by summing the squared differences between observed (O) and expected (E) values, each divided by the expected value:

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

Where O is the observed count for a category, E is the expected count for that category, and the summation Σ runs over all categories. Squaring the differences ensures both positive and negative deviations contribute positively to the statistic, while dividing by E normalises for the scale of each category.

检验统计量的计算方式为:将每个类别中观察值 (O) 与预期值 (E) 的差值平方,除以该预期值,再对所有类别求和:

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

其中 O 是类别的观察频数,E 是该类别的预期频数,∑ 表示对所有类别求和。差值平方使正负偏差都正向地贡献统计量,除以 E 则根据各类别的大小进行归一化处理。


5. Calculating expected values | 计算预期值

r of offspring by the proportion expected for each phenotype. For instance, in a dihybrid F₂ cross with 560 offspring and a 9:3:3:1 ratio, the expected numbers are: (9/16)×560 = 315, (3/16)×560 = 105, (3/16)×560 = 105, and (1/16)×560 = 35. It is essential to use the exact fractions, not rounded percentages, to maintain precision.

预期频数来源于被检验的假设。在预测表型比率的遗传杂交中,将后代总数乘以每种表型的预期比例。例如,在一个双基因杂交 F₂ 代中,有 560 个后代,预期 9:3:3:1 比率,则预期值分别为:(9/16)×560 = 315,(3/16)×560 = 105,(3/16)×560 = 105,(1/16)×560 = 35。必须使用精确分数,而非取整的百分数,以保持精度。


6. Degrees of freedom | 自由度

s − 1. The subtraction accounts for the fact that fixing the total sample size imposes one constraint. In a four‑ o that was derived from a genetic cross where some parameters were estimated from the data – though rare at A‑Level – further adjustments may be needed.

自由度 (df) 代表可以进行独立比较的数目。对于拟合优度的卡方检验,df = 类别数 − 1。减去 1 是因为固定样本总数这一条件对数据施加了一个约束。在一个有四类表型的双基因杂交中,df = 4 − 1 = 3。当检验的比率基于从数据中估算参数的遗传杂交时(在 A‑Level 中较少见),可能还需进一步调整。


广告 / Sponsored

7. Probability and critical values | 概率与临界值

is compared with a critical value from the χ² distribution at a chosen significance level – = 0.05. A typical critical value table gives thresholds for different degrees of freedom:

Degrees of freedom p = 0.05 p = 0.01
13.846.63
25.999.21
37.8111.34
49.4913.28

the calculated χ² exceeds the critical value at p = 0.05, the null hypothesis is rejected – ly significant. If it is smaller, we conclude there is insufficient evidence to reject H₀.

计算出 χ² 后,将其与所选显著性水平下(通常 p = 0.05)的卡方分布临界值进行比较。一个典型的临界值表给出不同自由度的阈值。若计算出的 χ² 大于 p = 0.05 的临界值,则拒绝零假设——差异具有统计显著性。若小于临界值,则得出结论:没有足够证据拒绝 H₀。


8. Interpreting the result | 解释结果

A significant result (p < 0.05) suggests the observed deviation is unlikely to be due to chance alone. For example, if a genetic cross gives a χ² of 8.9 with 3 degrees of freedom, it exceeds the critical value 7.81, so we reject the hypothesis of a 9:3:3:1 ratio. This might indicate gene linkage, differential mortality, or experimental error. Conversely, a non‑significant result (χ² < critical value) means the data are consistent with the null hypothesis – chance alone can explain the variation.

显著的结果(p < 0.05)表明观察到的偏离不太可能仅仅由偶然造成。例如,某遗传杂交在 3 个自由度下得出 χ² = 8.9,超出了临界值 7.81,因此我们拒绝 9:3:3:1 比率的假设。这可能意味着基因连锁、差别致死率或实验误差。相反,不显著的结果(χ² < 临界值)意味着数据与零假设一致——仅凭偶然就能解释这种变异。


9. Worked example: Mendelian dihybrid cross | 解题示例:孟德尔双基因杂交

In one of Gregor Mendel’s classic experiments, he crossed pea plants heterozygous for seed colour (yellow, Y; green, y) and seed shape (round, R; wrinkled, r). The F₂ generation produced the following counts: yellow‑round 315, yellow‑wrinkled 101, green‑round 108, green‑wrinkled 32. The total is 556. The theory predicts a 9:3:3:1 ratio, giving expected values of 312.75, 104.25, 104.25, and 34.75, respectively.

在格雷戈尔·孟德尔的经典实验中,他将种子颜色(黄色 Y,绿色 y)和种子形状(圆形 R,皱缩 r)均为杂合的豌豆植株杂交。F₂ 代产生了以下计数:黄圆 315,黄皱 101,绿圆 108,绿皱 32。总数为 556。理论预测 9:3:3:1 比率,预期值分别为 312.75、104.25、104.25 和 34.75。

Applying the χ² formula:

− 312.75)²/312.75 + (101 − 104.25)²/104.25 + (108 − 104.25)²/104.25 + (32 − 34.75)²/34.75

χ² ≈ 0.016 + 0.101 + 0.135 + 0.218 = 0.470

<< 7.81, the result is not significant; the data fit the 9:3:3:1 ratio well, supporting Mendel’s law of independent assortment.

应用 χ² 公式计算得 χ² ≈ 0.470。共有 4 个类别,df = 3。p = 0.05 时临界值为 7.81。由于 0.470 远小于 7.81,结果不显著;数据很好地拟合了 9:3:3:1 比率,支持孟德尔的自由组合定律。


10. Yates' correction for continuity | 耶茨连续性校正

tingency table with only one degree of freedom, the calculated χ² tends to be slightly inflated, increasing the risk of a false positive. Yates' correction subtracts 0.5 from each |O − E| difference before squaring:

χ² = Σ [(|O − E| − 0.5)² / E]

This correction is expected at some A‑ stead for 2×2 tables; exam questions will normally direct you if the correction is required.

当卡方检验用于自由度仅为 1 的 2×2 列联表时,计算出的 χ² 值往往略微偏高,增加假阳性风险。耶茨校正通过在平方前从每个 |O − E| 差值中减去 0.5:χ² = Σ [(|O − E| − 0.5)² / E]。在某些 A‑Level 考试大纲中,当检验如 1:1 比率且样本量较小时,可能需要使用该校正。不过,许多现代生物学家主张对 2×2 表改用费希尔精确检验;考试题目通常会明确说明是否需要校正。


11. Common pitfalls and assumptions | 常见误区与假设

Students frequently forget to check the assumptions of the test. The data must be counts, not percentages or proportions. Expected frequencies should ideally all be 5 or more; if a category has an expected count below 5, it is sometimes permissible to pool adjacent categories, but only if biologically meaningful. Another mistake is confusing ‘no significant difference’ with ‘proving the null hypothesis’ – the test merely assesses evidence against H₀, it does not prove H₀ is true.

学生常常忘记检查卡方检验的前提假设。数据必须是计数,而非百分比或比例。预期频数最好都 ≥ 5;如果某类别预期计数低于 5,有时允许合并相邻类别,但前提是合并后在生物学上有意义。另一个错误是混淆“没有显著差异”与“证明零假设正确”——检验仅评估反对 H₀ 的证据,而不证明 H₀ 为真。


12. χ² in ecology and other contexts | 生态学及其他情境中的卡方

Beyond genetics, the χ² test is widely used in ecology to examine whether the distribution of organisms fits a random, uniform, or clumped pattern by comparing observed counts per quadrat with the Poisson distribution. It can also test whether allele frequencies in a population are in Hardy–Weinberg equilibrium, by comparing observed genotype numbers with those predicted from allele frequencies. In each case, the logic remains the same: formulate a null expectation, compute χ², and consult a critical value table to guide the conclusion.

除遗传学外,卡方检验广泛用于生态学,通过将样方内的观察计数与泊松分布进行比较,检测生物分布是否符合随机、均匀或聚集模式。它还可以检验种群中等位基因频率是否符合哈代–温伯格平衡,方法是将观察到的基因型数目与根据等位基因频率预测的数目进行对比。每种情境下的逻辑始终相同:提出零假设下的预期,计算 χ²,并查阅临界值表以得出结论。

Published by TutorHao | Biology Revision Series | aleveler.com

广告 / Sponsored
现货 Cambridge Biology for the IB Diploma coursebook 剑桥国际文凭 I…
生物 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥546.0

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

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