📚 Hypothesis Test for the Mean with Unknown Variance (from Data) | 均值未知方差的假设检验(基于数据)
When you are given a set of data and need to test a claim about the population mean, the population variance is almost always unknown. In such cases, the one-sample t-test becomes the essential tool. This article walks you through the entire process — from formulating hypotheses to drawing conclusions — using only raw data, without knowing the population standard deviation. All steps are aligned with the IB Mathematics (Cambridge) syllabus and exam requirements.
当你获得一组数据并需要检验关于总体均值的某个断言时,总体方差几乎总是未知的。在这种情况下,单样本 t 检验就成了必不可少的工具。本文带你走完整段流程——从建立假设到得出结论——只使用原始数据,无需知道总体标准差。所有步骤都紧密贴合 IB 数学(Cambridge)大纲和考试要求。
1. Introduction to Hypothesis Testing for the Mean (Unknown Variance) | 均值假设检验入门(方差未知)
Hypothesis testing provides a formal decision-making framework: we assume a null hypothesis H₀ and use sample evidence to judge whether it should be rejected in favour of an alternative hypothesis H₁. When σ² is unknown, we replace the population standard deviation σ with the sample standard deviation s. The resulting test statistic no longer follows a normal distribution but a Student's t-distribution.
假设检验提供了一个正式的决策框架:我们假定一个原假设 H₀,并利用样本证据判断是否应拒绝它而支持备择假设 H₁。当 σ² 未知时,我们用样本标准差 s 代替总体标准差 σ。由此得到的检验统计量不再服从正态分布,而是服从学生 t 分布。
2. The t-Distribution and Degrees of Freedom | t 分布与自由度
e n is the sample size. As n increases, the t-distribution approaches the standard normal N(0,1). In IB questions, you must explicitly state the degrees of freedom when using t-tables or reporting the test statistic.
t 分布是对称的钟形曲线,但它的尾部比标准正态分布更厚重,尤其在样本量较小时。其具体形状取决于自由度 ν = n − 1,其中 n 为样本量。随着 n 增大,t 分布趋近于标准正态 N(0,1)。在 IB 考题中,使用 t 表或报告检验统计量时必须明确指出自由度。
3. Setting Up the Null and Alternative Hypotheses | 设定原假设和备择假设
The null hypothesis H₀ always states that the population mean μ equals some claimed value μ₀: H₀: μ = μ₀. The alternative H₁ can be two-tailed (μ ≠ μ₀), or one-tailed with μ > μ₀ (right-tailed) or μ < μ₀ (left-tailed). The wording of the problem — "has changed," "is greater than," "at least" — determines the form of H₁. Always define μ clearly before writing the hypotheses.
原假设 H₀ 总是断言总体均值 μ 等于某宣称值 μ₀:H₀: μ = μ₀。备择假设 H₁ 可以是双尾的(μ ≠ μ₀),也可以是单尾的,μ > μ₀(右尾)或 μ < μ₀(左尾)。题目中的用词——"发生了变化""大于""至少"等——决定了 H₁ 的形式。在写出假设之前,必须先明确定义 μ。
4. Test Statistic: The t-Statistic | 检验统计量:t 统计量
With raw data, you first compute the sample mean x̄ and sample standard deviation s. The t-statistic is then given by:
拿到原始数据后,首先计算样本均值 x̄ 和样本标准差 s。t 统计量由下式给出:
t = (x̄ − μ₀) / (s / √n)
Here x̄ is the sample mean, μ₀ is the hypothesized population mean, s is the sample standard deviation, and n is the sample size. The denominator s/√n is the estimated standard error of the mean. Under H₀, this statistic follows a t-distribution with n−1 degrees of freedom.
这里 x̄ 是样本均值,μ₀ 是假设的总体均值,s 是样本标准差,n 是样本量。分母 s/√n 是均值的估计标准误。在 H₀ 下,该统计量服从自由度为 n−1 的 t 分布。
5. Critical Values and Rejection Regions | 临界值与拒绝域
Choose a significance level α (commonly 0.05 or 0.01). The critical value tcrit is found from the t-table using n−1 degrees of freedom. For a two-tailed test, the rejection region is |t| > tcrit; for a one-tailed test it is t > tcrit (right) or t < −tcrit (left). If the computed t falls in the rejection region, you reject H₀.
选定显著性水平 α(通常为 0.05 或 0.01)。从 t 表中根据自由度 n−1 查得临界值 tcrit。对双尾检验,拒绝域为 |t| > tcrit;对单尾检验,拒绝域为 t > tcrit(右尾)或 t < −tcrit(左尾)。如果计算得到的 t 落入拒绝域,则拒绝 H₀。
For example, with n=10 and α=0.05 for a two-tailed test, tcrit es the p-value directly, you should still understand how to use the table, as IB often requires showing the comparison.
例如,n=10、α=0.05 的双尾检验,tcrit = ±2.262。即使计算器能直接给出 p 值,你仍然需要理解如何使用表格,因为 IB 经常要求展示比较过程。
6. The p-Value Approach | p 值法
not reject H₀. In IB exams using a GDC, you can obtain the p-value directly from the t-test function. However, you must still state the p-value and compare it with α.
p 值是在 H₀ 为真的情况下,获得一个至少与观测值同样极端的检验统计量的概率。若 p ≤ α,拒绝 H₀;若 p > α,不拒绝 H₀。在 IB 考试中使用图形计算器时,可以直接从 t 检验功能获取 p 值。但你仍需明确写出 p 值并与 α 比较。
For a two-tailed test, the p-value is the sum of both tail probabilities; for a one-tailed test, it is the single-tail probability. Always interpret p correctly with respect to the alternative direction.
对于双尾检验,p 值是双尾概率之和;对于单尾检验,则是单尾概率。务必根据备择假设的方向正确解释 p 值。
7. Step-by-Step Example: Two-Tailed Test | 逐步示例:双尾检验
ms the mean length of a component is 10.0 cm. Test at α=0.05 whether the mean has changed.
数据(n=10):12, 10, 9, 11, 13, 8, 10, 12, 11, 14。某工厂声称一个零件的平均长度为 10.0 cm。在 α=0.05 水平下检验平均值是否发生了变化。
H₀: μ = 10.0, H₁: μ ≠ 10.0. From the data: x̄ = 11.0, s = √30/9 ≈ 1.8257. Then t = (11.0−10.0) / (1.8257/√10 7 > 0.05. Conclusion: do not reject H₀; there is insufficient evidence to suggest the mean length differs from 10.0 cm.
H₀: μ = 10.0, H₁: μ ≠ 10.0。根据数据:x̄ = 11.0,s = √30/9 ≈ 1.8257。则 t = (11.0−10.0) / (1.8257/√10) ≈ 1.0 / 0.5773 ≈ 1.732。自由度 ν = 9。双尾 α=0.05 临界值:±2.262。由于 1.732 < 2.262,t 未落入拒绝域。或者,p 值 ≈ 0.117 > 0.05。结论:不拒绝 H₀;没有足够证据表明平均长度不同于 10.0 cm。
8. Step-by-Step Example: One-Tailed Test | 逐步示例:单尾检验
ata set, test whether the true mean length is significantly greater than 9.8 cm at α=0.05.
使用同一组数据,检验真实平均长度是否显著大于 9.8 cm,α=0.05。
H₀: μ = 9.8, H₁: μ > 9.8 (right-tailed). x̄ = 11.0, s ≈ 1.8257, n=10. t = (11.0−9.8) / (1.8257/√10) = 1.2 / 0.5773 ≈ 2.078. ν = 9. Critical value tcrit 0.033 (one-sided) < 0.05. There is sufficient evidence to support that the mean length exceeds 9.8 cm.
H₀: μ = 9.8, H₁: μ > 9.8(右尾)。x̄ = 11.0,s ≈ 1.8257,n=10。t = (11.0−9.8) / (1.8257/√10) = 1.2 / 0.5773 ≈ 2.078。ν = 9。临界值 tcrit(单尾,α=0.05)= 1.833。由于 2.078 > 1.833,拒绝 H₀。p 值 ≈ 0.033(单侧)< 0.05。有充分证据表明平均长度超过 9.8 cm。
9. Assumptions and Conditions for the t-Test | t 检验的假设和条件
l Limit Theorem ensures that the sampling distribution of the mean is roughly Normal, making the t-test robust to mild non-Normality. (4) The variable under study is continuous or at least controlled as such.
单样本 t 检验要有效,必须满足以下条件:(1)数据是从总体中随机抽取的样本。(2)各观测值相互独立。(3)总体分布近似正态,尤其当样本量较小(n < 30)时。如果 n ≥ 30,中心极限定理保证均值的抽样分布大致正态,使得 t 检验对轻度非正态具有稳健性。(4)所研究的变量应为连续型,或至少按连续型处理。
In exams, you should always check the box plot or normal probability plot of the data if provided, and comment on any outliers or skewness that might violate the Normality assumption.
在考试中,如果提供了数据的箱线图或正态概率图,你应始终对其进行检查,并评论可能违反正态假设的异常值或偏态。
10. Comparing the t-Test with the z-Test | 比较 t 检验与 z 检验
The choice between a z-test and a t-test hinges on whether the population variance is known. Use the z-test only when σ is known, which is rare in practice. The t-test uses s and introduces extra uncertainty, reflected in heavier tails. As n grows large (n > 100), the t-distribution is nearly identical to Z, so the distinction matters less. However, IB explicitly expects you to justify your choice of test: "σ unknown, so t-test."
选择 z 检验还是 t 检验,取决于总体方差是否已知。只有在 σ 已知时才能用 z 检验,这在实践中很少见。t 检验使用 s,引入了额外的不确定性,这体现在更重的尾部。当 n 很大(n > 100)时,t 分布几乎与 Z 分布无异,此时区分已不重要。但 IB 明确要求你为所选检验提供依据:"σ 未知,因此用 t 检验。"
Always remember: if you know σ, use z; if you must estimate σ with s, use t. Using a z-test when variance is unknown is a common mistake that loses marks.
务必记住:若已知 σ,用 z 检验;若必须用 s 估计 σ,则用 t 检验。在方差未知时错误使用 z 检验是常见失分点。
11. Using Technology: TI-Nspire, Casio and GDC | 使用技术:TI-Nspire、Casio 与图形计算器
IB permits the use of any approved GDC. For TI-Nspire: enter data into a list (e.g., ‘ ta as the input method, select the list, enter μ₀, choose the tail direction, and press OK. The output shows the t-value, p-value, sample mean, and more.
IB 允许使用任何获准的图形计算器。对于 TI-Nspire:将数据输入列表(例如 "data")。按 [Menu] → 统计 → 统计检验 → 单样本 t 检验。输入方式选择数据,选定列表,输入 μ₀,选择备择假设方向,按 OK。输出结果将显示 t 值、p 值、样本均值等。
, μ₀, and select the alternative. Execute to get t and p. Always write down the relevant numbers from the display in your exam solution — do not just write "p < 0.05" without showing the value.
对于 Casio fx-CG50:从主菜单进入统计,将数据输入列表 1,然后按 F3(检验)→ t → 1-S。设置数据为列表 1、μ₀,并选择备择假设,执行即得到 t 和 p 值。考试作答时务必记下屏幕显示的相关数值——不要只写 "p < 0.05" 而不给出具体数字。
12. Common Mistakes and Exam Tips | 常见错误与考试技巧
Mistake 1: Using the wrong degrees of freedom (e.g., n instead of n−1). Always check your df before looking up critical values. Mistake 2: Forgetting to square root s² to obtain s before plugging into the formula. Mistake 3: Confusing one-tailed and two-tailed critical values; halving α for one-tailed is not required — the table already accounts for the tail. Mistake 4: Writing the p-value conclusion without stating the actual p-value. Mistake 5: Failing to check the Normality assumption when n is small, which the examiner may penalise.
错误 1:使用错误的自由度(如用了 n 而非 n−1)。查临界值前务必核对自由度。错误 2:忘记将 s² 开方得到 s 再代入公式。错误 3:混淆单尾与双尾的临界值;单尾检验不需要将 α 减半——表格已经按尾数处理过。错误 4:写结论时只写 "p < 0.05",而不给出具体的 p 值。错误 5:当样本量较小时,未能检验正态性假设,这可能会被阅卷人扣分。
Exam tip: olution clearly: State hypotheses → check conditions → calculate statistics (show s², s, x̄ → compute t → obtain p-value/critical comparison → conclusion in context. Using words like "there is sufficient evidence to suggest..." is part of the communication marks.
考试技巧:让解答结构清晰:陈述假设 → 检查条件 → 计算统计量(展示 s²、s、x̄)→ 算出 t 值 → 获取 p 值/临界值比较 → 结合背景给出结论。使用类似 "有充分证据表明……" 的措辞是交流分的一部分。
Published by TutorHao | Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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