Skip to content

9231 · 4.4

Non-parametric tests — practice questions

Practice and worked examples for 9231 Non-parametric tests. Short previews only — attempt the full question in MarkScheme against the official scheme.

Worked example 1

A local authority claims the median response time for an ambulance is 8 minutes. A random sample of 10 emergency calls had the following response times (in minutes): 7.5, 9.1, 8.2, 10.5, 7.9, 8.0, 9.5, 11.2, 7.1, 8.9. Test the authority's claim at the 5% significance level.

Show solution outline

Let mm be the median response time. 1. Hypotheses: H0:m=8H_0: m = 8 H1:m8H_1: m \neq 8 (two-tailed test)

2. Calculate Signs: We compare each value to the hypothesised median of 8. 7.5 (-), 9.1 (+), 8.2 (+), 10.5 (+), 7.9 (-), 8.0 (0), 9.5 (+), 11.2 (+), 7.1 (-), 8.9 (+) We discard the one value of 8.0, so our effective sample size is n=9n=9. Number of '+': N+=6N_+ = 6 Number of '−': N=3N_- = 3

3. Test Statistic: The test statistic is S=min(N+,N)=3S = \min(N_+, N_-) = 3.

4. P-value Calculation: Let XX be the number of '−' signs. Under H0H_0, XB(9,0.5)X \sim B(9, 0.5). We are conducting a two-tailed test, so we find the probability of a result as or more extreme than S=3S=3. The p-value is 2×P(X3)2 \times P(X \le 3). P(X3)=P(X=0)+P(X=1)+P(X=2)+P(X=3)P(X \le 3) = P(X=0) + P(X=1) + P(X=2) + P(X=3) P(X=k)=(9k)(0.5)9P(X=k) = \binom{9}{k}(0.5)^9 P(X3)=[(90)+(91)+(92)+(93)](0.5)9=[1+9+36+84](0.5)9=130×0.001953...=0.2539P(X \le 3) = [\binom{9}{0} + \binom{9}{1} + \binom{9}{2} + \binom{9}{3}](0.5)^9 = [1+9+36+84](0.5)^9 = 130 \times 0.001953... = 0.2539 p-value = 2×0.2539=0.50782 \times 0.2539 = 0.5078

5. Conclusion: Since the p-value (0.5078) is greater than the significance level (0.05), we do not reject H0H_0. There is insufficient evidence to suggest that the median response time is different from 8 minutes.

Worked example 2

The manufacturer of a battery claims its median lifespan is 250 hours. A random sample of 8 batteries is tested and their lifespans are: 241, 262, 255, 238, 245, 271, 231, 258. Use a Wilcoxon signed-rank test at the 5% level to test if the median lifespan is different from 250 hours.

Show solution outline

Let mm be the median lifespan. 1. Hypotheses: H0:m=250H_0: m = 250 H1:m250H_1: m \neq 250 (two-tailed test)

2. Calculate Differences and Ranks: Sample size n=8n=8. No values are equal to 250. | Lifespan (x) | Difference (x-250) | |Difference| | Rank | |---|---|---|---|---|

241-994
262+12126
255+552
238-12126
245-552
271+21218
231-19197
258+883

Handling ties: The absolute differences 5 and 5 would be ranks 1 and 2. Average is (1+2)/2=1.5(1+2)/2 = 1.5. Oh wait, I made a mistake in my scratchpad. Let's re-rank properly.

Corrected Ranking: Absolute differences in order: 5, 5, 8, 9, 12, 12, 19, 21. Ranks to be assigned: 1, 2, 3, 4, 5, 6, 7, 8.

  • The two '5's occupy ranks 1 and 2. Their rank is (1+2)/2=1.5(1+2)/2 = 1.5.
  • The '8' gets rank 3.
  • The '9' gets rank 4.
  • The two '12's occupy ranks 5 and 6. Their rank is (5+6)/2=5.5(5+6)/2 = 5.5.
  • The '19' gets rank 7.
  • The '21' gets rank 8.

| Lifespan (x) | Difference (x-250) | |Difference| | Rank | |---|---|---|---|---|

241-994
262+12125.5
255+551.5
238-12125.5
245-551.5
271+21218
231-19197
258+883

3. Sum Ranks and find Test Statistic: W+W_+ (sum of ranks for positive differences): 5.5+1.5+8+3=185.5 + 1.5 + 8 + 3 = 18 WW_- (sum of ranks for negative differences): 4+5.5+1.5+7=184 + 5.5 + 1.5 + 7 = 18 Check: W++W=18+18=36W_+ + W_- = 18 + 18 = 36. Also 12n(n+1)=12(8)(9)=36\frac{1}{2}n(n+1) = \frac{1}{2}(8)(9) = 36. Correct. Test statistic W=min(W+,W)=18W = \min(W_+, W_-) = 18.

4. Critical Value: From MF19 tables for Wilcoxon signed-rank test, for a two-tailed test at 5% significance with n=8n=8, the critical value is 3.

5. Conclusion: We reject H0H_0 if WW \le critical value. Here, 18>318 > 3. So we do not reject H0H_0. There is insufficient evidence at the 5% level to suggest the median battery lifespan is different from 250 hours.