📚 Type I and Type II Errors in Hypothesis Testing | 假设检验中的两类错误
In statistical hypothesis testing, errors are inevitable because decisions are based on sample data rather than complete population information. Understanding the two types of errors – Type I and Type II – is fundamental for interpreting test results correctly and for designing experiments with adequate power.
在统计假设检验中,由于决策基于样本数据而非总体信息,错误不可避免。理解第一类错误和第二类错误这两类错误,对于正确解读检验结果和设计具有足够功效的实验至关重要。
1. What is Hypothesis Testing? | 什么是假设检验?
A hypothesis test is a formal statistical procedure used to evaluate a claim about a population parameter. We collect a random sample, compute a test statistic, and decide whether the data provide enough evidence to reject the initial assumption.
假设检验是一种正式统计程序,用于评估关于总体参数的某个主张。我们收集随机样本,计算检验统计量,并判断数据是否提供足够证据来拒绝最初的假定。
The starting point, called the null hypothesis, typically states 'no effect' or 'no difference'. The test quantifies how unlikely the observed sample result would be if the null hypothesis were true.
起点被称为原假设,通常表述为“无效应”或“无差异”。检验量化了在原假设为真的条件下,观测到如此样本结果的不可能性。
2. Null and Alternative Hypotheses | 原假设与备择假设
The null hypothesis H₀ represents the status quo. The alternative hypothesis H₁ represents what we suspect might be true. A test can be one-tailed or two-tailed, depending on H₁.
原假设 H₀ 代表默认状态。备择假设 H₁ 代表我们怀疑可能为真的情况。根据 H₁ 的形式,检验可以是单尾或双尾的。
H₀: μ = μ₀, H₁: μ > μ₀ (right-tailed)
H₀: μ = μ₀, H₁: μ ≠ μ₀ (two-tailed)
Choosing the correct form of H₁ is essential because it determines the rejection region and the way errors are calculated.
选择正确的 H₁ 形式至关重要,因为它决定了拒绝域以及错误计算的方式。
3. Decision Outcomes: A 2×2 Framework | 决策结果:2×2 框架
Every hypothesis test leads to one of four outcomes, depending on the true state of nature and the decision made. These are best displayed in a contingency table.
每次假设检验都会得到四种结果之一,取决于真实自然状态和所作决策。这些结果最好用列联表来展示。
| H₀ True | H₀ False | |
|---|---|---|
| Reject H₀ | Type I Error (α) | Correct Decision (Power = 1 – β) |
| Do not reject H₀ | Correct Decision (1 – α) | Type II Error (β) |
Only two of the four cells represent errors: a Type I error occurs when we reject a true H₀, and a Type II error occurs when we fail to reject a false H₀.
四个单元格中只有两个代表错误:当我们拒绝一个为真的 H₀ 时发生第一类错误,当我们未能拒绝一个为假的 H₀ 时发生第二类错误。
4. Type I Error: False Positive | 第一类错误:假阳性
A Type I error is often called a false positive. It means the test concludes there is an effect when, in reality, none exists. The probability of committing a Type I error is denoted by α.
第一类错误常被称作假阳性。它意味着检验得出结论存在效应,而实际上并不存在。犯第一类错误的概率记为 α。
For example, a medical test might indicate a patient has a disease when they are actually healthy. In a court trial, it is like convicting an innocent person.
例如,一项医学检测可能指示患者患有疾病,而实际上他们是健康的。在法庭审判中,这类似于给无辜者定罪。
The researcher controls α by setting the significance level before the experiment. Typical values are 0.05, 0.01 or 0.10.
研究人员通过在实验前设定显著性水平来控制 α。典型值有 0.05、0.01 或 0.10。
5. Significance Level (α) | 显著性水平 (α)
The significance level α is the probability of rejecting H₀ when it is actually true. It defines the critical region – the set of test statistic values that lead to rejection.
显著性水平 α 是当 H₀ 实际为真时拒绝它的概率。它定义了临界域——导致拒绝的检验统计量取值的集合。
For a right-tailed test: Reject H₀ if z > z_α
For a two-tailed test: Reject H₀ if |z| > zα/₂
Lowering α reduces the chance of a Type I error but simultaneously makes it harder to reject H₀, which can increase the risk of a Type II error.
降低 α 会减少第一类错误的概率,但同时使拒绝 H₀ 更难,这可能增加第二类错误的风险。
6. Type II Error: False Negative | 第二类错误:假阴性
A Type II error is a false negative. It occurs when the test fails to detect a real effect, i.e. we do not reject H₀ when H₁ is true. Its probability is β.
第二类错误是假阴性。它发生在检验未能检测到一个真实效应时,即当 H₁ 为真时我们没有拒绝 H₀。其概率为 β。
In medical screening, a Type II error means a diseased patient is told they are healthy – a potentially dangerous mistake. The complement, 1 – β, is called the power of the test.
在医学筛查中,第二类错误意味着一个患有疾病的患者被告知是健康的——一个潜在危险的错误。其补集 1 – β 被称为检验的功效。
7. Power of the Test (1 – β) | 检验的功效 (1 – β)
The power of a hypothesis test is the probability of correctly rejecting a false null hypothesis. High power means we are likely to detect an effect when it truly exists.
假设检验的功效是正确拒绝一个错误原假设的概率。高功效意味着当效应真实存在时,我们很有可能检测到它。
Power = P(Reject H₀ | H₁ is true) = 1 – β
Researchers aim for a power of at least 0.80. Designing a study with adequate power often involves increasing the sample size, choosing a larger α, or considering a larger effect size.
研究人员通常力求功效至少达到 0.80。设计一个具有足够功效的研究往往涉及增加样本量、选择较大的 α 或考虑较大的效应量。
8. Visualising Errors on a Sampling Distribution | 在抽样分布上可视化错误
We can imagine two sampling distributions of a test statistic, such as the sample mean x̄: one centred at μ₀ (under H₀) and one centred at the true mean μ₁ (under H₁).
我们可以想象检验统计量(比如样本均值 x̄)的两个抽样分布:一个以 μ₀ 为中心(在 H₀ 下),另一个以真实均值 μ₁ 为中心(在 H₁ 下)。
The critical value separates the rejection region. α is the tail area of the H₀ distribution beyond the critical value. β is the area of the H₁ distribution that falls inside the acceptance region of H₀.
临界值分隔出拒绝域。α 是 H₀ 分布中超出临界值的尾部面积。β 是 H₁ 分布中落入 H₀ 接受区域的面积。
As the distance between μ₀ and μ₁ increases, the β area shrinks and power increases. This distance is the effect size.
随着 μ₀ 和 μ₁ 之间距离的增加,β 面积缩小,功效增大。这个距离就是效应量。
9. Calculating Type II Error and Power (Example) | 计算第二类错误和功效(示例)
ulation mean with known σ. Suppose H₀: μ = 100, H₁: μ > 100, α = 0.05, σ = 15, and n = 25.
考虑一个已知 σ 的总体均值右尾检验。假定 H₀: μ = 100,H₁: μ > 100,α = 0.05,σ = 15,n = 25。
The critical value of the sample mean is:
样本均值的临界值为:
x̄_c = μ₀ + z_α × (σ/√n) = 100 + 1.645 × (15/√25) = 100 + 1.645 × 3 = 104.935
If the true mean is actually μ₁ = 108, we calculate β:
如果真实均值实际为 μ₁ = 108,我们计算 β:
β = P(x̄ < 104.935 | μ = 108) = P(Z < (104.935 − 108)/3) = P(Z < −1.0217) ≈ 0.1539
Therefore, power = 1 – 0.1539 = 0.8461. The test has an 84.6% chance of detecting that the mean is 108.
因此,功效 = 1 – 0.1539 = 0.8461。该检验有 84.6% 的概率检测到均值为 108。
10. Factors that Influence β and Power | 影响 β 与功效的因素
Several factors determine the probability of a Type II error and the power of a test:
以下几个因素决定第二类错误的概率和检验的功效:
• Significance level α: Increasing α decreases β and increases power, but at the cost of more Type I errors.
• 显著性水平 α:增大 α 会降低 β 并提高功效,但代价是更多第一类错误。
• Sample size n: A larger n reduces the standard error σ/√n, making the distribution of x̄ narrower. This lowers β and boosts power.
• 样本量 n:更大的 n 减小标准误 σ/√n,使 x̄ 的分布变窄,从而降低 β 并提升功效。
• Effect size (μ₁ − μ₀): A larger true difference moves the H₁ distribution away from the critical value, decreasing β.
• 效应量 (μ₁ − μ₀):更大的真实差异会使 H₁ 分布远离临界值,从而减少 β。
• Population variance σ²: Greater variability increases the standard error, making it harder to detect an effect, so β rises and power falls.
• 总体方差 σ²:变异性越大,标准误越大,检测效应更难,因此 β 上升、功效下降。
11. Balancing α and β in Real Studies | 真实研究中平衡 α 与 β
In practice, researchers often fix α at a conventional level like 0.05 and then determine the sample size required to achieve a desired power, typically 0.80 or higher.
在实践中,研究人员通常将 α 固定在常规水平如 0.05,然后确定所需样本量以达到期望的功效,通常为 0.80 或更高。
Reducing both α and β simultaneously requires a larger sample. The consequences of each error type should guide the choice: in some fields a false positive is more dangerous; in others a false negative is.
同时降低 α 和 β 需要更大的样本。每种错误类型的后果应指导选择:在某些领域假阳性更危险;在另一些领域假阴性更危险。
For example, in drug safety testing, a Type II error (failing to detect a harmful side effect) may be considered more serious, so power is prioritised.
例如,在药品安全性测试中,第二类错误(未能检测到有害副作用)可能被认为更严重,因此优先考虑功效。
12. Common Misconceptions and Exam Tips | 常见误区与应试技巧
Students often confuse 'accept H₀' with 'do not reject H₀'. A hypothesis test never proves H₀ is true; it only assesses whether there is enough evidence against it.
学生常混淆“接受 H₀”与“不拒绝 H₀”。假设检验永远不能证明 H₀ 为真;它只评估是否有足够证据反对它。
Another common mistake is thinking that α and β add up to 1. They are probabilities under different assumptions and are not complementary.
另一个常见错误是认为 α 和 β 加起来等于 1。它们是不同假设下的概率,并不互补。
In exams, be prepared to interpret power, to sketch overlapping distributions showing α and β, and to perform calculations of critical values, β and power given n, σ, and true mean.
在考试中,要准备好解释功效、绘制显示 α
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图