跳到主要内容

题型分析 — 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₀.
评分标准(MS 模式)
  • 提出假设 B1
  • 计算差值 M1
  • 赋秩正确 A1
  • 求出 TT, T+T^+, TT^- 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:

52,47,61,55,58,43,49,54,51,5652, 47, 61, 55, 58, 43, 49, 54, 51, 56

Use a Wilcoxon signed-rank test at the 5% significance level to test whether the population median is 50.

📝 展开查看完整解法 + MS

H0H_0: median =50= 50, H1H_1: median 50\neq 50 (two-tailed), α=0.05\alpha = 0.05 B1

Data sorted: 43, 47, 49, 51, 52, 54, 55, 56, 58, 61

xxd=x50d = x - 50d\|d\|RankSigned rank
437-7777-7
473-3333-3
491-1111-1
51+1+112+2+2
52+2+224+4+4
54+4+445+5+5
55+5+556+6+6
56+6+668+8+8
58+8+889+9+9
61+11+111110+10+10

M1 for differences and ranks, A1 for correct ranks

Note: d=1|d| = 1 appears twice (49 and 51), so they share ranks 1 and 2 → both get rank (1+2)/2=1.5(1+2)/2 = 1.5. The next rank is 3.

Corrected table:

xxd=x50d = x - 50d\|d\|RankSigned rank
491-111.51.5-1.5
51+1+111.5+1.5+1.5
473-3333-3
52+2+224+4+4
54+4+445+5+5
55+5+556+6+6
437-7777-7
56+6+668+8+8
58+8+889+9+9
61+11+111110+10+10

T+=1.5+4+5+6+8+9+10=43.5T^+ = 1.5 + 4 + 5 + 6 + 8 + 9 + 10 = 43.5 T=1.5+3+7=11.5T^- = 1.5 + 3 + 7 = 11.5

T=min(43.5,11.5)=11.5T = \min(43.5, 11.5) = 11.5 M1 A1

Critical value (two-tailed, n=10n = 10, α=0.05\alpha = 0.05): 88 B1

11.5 > 8 ⇒ do not reject H0H_0 M1

Insufficient evidence that median differs from 50 at the 5% significance level. A1

常见陷阱
  • 相同绝对值(ties)取平均秩:d=1|d| = 1 出现了两次,都应取秩 (1+2)/2=1.5(1+2)/2 = 1.5
  • T=min(T+,T)T = \min(T^+, T^-),不是 max\max
  • 临界值查表用 n=10n = 10(不是样本量 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:

18,23,15,32,27,22,29,19,26,31,20,2418, 23, 15, 32, 27, 22, 29, 19, 26, 31, 20, 24

Use a Wilcoxon signed-rank test at the 5% significance level to test whether the population median is 25 minutes.

📝 展开查看完整解法 + MS

H0H_0: median =25= 25, H1H_1: median 25\neq 25 (two-tailed), α=0.05\alpha = 0.05 B1

xxd=x25d = x - 25d\|d\|RankSigned rank
1510-10101010-10
187-7777-7
196-6666-6
205-5555-5
223-333.53.5-3.5
232-2222-2
241-1111-1
26+1+113.5+3.5+3.5
27+2+228+8+8
29+4+449+9+9
31+6+6611+11+11
32+7+7712+12+12

M1 A1 for ranks

Note ties: d=2|d| = 2 occurs for 22 and 27 → ranks 3 and 4 → average 3.5 each

T+=3.5+8+9+11+12=43.5T^+ = 3.5 + 8 + 9 + 11 + 12 = 43.5 T=10+7+6+5+3.5+2+1=34.5T^- = 10 + 7 + 6 + 5 + 3.5 + 2 + 1 = 34.5

T=min(43.5,34.5)=34.5T = \min(43.5, 34.5) = 34.5 M1 A1

Critical value (two-tailed, n=12n = 12, α=0.05\alpha = 0.05): 1313 B1

34.5 > 13 ⇒ do not reject H0H_0 M1

Insufficient evidence to suggest median waiting time differs from 25 minutes. A1

常见陷阱
  • 本题 TT 很大(34.5),临界值很小(13),结论是不拒绝 H0H_0,但必须写出完整比较过程

Example 3 — 9231/s24/qp/41 Q3 (9 marks):

A random sample of 11 light bulbs has the following lifetimes (in hours):

1205,1180,1220,1195,1235,1175,1210,1240,1185,1225,11901205, 1180, 1220, 1195, 1235, 1175, 1210, 1240, 1185, 1225, 1190

Test at the 5% significance level whether the population median is 1200 hours.

📝 展开查看完整解法 + MS

H0H_0: median =1200= 1200, H1H_1: median 1200\neq 1200 (two-tailed), α=0.05\alpha = 0.05 B1

xxd=x1200d = x - 1200d\|d\|RankSigned rank
117525-25251010-10
118020-202088-8
118515-151566-6
119010-101044-4
11955-5522-2
1205+5+553+3+3
1210+10+10105+5+5
1220+20+20209+9+9
1225+25+252511+11+11
1235+35+35357+7+7
1240+40+40401+1+1

M1 A1 for ranks

Ties: d=5|d| = 5 appears for 1195 and 1205 → ranks 2 and 3 → average 2.5 each d=10|d| = 10 appears for 1190 and 1210 → ranks 4 and 5 → average 4.5 each d=20|d| = 20 appears for 1180 and 1220 → ranks 8 and 9 → average 8.5 each d=25|d| = 25 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:

xxddd\|d\|RankSigned
11955-551.51.5-1.5
1205+5+551.5+1.5+1.5
119010-10103.53.5-3.5
1210+10+10103.5+3.5+3.5
118515-151555-5
118020-20206.56.5-6.5
1220+20+20206.5+6.5+6.5
117525-25258.58.5-8.5
1225+25+25258.5+8.5+8.5
1235+35+353510+10+10
1240+40+404011+11+11

T+=1.5+3.5+6.5+8.5+10+11=41T^+ = 1.5 + 3.5 + 6.5 + 8.5 + 10 + 11 = 41 T=1.5+3.5+5+6.5+8.5=25T^- = 1.5 + 3.5 + 5 + 6.5 + 8.5 = 25

T=min(41,25)=25T = \min(41, 25) = 25 M1 A1

Critical value (two-tailed, n=11n = 11, α=0.05\alpha = 0.05): 1010 B1

25 > 10 ⇒ do not reject H0H_0 M1

Insufficient evidence that median differs from 1200. A1

常见陷阱
  • 多个 ties 要小心处理:4 对 ties 需要逐对取平均秩
  • 本题全部 11 个差异都非零,所以 n=11n = 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
评分标准(MS 模式)

与 Type 1 相同。

Example 1 — 9231/s21/qp/41 Q5 (10 marks):

Eight employees undergo a training course. Their productivity scores before and after are:

EmployeeABCDEFGH
Before6255704865587250
After6858735566637654

Use a Wilcoxon signed-rank test at the 5% significance level to test whether the training improves productivity.

📝 展开查看完整解法 + MS

H0H_0: median difference =0= 0 H1H_1: median difference > 0 (one-tailed — testing for improvement) B1 α=0.05\alpha = 0.05

EmpBeforeAfterdd (After - Before)d\|d\|RankSigned
A6268+6+665+5+5
B5558+3+333+3+3
C7073+3+334+4+4
D4855+7+776+6+6
E6566+1+111.5+1.5+1.5
F5863+5+557+7+7
G7276+4+448+8+8
H5054+4+442+2+2

M1 for differences, A1 for ranks

Ties: d=3|d| = 3 for B and C → ranks 3 and 4 → average 3.5 each d=1|d| = 1 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:

Empddd\|d\|RankSigned
E+1+111+1+1
B+3+332.5+2.5+2.5
C+3+332.5+2.5+2.5
H+4+444.5+4.5+4.5
G+4+444.5+4.5+4.5
F+5+556+6+6
A+6+667+7+7
D+7+778+8+8

All differences > 0, so T+=1+2.5+2.5+4.5+4.5+6+7+8=36T^+ = 1 + 2.5 + 2.5 + 4.5 + 4.5 + 6 + 7 + 8 = 36 T=0T^- = 0 T=min(36,0)=0T = \min(36, 0) = 0 M1 A1

One-tailed test: Since H1H_1 is median > 0, we use TT^- (sum of negative ranks) = 0

Critical value (one-tailed, n=8n = 8, α=0.05\alpha = 0.05): 55 B1

0 < 5 ⇒ reject H0H_0 M1

There is sufficient evidence that training improves productivity at the 5% level. A1

常见陷阱
  • 单尾检验时注意用对 TT 值:若 H1H_1> 0,则关注 TT^-(负秩和);若 H1H_1< 0,则关注 T+T^+
  • 本题所有差异为正,T=0T = 0,是最极端的情况

Example 2 — 9231/w22/qp/41 Q3 (9 marks):

Ten patients rated their pain level (scale 0–10) before and after treatment:

Patient12345678910
Before7685794685
After5664773564

Use a Wilcoxon signed-rank test at the 5% significance level to test whether the treatment reduces pain.

📝 展开查看完整解法 + MS

H0H_0: median difference =0= 0 H1H_1: median difference < 0 (pain reduced → After - Before < 0) B1 α=0.05\alpha = 0.05

PtBeforeAfterd=ABd = A - Bd\|d\|RankSigned
1752-225.55.5-5.5
26600
3862-225.55.5-5.5
4541-1122-2
57700
6972-225.55.5-5.5
7431-1122-2
8651-1122-2
9862-225.55.5-5.5
10541-1122-2

M1 A1

Exclude d=0d = 0 (patients 2 and 5), n=8n = 8

Ties: d=1|d| = 1 appears 4 times (pts 4,7,8,10) → ranks 1,2,3,4 → average (1+2+3+4)/4=2.5(1+2+3+4)/4 = 2.5 each d=2|d| = 2 appears 4 times (pts 1,3,6,9) → ranks 5,6,7,8 → average (5+6+7+8)/4=6.5(5+6+7+8)/4 = 6.5 each

All differences < 0, so T+=0T^+ = 0, T=4×(2.5)+4×(6.5)=36T^- = 4 \times (-2.5) + 4 \times (-6.5) = -36

T=min(0,36)=0T = \min(0, 36) = 0 M1 A1

One-tailed: H1H_1: median < 0, so use T+T^+ (positive ranks) = 0

Critical value (one-tailed, n=8n = 8, α=0.05\alpha = 0.05): 55 B1

0 < 5 ⇒ reject H0H_0 M1

Significant evidence that treatment reduces pain at the 5% level. A1

常见陷阱
  • 零差异(d=0d = 0)排除,nn非零差异的个数 = 8,不是 10
  • 多个 ties:4 个 d=1|d| = 1 平均秩为 (1+2+3+4)/4=2.5(1+2+3+4)/4 = 2.5

Example 3 — 9231/s23/qp/41 Q4 (9 marks):

Eight students took a mock exam and a final exam. Their scores:

StudentABCDEFGH
Mock4238514540493644
Final4541504742523843

Test at the 5% significance level whether there is a difference in scores.

📝 展开查看完整解法 + MS

H0H_0: median difference =0= 0 H1H_1: median difference 0\neq 0 (two-tailed) B1 α=0.05\alpha = 0.05

StudentMockFinald=FMd = F - Md\|d\|RankSigned
A4245+3+336+6+6
B3841+3+337+7+7
C51501-1122-2
D4547+2+224.5+4.5+4.5
E4042+2+224.5+4.5+4.5
F4952+3+338+8+8
G3638+2+221+1+1
H44431-1122-2

M1 A1

Sorted: d=1|d|=1 (C, H) → ranks (1,2) → avg 1.5 each d=2|d|=2 (D, E, G) → ranks (3,4,5) → avg 4 each (but G has d=2|d|=2 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

T+=4+4+4+7+7+7=33T^+ = 4 + 4 + 4 + 7 + 7 + 7 = 33 T=1.5+1.5=3T^- = 1.5 + 1.5 = 3

T=min(33,3)=3T = \min(33, 3) = 3 M1 A1

Critical value (two-tailed, n=8n = 8, α=0.05\alpha = 0.05): 33 B1

333 \leq 3 ⇒ reject H0H_0 M1

Sufficient evidence of a difference in scores at the 5% level. A1

常见陷阱
  • 本题 T=T = 临界值(3),恰好等于临界值 → 拒绝 H0H_0
  • 3 个 ties 取平均秩 (3+4+5)/3=4(3+4+5)/3 = 4

Question Type 3: Wilcoxon Rank-Sum Test (Two Independent Samples)

如何识别

题目给出两组独立样本数据,要求比较两组是否有显著差异。关键词:"two independent samples"、"rank-sum test"、"Mann-Whitney test"

标准解题方法
  1. 合并两组数据,从小到大排序
  2. 赋予秩(最小值得秩 1)
  3. 相同值取平均秩
  4. 计算第一个样本的秩和 R1R_1
  5. 检验统计量 W=R1W = R_1
  6. 查 Wilcoxon rank-sum 临界值表
评分标准(MS 模式)
  • 提出假设 B1
  • 合并排序 M1
  • 秩正确 A1
  • 计算 R1R_1 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

H0H_0: The two populations have the same distribution H1H_1: The two populations differ (two-tailed) B1 α=0.05\alpha = 0.05, n1=7n_1 = 7, n2=6n_2 = 6

Combine and rank:

ScoreMethodRank
52B1
55B2
57B3
58A4
60B5
61A6
63B7
64A8
65B9
69A10
70A11
72A12
75A13

M1 A1 for correct combined ranking

R1R_1 (Method A) =4+6+8+10+11+12+13=64= 4 + 6 + 8 + 10 + 11 + 12 + 13 = 64 M1 A1

Critical values (two-tailed, n1=7n_1 = 7, n2=6n_2 = 6, α=0.05\alpha = 0.05): Lower =31= 31, Upper =67= 67 B1

6464 is between 31 and 67 (or 646764 \leq 67 and 643164 \geq 31) M1 ⇒ do not reject H0H_0

No significant difference between the two methods at the 5% level. A1

常见陷阱
  • 临界值范围:若 WW 在区间内,则不拒绝;在区间外则拒绝
  • n1n_1n2n_2 不要搞混:题目中 Method A 有 7 人,是 n1n_1

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

H0H_0: The two populations have the same distribution H1H_1: Food X has more growth than Food Y (one-tailed) B1 α=0.05\alpha = 0.05, n1=7n_1 = 7 (X), n2=6n_2 = 6 (Y)

Combine and rank:

ScoreFoodRank
8Y1
9Y2
10Y3
11X4.5
11Y4.5
12Y6
13X7
14X8
15Y9
16X10
17X11
18X12
19X13

M1 A1 — tie: score 11 appears for both X and Y → ranks 4 and 5 → average 4.5

R1R_1 (Food X) =4.5+7+8+10+11+12+13=65.5= 4.5 + 7 + 8 + 10 + 11 + 12 + 13 = 65.5 M1 A1

One-tailed critical value (n1=7n_1 = 7, n2=6n_2 = 6, α=0.05\alpha = 0.05): Upper =64= 64 (for one-tailed test) B1

65.5 > 64 ⇒ reject H0H_0 M1

Food X gives significantly more growth than Food Y at the 5% significance level. A1

常见陷阱
  • 单尾检验的临界值与双尾不同。双尾用 α/2\alpha/2 的临界值
  • 本题是"greater than"的单尾检验,只需看上临界值

Question Type 4: Sign Test

如何识别

题目要求使用符号检验,只需计数正负号而不考虑大小。关键词:"sign test"、"ignore magnitude"

标准解题方法
  1. 记录每项符号(+、-、0)
  2. 排除 0,nn = 非零符号数
  3. SS = 较少符号的个数
  4. H0H_0 下,SB(n,0.5)S \sim B(n, 0.5)
  5. 计算 p-value(双尾 ×2\times 2
评分标准(MS 模式)
  • 提出假设 B1
  • 符号计数 M1
  • SSnn 正确 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:

Customer123456789101112
Before657485673657
After758676885767

Use a sign test at the 5% significance level to test whether satisfaction has increased.

📝 展开查看完整解法 + MS

H0H_0: P(\text{After} > \text{Before}) = P(\text{After} < \text{Before}) = 0.5 (no difference) H1H_1: P(\text{After} > \text{Before}) > 0.5 (one-tailed) B1 α=0.05\alpha = 0.05

CustomerBeforeAfterSign
167+
2550
378+
446+
587
656+
768+
878+
935+
1067+
1156+
12770

M1

++ : 9, - : 1, 00 : 2 n=122=10n = 12 - 2 = 10 (non-zero signs) A1 S=1S = 1 (number of - signs, the less frequent)

Under H0H_0, SB(10,0.5)S \sim B(10, 0.5)

P(S1)=P(S=0)+P(S=1)P(S \leq 1) = P(S = 0) + P(S = 1) =(100)(0.5)10+(101)(0.5)10= \binom{10}{0}(0.5)^{10} + \binom{10}{1}(0.5)^{10} =(1+10)×0.510=11×0.0009766=0.01074= (1 + 10) \times 0.5^{10} = 11 \times 0.0009766 = 0.01074

M1 A1

One-tailed test: p-value =0.01074= 0.01074 A1

0.01074 < 0.05 ⇒ reject H0H_0 M1

There is sufficient evidence that satisfaction has increased. A1

常见陷阱
  • 零差异排除后 n=10n = 10(不是 12)
  • 单尾检验,p-value 不需 ×2\times 2
  • 本题用较少符号数(S=1S = 1)而非较多符号数

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

H0H_0: P(prefer A)=P(prefer B)=0.5P(\text{prefer A}) = P(\text{prefer B}) = 0.5 (no preference) H1H_1: There is a preference (two-tailed) B1 α=0.05\alpha = 0.05

n=15n = 15 (all tasters expressed a preference, no ties) S=4S = 4 (the smaller count) M1 A1

Under H0H_0, SB(15,0.5)S \sim B(15, 0.5)

P(S4)=r=04(15r)(0.5)15P(S \leq 4) = \sum_{r=0}^4 \binom{15}{r}(0.5)^{15} =(1+15+105+455+1365)×0.515= (1 + 15 + 105 + 455 + 1365) \times 0.5^{15} =1941×0.00003052=0.0592= 1941 \times 0.00003052 = 0.0592 M1 A1

Two-tailed: p-value =2×0.0592=0.1184= 2 \times 0.0592 = 0.1184 A1

0.1184 > 0.05 ⇒ do not reject H0H_0 M1

No significant preference for either brand at the 5% level. A1

常见陷阱
  • 双尾检验 p-value 需要 ×2\times 2
  • 本题没有零差异(所有 taster 都选了),所以 n=15n = 15

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: μT=n(n+1)4,σT=n(n+1)(2n+1)24\mu_T = \frac{n(n+1)}{4}, \quad \sigma_T = \sqrt{\frac{n(n+1)(2n+1)}{24}} z=T±0.5μTσTz = \frac{T \pm 0.5 - \mu_T}{\sigma_T}

Rank-sum: μW=n1(n1+n2+1)2,σW=n1n2(n1+n2+1)12\mu_W = \frac{n_1(n_1+n_2+1)}{2}, \quad \sigma_W = \sqrt{\frac{n_1 n_2 (n_1+n_2+1)}{12}} z=W±0.5μWσWz = \frac{W \pm 0.5 - \mu_W}{\sigma_W}

评分标准(MS 模式)
  • 计算 μ\muB1
  • 计算 σ\sigmaM1 A1
  • 计算 zz 含连续性校正:M1 A1
  • 比较 z|z|zcritz_{\text{crit}}M1
  • 结论:A1

Example 1 — 9231/s22/qp/41 Q6 (10 marks):

A sample of 30 households recorded their monthly electricity bills ().Thedifferencesfromthenationalaverageof). The differences from the national average of 120 were calculated for a Wilcoxon signed-rank test. The sum of positive ranks T+=312T^+ = 312.

Use a normal approximation at the 5% significance level to test whether the population median differs from $120.

📝 展开查看完整解法 + MS

H0H_0: median =120= 120 H1H_1: median 120\neq 120 (two-tailed) B1 α=0.05\alpha = 0.05, n=30n = 30 (assume no zero differences)

T+=312T^+ = 312, total sum of ranks =30×312=465= \frac{30 \times 31}{2} = 465 T=465312=153T^- = 465 - 312 = 153 T=min(312,153)=153T = \min(312, 153) = 153

μT=n(n+1)4=30×314=232.5\mu_T = \frac{n(n+1)}{4} = \frac{30 \times 31}{4} = 232.5 B1

σT=n(n+1)(2n+1)24=30×31×6124=5673024=2363.75=48.62\sigma_T = \sqrt{\frac{n(n+1)(2n+1)}{24}} = \sqrt{\frac{30 \times 31 \times 61}{24}} = \sqrt{\frac{56730}{24}} = \sqrt{2363.75} = 48.62 M1 A1

z=T+0.5μTσT=153+0.5232.548.62=7948.62=1.625z = \frac{T + 0.5 - \mu_T}{\sigma_T} = \frac{153 + 0.5 - 232.5}{48.62} = \frac{-79}{48.62} = -1.625 M1 A1

Two-tailed critical value: z0.025=1.960z_{0.025} = 1.960 M1

|z| = 1.625 < 1.960 ⇒ do not reject H0H_0 M1

No evidence that median bill differs from $120 at the 5% level. A1

常见陷阱
  • T=min(T+,T)T = \min(T^+, T^-),因为双尾检验
  • 连续性校正:T+0.5T + 0.5(因为 T < \mu,下尾校正)
  • σT\sigma_T 公式中有 2n+12n+1,不要写成 2n2n2n12n-1

Example 2 — 9231/w23/qp/41 Q6 (10 marks):

A Wilcoxon signed-rank test on 25 pairs of data (matched pairs) gave T+=198T^+ = 198 and T=127T^- = 127.

Use a normal approximation at the 5% significance level to test whether there is a difference.

📝 展开查看完整解法 + MS

H0H_0: median difference =0= 0 H1H_1: median difference 0\neq 0 (two-tailed) B1 α=0.05\alpha = 0.05, n=25n = 25

T=min(198,127)=127T = \min(198, 127) = 127

μT=n(n+1)4=25×264=162.5\mu_T = \frac{n(n+1)}{4} = \frac{25 \times 26}{4} = 162.5 B1

σT=n(n+1)(2n+1)24=25×26×5124=3315024=1381.25=37.17\sigma_T = \sqrt{\frac{n(n+1)(2n+1)}{24}} = \sqrt{\frac{25 \times 26 \times 51}{24}} = \sqrt{\frac{33150}{24}} = \sqrt{1381.25} = 37.17 M1 A1

z=T+0.5μTσT=127+0.5162.537.17=3537.17=0.942z = \frac{T + 0.5 - \mu_T}{\sigma_T} = \frac{127 + 0.5 - 162.5}{37.17} = \frac{-35}{37.17} = -0.942 M1 A1

z0.025=1.960z_{0.025} = 1.960 M1

|z| = 0.942 < 1.960 ⇒ do not reject H0H_0 M1

No evidence of a significant difference at the 5% level. A1

常见陷阱
  • n=25n = 25 是排除零差异后的样本量,如果原数据有零差异需先排除
  • 连续性校正符号:T < \mu 时用 T+0.5T + 0.5

Example 3 — 9231/w25/qp/41 Q4 (9 marks):

A Wilcoxon rank-sum test comparing two groups with n1=14n_1 = 14 and n2=16n_2 = 16 gave R1=289R_1 = 289 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

H0H_0: The two populations are identical H1H_1: The two populations differ (two-tailed) B1 n1=14n_1 = 14, n2=16n_2 = 16, W=R1=289W = R_1 = 289 α=0.05\alpha = 0.05

μW=n1(n1+n2+1)2=14×(14+16+1)2=14×312=217\mu_W = \frac{n_1(n_1 + n_2 + 1)}{2} = \frac{14 \times (14 + 16 + 1)}{2} = \frac{14 \times 31}{2} = 217 B1

σW=n1n2(n1+n2+1)12=14×16×3112=694412=578.67=24.06\sigma_W = \sqrt{\frac{n_1 n_2 (n_1 + n_2 + 1)}{12}} = \sqrt{\frac{14 \times 16 \times 31}{12}} = \sqrt{\frac{6944}{12}} = \sqrt{578.67} = 24.06 M1 A1

W=289W = 289 is greater than μW=217\mu_W = 217, so upper tail: z=W0.5μWσW=2890.521724.06=71.524.06=2.972z = \frac{W - 0.5 - \mu_W}{\sigma_W} = \frac{289 - 0.5 - 217}{24.06} = \frac{71.5}{24.06} = 2.972 M1 A1

z0.025=1.960z_{0.025} = 1.960 M1

2.972 > 1.960 ⇒ reject H0H_0 M1

Significant evidence of a difference between the two groups at the 5% level. A1

常见陷阱
  • Rank-sum 的正态近似 μ\muσ\sigma 公式与 signed-rank 不同,不要混淆
  • 上尾检验用 W0.5W - 0.5(因为 W > \mu),下尾检验用 W+0.5W + 0.5(因为 W < \mu