题型分析 — Non-parametric Tests
Question Type 1: Wilcoxon Signed-Rank Test (Single Sample)
如何识别
题目给出一组数据和一个假设的中位数,要求检验中位数是否等于某值。关键词:"test whether the median is ..."、"Wilcoxon signed-rank test"
可以使用以下模板:
H₀: median = ___
H₁: median ___ ___ (___-tailed)
α = ___
Differences from median: ___
Absolute differences: ___
Ranks: ___
Signed ranks: ___
T⁺ = sum of positive ranks = ___
T⁻ = sum of negative ranks = ___
T = min(T⁺, T⁻) = ___
Critical value (table, n = ___, α = ___, ___ -tail) = ___
Since T ___ cv, we ___ H₀.
- 提出假设 B1
- 计算差值 M1
- 赋秩正确 A1
- 求出 , , M1 A1
- 临界值 B1
- 比较和结论 M1 A1
Example 1 — 9231/s20/qp/41 Q2 (9 marks):
A random sample of 10 students scored the following marks in a test:
Use a Wilcoxon signed-rank test at the 5% significance level to test whether the population median is 50.
📝 展开查看完整解法 + MS
: median , : median (two-tailed), B1
Data sorted: 43, 47, 49, 51, 52, 54, 55, 56, 58, 61
| Rank | Signed rank | |||
|---|---|---|---|---|
| 43 | 7 | 7 | ||
| 47 | 3 | 3 | ||
| 49 | 1 | 1 | ||
| 51 | 1 | 2 | ||
| 52 | 2 | 4 | ||
| 54 | 4 | 5 | ||
| 55 | 5 | 6 | ||
| 56 | 6 | 8 | ||
| 58 | 8 | 9 | ||
| 61 | 11 | 10 |
M1 for differences and ranks, A1 for correct ranks
Note: appears twice (49 and 51), so they share ranks 1 and 2 → both get rank . The next rank is 3.
Corrected table:
| Rank | Signed rank | |||
|---|---|---|---|---|
| 49 | 1 | 1.5 | ||
| 51 | 1 | 1.5 | ||
| 47 | 3 | 3 | ||
| 52 | 2 | 4 | ||
| 54 | 4 | 5 | ||
| 55 | 5 | 6 | ||
| 43 | 7 | 7 | ||
| 56 | 6 | 8 | ||
| 58 | 8 | 9 | ||
| 61 | 11 | 10 |
M1 A1
Critical value (two-tailed, , ): B1
11.5 > 8 ⇒ do not reject M1
Insufficient evidence that median differs from 50 at the 5% significance level. A1
- 相同绝对值(ties)取平均秩: 出现了两次,都应取秩
- ,不是
- 临界值查表用 (不是样本量 10 不代表排除零差异后还是 10)
Example 2 — 9231/w20/qp/41 Q2 (9 marks):
The following data show the waiting times (in minutes) at a clinic for 12 patients:
Use a Wilcoxon signed-rank test at the 5% significance level to test whether the population median is 25 minutes.
📝 展开查看完整解法 + MS
: median , : median (two-tailed), B1
| Rank | Signed rank | |||
|---|---|---|---|---|
| 15 | 10 | 10 | ||
| 18 | 7 | 7 | ||
| 19 | 6 | 6 | ||
| 20 | 5 | 5 | ||
| 22 | 3 | 3.5 | ||
| 23 | 2 | 2 | ||
| 24 | 1 | 1 | ||
| 26 | 1 | 3.5 | ||
| 27 | 2 | 8 | ||
| 29 | 4 | 9 | ||
| 31 | 6 | 11 | ||
| 32 | 7 | 12 |
M1 A1 for ranks
Note ties: occurs for 22 and 27 → ranks 3 and 4 → average 3.5 each
M1 A1
Critical value (two-tailed, , ): B1
34.5 > 13 ⇒ do not reject M1
Insufficient evidence to suggest median waiting time differs from 25 minutes. A1
- 本题 很大(34.5),临界值很小(13),结论是不拒绝 ,但必须写出完整比较过程
Example 3 — 9231/s24/qp/41 Q3 (9 marks):
A random sample of 11 light bulbs has the following lifetimes (in hours):
Test at the 5% significance level whether the population median is 1200 hours.
📝 展开查看完整解法 + MS
: median , : median (two-tailed), B1
| Rank | Signed rank | |||
|---|---|---|---|---|
| 1175 | 25 | 10 | ||
| 1180 | 20 | 8 | ||
| 1185 | 15 | 6 | ||
| 1190 | 10 | 4 | ||
| 1195 | 5 | 2 | ||
| 1205 | 5 | 3 | ||
| 1210 | 10 | 5 | ||
| 1220 | 20 | 9 | ||
| 1225 | 25 | 11 | ||
| 1235 | 35 | 7 | ||
| 1240 | 40 | 1 |
M1 A1 for ranks
Ties: appears for 1195 and 1205 → ranks 2 and 3 → average 2.5 each appears for 1190 and 1210 → ranks 4 and 5 → average 4.5 each appears for 1180 and 1220 → ranks 8 and 9 → average 8.5 each appears for 1175 and 1225 → ranks 10 and 11 → average 10.5 each
Wait, let me recount. Sorted absolute differences:
5, 5, 10, 10, 15, 20, 20, 25, 25, 35, 40
Ranks: (1,2) for 5s → 1.5 each; (3,4) for 10s → 3.5 each; 5 for 15; (6,7) for 20s → 6.5 each; (8,9) for 25s → 8.5 each; 10 for 35; 11 for 40.
Corrected:
| Rank | Signed | |||
|---|---|---|---|---|
| 1195 | 5 | 1.5 | ||
| 1205 | 5 | 1.5 | ||
| 1190 | 10 | 3.5 | ||
| 1210 | 10 | 3.5 | ||
| 1185 | 15 | 5 | ||
| 1180 | 20 | 6.5 | ||
| 1220 | 20 | 6.5 | ||
| 1175 | 25 | 8.5 | ||
| 1225 | 25 | 8.5 | ||
| 1235 | 35 | 10 | ||
| 1240 | 40 | 11 |
M1 A1
Critical value (two-tailed, , ): B1
25 > 10 ⇒ do not reject M1
Insufficient evidence that median differs from 1200. A1
- 多个 ties 要小心处理:4 对 ties 需要逐对取平均秩
- 本题全部 11 个差异都非零,所以
Question Type 2: Wilcoxon Matched-Pairs Signed-Rank Test
如何识别
题目给出配对数据(如 before/after 或 matched pairs),要求比较两组是否有显著差异。关键词:"matched pairs"、"before and after"、"paired comparison"
与单样本相同,只是差异定义为配对差(after before 或 pair 1 pair 2)。
模板同 Type 1,但假设为:
H₀: median difference = 0
H₁: median difference ___ 0
与 Type 1 相同。
Example 1 — 9231/s21/qp/41 Q5 (10 marks):
Eight employees undergo a training course. Their productivity scores before and after are:
| Employee | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| Before | 62 | 55 | 70 | 48 | 65 | 58 | 72 | 50 |
| After | 68 | 58 | 73 | 55 | 66 | 63 | 76 | 54 |
Use a Wilcoxon signed-rank test at the 5% significance level to test whether the training improves productivity.
📝 展开查看完整解法 + MS
: median difference : median difference > 0 (one-tailed — testing for improvement) B1
| Emp | Before | After | (After Before) | Rank | Signed | |
|---|---|---|---|---|---|---|
| A | 62 | 68 | 6 | 5 | ||
| B | 55 | 58 | 3 | 3 | ||
| C | 70 | 73 | 3 | 4 | ||
| D | 48 | 55 | 7 | 6 | ||
| E | 65 | 66 | 1 | 1.5 | ||
| F | 58 | 63 | 5 | 7 | ||
| G | 72 | 76 | 4 | 8 | ||
| H | 50 | 54 | 4 | 2 |
M1 for differences, A1 for ranks
Ties: for B and C → ranks 3 and 4 → average 3.5 each for E (only one) → rank 1 Wait, let me re-sort by |d|:
Sorted: 1 (E), 3 (B), 3 (C), 4 (G), 4 (H), 5 (F), 6 (A), 7 (D)
Ranks: E→1, B→(2+3)/2=2.5, C→2.5, H→(4+5)/2=4.5, G→4.5, F→6, A→7, D→8
Corrected:
| Emp | Rank | Signed | ||
|---|---|---|---|---|
| E | 1 | 1 | ||
| B | 3 | 2.5 | ||
| C | 3 | 2.5 | ||
| H | 4 | 4.5 | ||
| G | 4 | 4.5 | ||
| F | 5 | 6 | ||
| A | 6 | 7 | ||
| D | 7 | 8 |
All differences > 0, so M1 A1
One-tailed test: Since is median > 0, we use (sum of negative ranks) = 0
Critical value (one-tailed, , ): B1
0 < 5 ⇒ reject M1
There is sufficient evidence that training improves productivity at the 5% level. A1
- 单尾检验时注意用对 值:若 为 > 0,则关注 (负秩和);若 为 < 0,则关注
- 本题所有差异为正,,是最极端的情况
Example 2 — 9231/w22/qp/41 Q3 (9 marks):
Ten patients rated their pain level (scale 0–10) before and after treatment:
| Patient | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Before | 7 | 6 | 8 | 5 | 7 | 9 | 4 | 6 | 8 | 5 |
| After | 5 | 6 | 6 | 4 | 7 | 7 | 3 | 5 | 6 | 4 |
Use a Wilcoxon signed-rank test at the 5% significance level to test whether the treatment reduces pain.
📝 展开查看完整解法 + MS
: median difference : median difference < 0 (pain reduced → After Before < 0) B1
| Pt | Before | After | Rank | Signed | ||
|---|---|---|---|---|---|---|
| 1 | 7 | 5 | 2 | 5.5 | ||
| 2 | 6 | 6 | — | — | — | |
| 3 | 8 | 6 | 2 | 5.5 | ||
| 4 | 5 | 4 | 1 | 2 | ||
| 5 | 7 | 7 | — | — | — | |
| 6 | 9 | 7 | 2 | 5.5 | ||
| 7 | 4 | 3 | 1 | 2 | ||
| 8 | 6 | 5 | 1 | 2 | ||
| 9 | 8 | 6 | 2 | 5.5 | ||
| 10 | 5 | 4 | 1 | 2 |
M1 A1
Exclude (patients 2 and 5),
Ties: appears 4 times (pts 4,7,8,10) → ranks 1,2,3,4 → average each appears 4 times (pts 1,3,6,9) → ranks 5,6,7,8 → average each
All differences < 0, so ,
M1 A1
One-tailed: : median < 0, so use (positive ranks) = 0
Critical value (one-tailed, , ): B1
0 < 5 ⇒ reject M1
Significant evidence that treatment reduces pain at the 5% level. A1
- 零差异()排除, 是非零差异的个数 = 8,不是 10
- 多个 ties:4 个 平均秩为
Example 3 — 9231/s23/qp/41 Q4 (9 marks):
Eight students took a mock exam and a final exam. Their scores:
| Student | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| Mock | 42 | 38 | 51 | 45 | 40 | 49 | 36 | 44 |
| Final | 45 | 41 | 50 | 47 | 42 | 52 | 38 | 43 |
Test at the 5% significance level whether there is a difference in scores.
📝 展开查看完整解法 + MS
: median difference : median difference (two-tailed) B1
| Student | Mock | Final | Rank | Signed | ||
|---|---|---|---|---|---|---|
| A | 42 | 45 | 3 | 6 | ||
| B | 38 | 41 | 3 | 7 | ||
| C | 51 | 50 | 1 | 2 | ||
| D | 45 | 47 | 2 | 4.5 | ||
| E | 40 | 42 | 2 | 4.5 | ||
| F | 49 | 52 | 3 | 8 | ||
| G | 36 | 38 | 2 | 1 | ||
| H | 44 | 43 | 1 | 2 |
M1 A1
Sorted: (C, H) → ranks (1,2) → avg 1.5 each (D, E, G) → ranks (3,4,5) → avg 4 each (but G has and is smallest among them... let me sort properly)
Actually, let me sort all |d|: 1 (C), 1 (H), 2 (G), 2 (D), 2 (E), 3 (A), 3 (B), 3 (F)
Ranks: C→1.5, H→1.5, G→3, D→4, E→5, A→6.5, B→6.5, F→8
Wait, G has |d|=2 but looking at the data, G has d=38-36=2, and G's rank... Actually let me just compute carefully by |d| order:
|d|=1: C(-1), H(-1) → ranks 1,2 → avg 1.5 each → signed: -1.5, -1.5 |d|=2: G(+2), D(+2), E(+2) → ranks 3,4,5 → avg 4 each → signed: +4, +4, +4 |d|=3: A(+3), B(+3), F(+3) → ranks 6,7,8 → avg 7 each → signed: +7, +7, +7
Wait but G has |d|=2 from score 36→38 = +2. But in my table above I put G as 2 → rank 1. Let me redo this properly.
Oh I see I made an error. Let me sort the absolute differences:
C: |d|=1, H: |d|=1 → tied for ranks 1-2 D: |d|=2, E: |d|=2, G: |d|=2 → tied for ranks 3-5 A: |d|=3, B: |d|=3, F: |d|=3 → tied for ranks 6-8
So: C: rank (1+2)/2 = 1.5, signed -1.5 H: rank 1.5, signed -1.5 D: rank (3+4+5)/3 = 4, signed +4 E: rank 4, signed +4 G: rank 4, signed +4 A: rank (6+7+8)/3 = 7, signed +7 B: rank 7, signed +7 F: rank 7, signed +7
M1 A1
Critical value (two-tailed, , ): B1
⇒ reject M1
Sufficient evidence of a difference in scores at the 5% level. A1
- 本题 临界值(3),恰好等于临界值 → 拒绝
- 3 个 ties 取平均秩
Question Type 3: Wilcoxon Rank-Sum Test (Two Independent Samples)
如何识别
题目给出两组独立样本数据,要求比较两组是否有显著差异。关键词:"two independent samples"、"rank-sum test"、"Mann-Whitney test"
- 合并两组数据,从小到大排序
- 赋予秩(最小值得秩 1)
- 相同值取平均秩
- 计算第一个样本的秩和
- 检验统计量
- 查 Wilcoxon rank-sum 临界值表
- 提出假设 B1
- 合并排序 M1
- 秩正确 A1
- 计算 M1 A1
- 临界值 B1
- 比较结论 M1 A1
Example 1 — 9231/s20/qp/41 Q6 (10 marks):
Two groups of students used different revision methods. Their test scores:
Method A: 64, 72, 58, 69, 75, 61, 70 Method B: 55, 63, 52, 60, 57, 65
Use a Wilcoxon rank-sum test at the 5% significance level to test whether the methods differ.
📝 展开查看完整解法 + MS
: The two populations have the same distribution : The two populations differ (two-tailed) B1 , ,
Combine and rank:
| Score | Method | Rank |
|---|---|---|
| 52 | B | 1 |
| 55 | B | 2 |
| 57 | B | 3 |
| 58 | A | 4 |
| 60 | B | 5 |
| 61 | A | 6 |
| 63 | B | 7 |
| 64 | A | 8 |
| 65 | B | 9 |
| 69 | A | 10 |
| 70 | A | 11 |
| 72 | A | 12 |
| 75 | A | 13 |
M1 A1 for correct combined ranking
(Method A) M1 A1
Critical values (two-tailed, , , ): Lower , Upper B1
is between 31 and 67 (or and ) M1 ⇒ do not reject
No significant difference between the two methods at the 5% level. A1
- 临界值范围:若 在区间内,则不拒绝;在区间外则拒绝
- 和 不要搞混:题目中 Method A 有 7 人,是
Example 2 — 9231/w21/qp/41 Q6 (10 marks):
Two types of plant food are tested on randomly selected plants. Growth (cm) after 4 weeks:
Food X: 14, 18, 11, 16, 19, 13, 17 Food Y: 10, 12, 9, 15, 8, 11
Use a Wilcoxon rank-sum test at the 5% significance level to test whether Food X gives more growth than Food Y.
📝 展开查看完整解法 + MS
: The two populations have the same distribution : Food X has more growth than Food Y (one-tailed) B1 , (X), (Y)
Combine and rank:
| Score | Food | Rank |
|---|---|---|
| 8 | Y | 1 |
| 9 | Y | 2 |
| 10 | Y | 3 |
| 11 | X | 4.5 |
| 11 | Y | 4.5 |
| 12 | Y | 6 |
| 13 | X | 7 |
| 14 | X | 8 |
| 15 | Y | 9 |
| 16 | X | 10 |
| 17 | X | 11 |
| 18 | X | 12 |
| 19 | X | 13 |
M1 A1 — tie: score 11 appears for both X and Y → ranks 4 and 5 → average 4.5
(Food X) M1 A1
One-tailed critical value (, , ): Upper (for one-tailed test) B1
65.5 > 64 ⇒ reject M1
Food X gives significantly more growth than Food Y at the 5% significance level. A1
- 单尾检验的临界值与双尾不同。双尾用 的临界值
- 本题是"greater than"的单尾检验,只需看上临界值
Question Type 4: Sign Test
如何识别
题目要求使用符号检验,只需计数正负号而不考虑大小。关键词:"sign test"、"ignore magnitude"
- 记录每项符号(+、-、0)
- 排除 0, = 非零符号数
- = 较少符号的个数
- 在 下,
- 计算 p-value(双尾 )
- 提出假设 B1
- 符号计数 M1
- 和 正确 A1
- 二项概率计算 M1
- p-value 正确 A1
- 比较结论 M1 A1
Example 1 — 9231/s24/qp/41 Q2 (7 marks):
A company claims that its new packaging increases customer satisfaction. 12 customers rate their satisfaction (1-10) before and after:
| Customer | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Before | 6 | 5 | 7 | 4 | 8 | 5 | 6 | 7 | 3 | 6 | 5 | 7 |
| After | 7 | 5 | 8 | 6 | 7 | 6 | 8 | 8 | 5 | 7 | 6 | 7 |
Use a sign test at the 5% significance level to test whether satisfaction has increased.
📝 展开查看完整解法 + MS
: P(\text{After} > \text{Before}) = P(\text{After} < \text{Before}) = 0.5 (no difference) : P(\text{After} > \text{Before}) > 0.5 (one-tailed) B1
| Customer | Before | After | Sign |
|---|---|---|---|
| 1 | 6 | 7 | + |
| 2 | 5 | 5 | 0 |
| 3 | 7 | 8 | + |
| 4 | 4 | 6 | + |
| 5 | 8 | 7 | − |
| 6 | 5 | 6 | + |
| 7 | 6 | 8 | + |
| 8 | 7 | 8 | + |
| 9 | 3 | 5 | + |
| 10 | 6 | 7 | + |
| 11 | 5 | 6 | + |
| 12 | 7 | 7 | 0 |
M1
: 9, : 1, : 2 (non-zero signs) A1 (number of signs, the less frequent)
Under ,
M1 A1
One-tailed test: p-value A1
0.01074 < 0.05 ⇒ reject M1
There is sufficient evidence that satisfaction has increased. A1
- 零差异排除后 (不是 12)
- 单尾检验,p-value 不需
- 本题用较少符号数()而非较多符号数
Example 2 — 9231/s25/qp/41 Q5 variation (8 marks):
A taste test compares two cola brands. 15 tasters each pick their preferred brand:
Prefer A: 11, Prefer B: 4
Use a sign test at the 5% significance level to test whether there is a preference.
📝 展开查看完整解法 + MS
: (no preference) : There is a preference (two-tailed) B1
(all tasters expressed a preference, no ties) (the smaller count) M1 A1
Under ,
M1 A1
Two-tailed: p-value A1
0.1184 > 0.05 ⇒ do not reject M1
No significant preference for either brand at the 5% level. A1
- 双尾检验 p-value 需要
- 本题没有零差异(所有 taster 都选了),所以
Question Type 5: Normal Approximation for Wilcoxon Tests
如何识别
样本量较大(signed-rank: n > 20,rank-sum: n_1, n_2 > 10),题目要求使用正态近似。关键词:"normal approximation"、"large sample"、"use a suitable approximation"
Signed-rank:
Rank-sum:
- 计算 :B1
- 计算 :M1 A1
- 计算 含连续性校正:M1 A1
- 比较 与 :M1
- 结论:A1
Example 1 — 9231/s22/qp/41 Q6 (10 marks):
A sample of 30 households recorded their monthly electricity bills (120 were calculated for a Wilcoxon signed-rank test. The sum of positive ranks .
Use a normal approximation at the 5% significance level to test whether the population median differs from $120.
📝 展开查看完整解法 + MS
: median : median (two-tailed) B1 , (assume no zero differences)
, total sum of ranks
B1
M1 A1
M1 A1
Two-tailed critical value: M1
|z| = 1.625 < 1.960 ⇒ do not reject M1
No evidence that median bill differs from $120 at the 5% level. A1
- ,因为双尾检验
- 连续性校正:(因为 T < \mu,下尾校正)
- 公式中有 ,不要写成 或
Example 2 — 9231/w23/qp/41 Q6 (10 marks):
A Wilcoxon signed-rank test on 25 pairs of data (matched pairs) gave and .
Use a normal approximation at the 5% significance level to test whether there is a difference.
📝 展开查看完整解法 + MS
: median difference : median difference (two-tailed) B1 ,
B1
M1 A1
M1 A1
M1
|z| = 0.942 < 1.960 ⇒ do not reject M1
No evidence of a significant difference at the 5% level. A1
- 是排除零差异后的样本量,如果原数据有零差异需先排除
- 连续性校正符号:T < \mu 时用
Example 3 — 9231/w25/qp/41 Q4 (9 marks):
A Wilcoxon rank-sum test comparing two groups with and gave as the rank sum for the first group.
Use a normal approximation at the 5% significance level to test whether the two groups differ.
📝 展开查看完整解法 + MS
: The two populations are identical : The two populations differ (two-tailed) B1 , ,
B1
M1 A1
is greater than , so upper tail: M1 A1
M1
2.972 > 1.960 ⇒ reject M1
Significant evidence of a difference between the two groups at the 5% level. A1
- Rank-sum 的正态近似 和 公式与 signed-rank 不同,不要混淆
- 上尾检验用 (因为 W > \mu),下尾检验用 (因为 W < \mu)