📚 Paired Sample Hypothesis Testing in IB Maths | IB数学:配对样本的假设检验
In IB Mathematics Analysis and Approaches (AA) and Applications and Interpretation (AI), hypothesis testing for paired samples is a core topic in statistics. It allows us to determine whether the mean difference between two related measurements is statistically significant, using data collected from the same subjects under two conditions or at two time points.
在IB数学分析与方法(AA)和应用与解释(AI)课程中,配对样本的假设检验是统计学的核心内容之一。它帮助我们判断同一组对象在两种条件下或两个时间点上测得的数据均值差异是否具有统计学意义。
1. What Is a Paired Sample? | 什么是配对样本?
A paired sample arises when each observation in one group is naturally linked to exactly one observation in another group. Common examples include before-and-after measurements on the same person, the same student’s score in a pre-test and post-test, or the performance of twins assigned to different treatments.
配对样本指的是一个组中的每一个观测值天然地与另一组中的某一个观测值一一对应。常见的例子包括:同一个人的前测与后测数据、同一个学生在测试前后的成绩,或者双胞胎分别接受不同处理后的表现。
Because the data are connected in this way, the two samples are not independent. We therefore cannot use the two-sample t-test directly; instead, we compute the difference dᵢ for each pair and test hypotheses about the mean difference.
由于数据之间存在这种关联,两个样本并不是相互独立的。因此我们不能直接使用双样本t检验;相反,我们计算每一对数据的差值 dᵢ,并围绕均值差进行假设检验。
2. Why Use a Paired Design? | 为什么要使用配对设计?
Paired designs control for confounding variables such as age, IQ, motivation, or baseline health status. By using each subject as their own control, we eliminate between-subject variability and make it easier to detect a true treatment effect.
配对设计可以控制年龄、智商、动机或基础健康状况等混杂变量的影响。通过让每位受试者作为自身的对照,我们消除了个体间差异,从而更容易检测出真实的处理效应。
For example, if we measure the same group of students’ maths scores before and after a revision course, the only meaningful variation comes from the course itself plus random noise. Without pairing, differences in prior ability would dominate the test.
例如,如果我们测量同一组学生在参加复习课程前后的数学成绩,那么除随机波动外,真正有意义的差异仅来自课程本身。如果不进行配对,学生先前能力的差异就会主导检验结果。
3. Paired vs Independent Samples | 配对样本与独立样本的对比
It is essential to distinguish paired data from independent samples. Independent samples arise when two groups are composed of different individuals, such as comparing boys’ heights with girls’ heights in a school.
区分配对数据与独立样本至关重要。独立样本是指两个组由不同的个体组成,例如比较一所学校中男生的身高与女生的身高。
Use the table below to quickly decide which test is appropriate for your data.
使用下表可以快速决定你的数据应当采用哪种检验方法。
| Feature | 特征 | Paired Samples | 配对样本 | Independent Samples | 独立样本 |
| Relationship | 数据关系 | One-to-one matching | 一一对应 | No matching | 无对应关系 |
| Typical example | 典型例子 | Pre-test and post-test | 前测与后测 | Treatment group vs control group | 处理组与对照组 |
| Degrees of freedom | 自由度 | n − 1 (n = number of pairs) | n − 1(n为配对数) | n₁ + n₂ − 2 (if variances pooled) | n₁ + n₂ − 2(若方差合并) |
| Test statistic uses | 检验统计量 | Mean and SD of differences | 差值的均值与标准差 | Means and SDs of both groups | 两组的均值与标准差 |
4. Null and Alternative Hypotheses | 零假设与备择假设
Let μ_d represent the mean difference in the population. For a two-tailed test, the hypotheses are written as H₀: μ_d = 0 and H₁: μ_d ≠ 0. Depending on the research question, you may also use one-tailed tests: H₁: μ_d > 0 or H₁: μ_d < 0.
令 μ_d 表示总体中的均值差。对于双尾检验,零假设和备择假设分别写为 H₀: μ_d = 0 与 H₁: μ_d ≠ 0。根据研究问题的方向,你还可以使用单尾检验:H₁: μ_d > 0 或 H₁: μ_d < 0。
Suppose a tutoring programme claims to improve exam scores. If we record each student’s score before and after the programme, a natural alternative hypothesis would be H₁: μ_d > 0, meaning the average improvement is positive.
假设一个辅导项目声称可以提高考试成绩。如果我们记录每个学生在参加该项目前后的成绩,自然的备择假设是 H₁: μ_d > 0,即平均提高量为正数。
H₀: μ_d = 0 vs H₁: μ_d ≠ 0 (two-tailed)
H₀: μ_d = 0 vs H₁: μ_d > 0 (upper-tailed)
5. The Test Statistic for Paired Data | 配对数据的检验统计量
After computing the differences dᵢ = x₁ᵢ − x₂ᵢ for i = 1, 2, …, n, we calculate the sample mean of the differences d̄ and the sample standard deviation s_d. The paired t-test statistic is then:
在计算每对数据的差值 dᵢ = x₁ᵢ − x₂ᵢ(其中 i = 1, 2, …, n)之后,我们计算差值的样本均值 d̄ 与样本标准差 s_d。配对t检验统计量如下:
t = (d̄ − μ₀) / (s_d / √n)
where μ₀ is the hypothesized mean difference (usually 0), and n is the number of pairs. The expression s_d / √n is the standard error of the mean difference.
其中 μ₀ 是假设的均值差(通常为0),n 是配对数。表达式 s_d / √n 称为均值差的标准误。
If we write s_d as the sample standard deviation with n − 1 in the denominator, then the statistic follows a t-distribution with n − 1 degrees of freedom when H₀ is true.
如果我们用 n − 1 作为分母计算样本标准差 s_d,那么在 H₀ 为真时,上述统计量服从自由度为 n − 1 的t分布。
6. Worked Example: Exam Preparation Course | 示例:考前冲刺课程
A teacher believes that a revision course improves students’ scores. Eight students take a pre-test and a post-test, with scores shown below. Test at the 5% significance level whether the mean improvement is greater than zero.
一位老师认为考前复习课程能够提高学生的成绩。八名学生参加了前测与后测,成绩如下表所示。在5%显著性水平下检验平均提高量是否大于零。
| Student | 学生 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| Pre-test | 前测 | 52 | 60 | 45 | 70 | 58 | 63 | 49 | 55 |
| Post-test | 后测 | 58 | 63 | 50 | 72 | 62 | 70 | 54 | 60 |
| dᵢ (Post − Pre) | 差值 | 6 | 3 | 5 | 2 | 4 | 7 | 5 | 5 |
Step 1: Calculate the differences. They are 6, 3, 5, 2, 4, 7, 5, 5. The sum is 37, so d̄ = 37 / 8 = 4.625.
第一步:计算差值。差值分别为 6, 3, 5, 2, 4, 7, 5, 5。总和为37,因此 d̄ = 37 / 8 = 4.625。
Step 2: Compute the standard deviation of the differences.
第二步:计算差值的标准差。
s_d = √[ (Σ(dᵢ − d̄)²) / (n − 1) ] ≈ 1.685
Step 3: Calculate the test statistic.
第三步:计算检验统计量。
t = 4.625 / (1.685 / √8) ≈ 4.625 / 0.596 ≈ 7.76
Step 4: Compare with the critical value. At the 5% significance level with df = 7, the critical value for a one-tailed test is t* = 1.895. Since 7.76 > 1.895, we reject H₀.
第四步:与临界值比较。在5%显著性水平下,自由度为7时,单尾检验的临界值为 t* = 1.895。由于 7.76 > 1.895,我们拒绝 H₀。
7. p-Value Approach | p值方法
Instead of comparing t to a critical value, we can compute the p-value. The p-value is the probability of obtaining a test statistic as extreme as the observed one, assuming H₀ is true. For the example above, the p-value is P(T > 7.76) with 7 degrees of freedom, which is far less than 0.001.
除了将统计量与临界值比较之外,我们还可以计算p值。p值是在 H₀ 为真的前提下,得到与观测值同样极端或更极端的检验统计量的概率。在上面的例子中,p值为 P(T > 7.76)(自由度为7),远小于0.001。
In IB exams, you may use a GDC (Graphical Display Calculator) to find the p-value directly via the t-test function. Enter the difference list, choose μ > 0 as the alternative, and read the p-value from the output.
在IB考试中,你可以使用图形计算器(GDC)通过t检验功能直接求得p值。输入差值列表,选择 μ > 0 作为备择假设,然后从输出中读取p值。
If the p-value is less than the significance level α, reject H₀. If the p-value is greater than α, fail to reject H₀.
如果p值小于显著性水平 α,则拒绝 H₀。如果p值大于 α,则不能拒绝 H₀。
p-value < α ⇒ Reject H₀
8. Confidence Interval for the Mean Difference | 均值差的置信区间
In addition to hypothesis testing, we can construct a confidence interval for μ_d. A 95% confidence interval is given by:
除了假设检验之外,我们还可以构造 μ_d 的置信区间。95%置信区间的公式为:
d̄ ± t* × (s_d / √n)
where t* is the critical t-value with n − 1 degrees of freedom. For the worked example, t* ≈ 2.365 for a 95% two-sided interval, so:
其中 t* 是自由度为 n − 1 的临界t值。在上述示例中,95%双侧区间的 t* ≈ 2.365,因此:
4.625 ± 2.365 × 0.596 = (3.22, 6.03)
Because the interval lies entirely above zero, it supports the decision to reject H₀ at the 5% level. A two-sided 95% confidence interval corresponds to a two-tailed test at α = 0.05.
由于该区间完全位于零的上方,因此支持在5%水平下拒绝 H₀ 的决策。95%双侧置信区间对应于 α = 0.05 时的双尾检验。
9. Effect Size | 效应量
Statistical significance does not always imply practical importance. To measure the magnitude of the difference, we can compute Cohen’s d for paired samples:
统计显著性并不总是意味着实际重要性。为了衡量差异的幅度,我们可以计算配对样本的Cohen’s d:
d_z = d̄ / s_d
where s_d is the standard deviation of the differences. In the worked example, d_z = 4.625 / 1.685 ≈ 2.74, which indicates a very large effect.
其中 s_d 是差值的标准差。在示例中,d_z = 4.625 / 1.685 ≈ 2.74,表明效应量非常大。
Guidelines: d_z ≈ 0.2 is small, 0.5 is medium, and 0.8 or above is large. Reporting effect size alongside p-values is a good practice in statistical analysis.
参考标准:d_z ≈ 0.2 为小效应,0.5 为中等效应,0.8 及以上为大效应。在统计分析中,同时报告效应量与p值是一种良好的做法。
10. Conditions for the Paired t-Test | 配对t检验的条件
Three main conditions must hold for the paired t-test to be valid. First, the observations should form natural pairs. Second, the differences should be approximately normally distributed, or the sample size should be large enough (n ≥ 30) for the Central Limit Theorem to apply.
进行配对t检验需要满足三个主要条件。第一,观测数据应形成自然的配对关系。第二,差值应近似服从正态分布,或者样本量足够大(n ≥ 30)从而可以应用中心极限定理。
Third, the differences should be independent of each other. This means that one pair’s difference should not influence another pair’s difference. Random sampling helps ensure this condition is satisfied.
第三,各差值之间应相互独立。也就是说,一对数据的差值不应影响另一对数据的差值。随机抽样有助于确保满足这一条件。
If the differences are severely skewed and the sample size is small, consider using the Wilcoxon signed-rank test, a non-parametric alternative.
如果差值严重偏态且样本量较小,可以考虑使用Wilcoxon符号秩检验这一非参数替代方法。
11. Common Mistakes and Pitfalls | 常见错误与误区
One frequent error is treating paired data as independent samples. This causes the test to lose power and may lead to incorrect conclusions. Always check whether each data point has a natural partner.
一个常见错误是将配对数据当作独立样本处理。这会导致检验功效下降,并可能得出错误的结论。务必检查每个数据点是否具有天然的对应关系。
A second pitfall is using a one-tailed test when the research question does not clearly specify a direction, or choosing the wrong tail. If the treatment might plausibly decrease scores, a two-tailed test is safer.
第二个误区是当研究问题未明确指定方向时使用单尾检验,或者选错了检验方向。如果处理效应可能使分数下降,那么使用双尾检验更为稳妥。
A third issue is ignoring the normality assumption for small samples. While the t-test is robust to moderate violations, extreme outliers in the differences can seriously bias the results.
第三个问题是在小样本情况下忽视正态性假设。虽然t检验对中等程度的偏离具有稳健性,但差值中的极端异常值会严重影响结果。
Lastly, do not confuse the significance level α with the p-value. The p-value is determined by the data, whereas the significance level is chosen before the test is conducted.
最后,不要将显著性水平 α 与 p值混淆。p值由数据决定,而显著性水平是在检验开始之前就已经选定的。
12. Summary | 总结
Paired sample hypothesis testing is a powerful tool for comparing related measurements. The key idea is to reduce the problem to a single-sample t-test on the differences. Remember to state hypotheses clearly, check conditions, calculate the test statistic, and make a decision using either critical values or p-values.
配对样本假设检验是比较相关测量的有力工具。其核心思想是将问题化简为对差值进行单样本t检验。记得要清晰陈述假设,检查适用条件,计算检验统计量,并通过临界值或p值作出决策。
In the IB exam, you should be comfortable with both the calculation and the interpretation. Distinguish paired from independent samples, interpret GDC output correctly, and always include a conclusion in context.
在IB考试中,你应当熟练把握计算与解释两个方面。区分配对样本与独立样本,正确解读GDC输出结果,并始终结合具体情境写出结论。
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply