📚 Calculate the Size and Power of a Test | 计算检验的大小与功效
In A-Level Edexcel Statistics, mastering the size and power of a hypothesis test is essential for interpreting test results and designing effective experiments. The size (significance level) quantifies the risk of a false positive, while the power measures the ability to detect a true effect when it exists. This article walks you through definitions, calculations, and exam-ready examples to build a deep understanding of these core concepts.
在A-Level Edexcel统计学中,掌握假设检验的大小与功效对于解释检验结果和设计有效实验至关重要。大小(显著性水平)量化了假阳性的风险,而功效则衡量了存在真实效应时检验检测到它的能力。本文将通过定义、计算和适用于考试的示例,帮助你深入理解这些核心概念。
1. Hypothesis Testing Recap | 假设检验回顾
A hypothesis test starts with a null hypothesis H₀ (usually a statement of no effect or no difference) and an alternative hypothesis H₁. You choose a significance level α, collect data, compute a test statistic, and compare it to critical values or use the p-value to decide whether to reject H₀. The rejection region (critical region) is the set of values of the test statistic that leads to rejecting H₀.
假设检验从原假设 H₀(通常表示无效应或无差异)和备择假设 H₁ 开始。你选择一个显著性水平 α,收集数据,计算检验统计量,并将其与临界值比较,或使用 p 值来决定是否拒绝 H₀。拒绝域(临界域)是导致拒绝 H₀ 的检验统计量取值的集合。
2. Type I and Type II Errors | 第一类与第二类错误
A Type I error occurs when you reject a true null hypothesis; its probability is denoted by α. A Type II error occurs when you fail to reject a false null hypothesis; its probability is denoted by β. These two errors are inversely related for a fixed sample size – reducing α increases β, and vice versa, unless you collect more data.
第一类错误发生在你拒绝了真的原假设时,其概率用 α 表示。第二类错误发生在你未能拒绝错误的原假设时,其概率用 β 表示。在样本量固定的情况下,这两类错误呈反向关系——减小 α 会增加 β,反之亦然,除非你收集更多的数据。
3. Size of a Test | 检验的大小
The size of a test is the probability of making a Type I error when the null hypothesis is exactly true. For a simple null hypothesis (a single parameter value), the size equals the chosen significance level α. In continuous distributions like the normal, the size is exactly α. In discrete cases (e.g., binomial), the actual size may be slightly less than α due to the granularity of possible outcomes.
检验的大小是在原假设恰好为真时发生第一类错误的概率。对于简单原假设(单个参数值),大小等于所选的显著性水平 α。在正态分布等连续分布中,大小正好是 α。在离散情况(如二项分布)中,由于可能结果的粒度,实际大小可能略小于 α。
Size = P(Reject H₀ | H₀ is true)
4. Power of a Test | 检验的功效
The power of a test is the probability of correctly rejecting a false null hypothesis. It is defined as 1 – β, where β is the probability of a Type II error. High power means the test is sensitive to departures from H₀. When designing a study, researchers aim for a power of at least 0.80 or 0.90, depending on the field.
检验的功效是正确拒绝一个错误原假设的概率,定义为 1 – β,其中 β 是第二类错误的概率。高功效意味着检验对偏离 H₀ 的情况很敏感。在设计研究时,研究者通常要求功效至少达到 0.80 或 0.90,具体取决于领域。
Power = P(Reject H₀ | H₀ is false) = 1 – β
5. Calculating Size for Simple and Composite Hypotheses | 简单与复合假设下大小的计算
t H₁: p > 0.3 using a binomial test with n = 10 and reject when X ≥ 6, the size is P(X ≥ 6 | is the supremum of the Type I error probability over all possible parameter values in H₀.
对于简单的 H₀,大小直接计算为在原假设下的拒绝概率。例如,如果我们用 n=10 的二项检验,在 X ≥ 6 时拒绝,检验 H₀: p = 0.3 对 H₁: p > 0.3,则大小为来自 Bin(10, 0.3) 的 P(X ≥ 6 | p = 0.3)。如果 H₀ 是复合的(例如 H₀: μ ≤ 100),大小是 H₀ 中所有可能参数值下第一类错误概率的上确界。
6. Power Calculation for a One-Tailed Z-Test | 单尾 Z 检验的功效计算
₀: μ = μ₀ and H₁: μ > μ₀ at significance level α. The critical value for the sample mean X̄ is c = μ₀ + zₐ × (σ/√n). If the true mean is μ₁ (where μ₁ > μ₀), the power is the probability that X̄ exceeds c under this true distribution. This probability is given by 1 – Φ( (c – μ₁) / (σ/√n) ), where Φ is the standard normal cumulative function.
考虑已知方差 σ² 的总体均值检验。设 H₀: μ = μ₀, H₁: μ > μ₀,显著性水平为 α。样本均值 X̄ 的临界值为 c = μ₀ + zₐ × (σ/√n)。若真实均值为 μ₁(μ₁ > μ₀),功效就是在真实分布下 X̄ 超过 c 的概率。该概率由 1 – Φ( (c – μ₁) / (σ/√n) ) 给出,其中 Φ 为标准正态累积分布函数。
lue is 50 + 1.645 × (10/5) = 53.29. If the true mean is μ₁ = 52, then standardised: (53.29 – 52) / 2 = 0.645. Power = 1 – Φ(0.645) ≈ 1 – 0.740 = 0.260. If μ₁ = 55, standardised: (53.29 – 55)/2 = –0.855, and power = 1 – Φ(– .855) ≈ 0.803. The test becomes much more powerful as the true mean moves further from H₀.
例如,设 μ₀ = 50, σ = 10, n = 25, α = 0.05,故 z₀.₀₅ = 1.645。临界值为 50 + 1.645 × (10/5) = 53.29。若真实均值 μ₁ = 52,则标准化:(53.29 – 52) / 2 = 0.645。功效 = 1 – Φ(0.645) ≈ 1 – 0.740 = 0.260。若 μ₁ = 55,标准化:(53.29 – 55)/2 = –0.855,功效 = 1 – Φ(–0.855) = Φ(0.855) ≈ 0.803。随着真实均值远离 H₀,检验的功效大大增加。
7. Power Calculation for a Two-Tailed Z-Test | 双尾 Z 检验的功效计算
For H₀: μ = μ₀ against H₁: μ ≠ μ₀ at level α, the rejection region is X̄ < μ₀ – zₐ/₂ × (σ/√n) or X̄ > μ₀ + zₐ/₂ × (σ/√n). If the true mean is μ₁, the power is the sum of the probabilities in both tails under the true distribution: P(X̄ < lower | μ₁) + P(X̄ > upper | μ₁). This can be expressed as Φ( (lower – μ₁)/(σ/√n) ) + 1 – Φ( (upper – μ₁)/(σ/√n) ).
对于 H₀: μ = μ₀ 对 H₁: μ ≠ μ₀,显著性水平 α,拒绝域为 X̄ < μ₀ – zₐ/₂ × (σ/√n) 或 X̄ > μ₀ + zₐ/₂ × (σ/√n)。若真实均值为 μ₁,功效是在真实分布下两个尾部概率之和:P(X̄ < 下界 | μ₁) + P(X̄ > 上界 | μ₁)。这可以表示为 Φ( (下界 – μ₁)/(σ/√n) ) + 1 – Φ( (上界 – μ₁)/(σ/√n) )。
Example: μ₀ = 100, σ = 15, n = 36, α = 0.01, so z₀.₀₀₅ = 2.576. Lower = 100 – 15/6) = 93.56, upper = 106.44. When true μ₁ = 105, the lower-tail probability is Φ( (93.56–105)/2.5 ) = Φ(–4.576) ≈ 0, and upper-tail is 1 – Φ( (106.44–105)/2.5 ) = 1 – Φ(0.576) ≈ 0.282. The power is about 0.282 – much lower than the one-tailed case with the same μ₁, because the rejection area is split.
例子:μ₀ = 100, σ = 15, n = 36, α = 0.01,故 z₀.₀₀₅ = 2.576。下界 = 100 – 2.576×(15/6) = 93.56,上界 = 106.44。当真实 μ₁ = 105,下尾概率为 Φ( (93.56–105)/2.5 ) = Φ(–4.576) ≈ 0,上尾为 1 – Φ( (106.44–105)/2.5 ) = 1 – Φ(0.576) ≈ 0.282。功效约为 0.282——远低于相同 μ₁ 的单尾情形,因为拒绝区域被分开了。
8. The Power Function and Curve | 功效函数与曲线
The power function K(μ) maps the true parameter value μ to the probability of rejecting H₀. It depends on the test type, sample size, and α. For one-tailed tests, the curve is an S-shaped monotonic increasing function. For two-tailed tests, the power curve is symmetric and increases as |μ – μ₀| grows. Plotting K(μ) helps visualise how the test performs across a range of possible true values.
功效函数 K(μ) 将真实参数值 μ 映射到拒绝 H₀ 的概率。它取决于检验类型、样本量和 α。对于单尾检验,曲线是一条 S 形的单调递增函数。对于双尾检验,功效曲线是对称的,并随着 |μ – μ₀| 的增大而上升。绘制 K(μ) 有助于直观地观察检验在一系列真实值下的表现。
ue α (the size). As μ moves away from μ₀, the power increases towards 1. The steeper the curve near μ₀, the more sensitive the test is to small departures from the null hypothesis.
在 μ = μ₀ 处,功效曲线取值 α(大小)。随着 μ 远离 μ₀,功效向 1 增加。曲线在 μ₀ 附近越陡峭,检验对偏离原假设的微小变动就越灵敏。
9. Factors Affecting Power | 影响功效的因素
Several factors influence the power of a test. Increasing the sample size n reduces the standard error and makes it easier to detect a given effect size, raising power. A larger significance level α also increases power, but at the cost of more Type I errors. The true effect size, |μ₁ – μ₀|, directly boosts power: the further the truth is from H₀, the higher the probability of rejection. Lastly, a smaller population standard deviation σ increases power because the data are less noisy.
有几个因素会影响检验的功效。增大样本量 n 会减小标准误,使得更容易检测到给定的效应大小,从而提高功效。较大的显著性水平 α 也会增加功效,但代价是更多的第一类错误。真实效应大小 |μ₁ – μ₀| 直接提高功效:真值离 H₀ 越远,拒绝概率越高。最后,较小的总体标准差 σ 会提高功效,因为数据的噪声更小。
10. Exam-Style Worked Example | 考试风格实例解析
ags is taken and the mean weight is used to test H₀: μ = 500 g against H₁: μ > 500 g at the 2.5% Find the critical region and calculate the power of the test when the true mean is 505 g.
Edexcel 考试题(改编):一台机器包装糖袋,重量服从正态分布,标准差为 8 g。抽取 16 袋样本,用样本均值检验 H₀: μ = 500 g 对 H₁: μ > 500 g,显著性水平 2.5%。求临界域并计算当真实均值为 505 g 时的检验功效。
Critical region: z₀.₀₂₅ = 1.96 (one-tailed). Under H₀, X̄ ~ N(500, 8²/16 = 4). Reject H₀ if X̄ > 500 + 1.96 × √4 = 500 + 3.92 = 503.92 g. So the critical region is X̄ > 503.92. When μ = 505, X̄ ~ N(505, 4). Power = P(X̄ > 503.92 | μ=505) = P( Z > (503.92–505)/2 ) = P( Z > –0.54 ) = Φ(0.54) ≈ 0.7054. Therefore, the test has a 70.5% chance of detecting a 5 g excess in the true mean.
临界域:z₀.₀₂₅ = 1.96(单尾)。在 H₀ 下,X̄ ~ N(500, 8²/16 = 4)。当 X̄ > 500 + 1.96 × √4 = 503.92 g 时拒绝 H₀。因此临界域为 X̄ > 503.92。当 μ = 505 时,X̄ ~ N(505, 4)。功效 = P(X̄ > 503.92 | μ=505) = P( Z > (503.92–505)/2 ) = P(Z > –0.54) = Φ(0.54) ≈ 0.7054。因此,该检验有 70.5% 的概率检测到真实均值超过 5 g 的情况。
11. Common Misunderstandings | 常见误解
Many students confuse the p-value with the size of the test. The size α is chosen before seeing data and sets the rejection threshold; the p-value is the probability of observing a result as extreme as, or more extreme than, the one obtained, assuming H₀ is true. Another mistake is believing that power equals 1 – p-value – power is a pre-experiment property that depends on a specific alternative, not on the observed data. Also, a non-significant result does not mean H₀ is true; it simply means there is insufficient evidence against it, possibly due to low power.
许多学生混淆了 p 值和检验的大小。大小 α 是在查看数据之前选定的,设定了拒绝的阈值;p 值是假定 H₀ 为真时,观察到与所得结果同样极端或更极端结果的概率。另一个错误
Published by TutorHao | A-Level Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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