A random sample of 7 values is used to test H0: median = 20 against H1: median > 20 with a Wilcoxon signed-rank test. The values minus 20 are 5, −2, 9, 3, −1, 7 and 4. The critical value for n = 7 (one-tail, 5%) is 3. Carry out the test.
- Sizes in order: 1, 2, 3, 4, 5, 7, 9 take ranks 1 to 7. The negative differences −1 and −2 have ranks 1 and 2.
- Q = 1 + 2 = 3 and P = 3 + 4 + 5 + 6 + 7 = 25. Check: 3 + 25 = 28 = 7 × 8/2.
- T = smaller of P and Q = 3. Since 3 ≤ 3, T is in the critical region.
Answer: T = 3; reject H0. There is evidence at the 5% level that the median is greater than 20.