When the data isn't normal
The waits are skewed. Amara repeats yesterday's question about the median, with two tests that don't need normal data, and gets two different answers.
- 09:00Sign test with Astrid (Data Analyst)
- 11:00Wilcoxon test with Astrid (Data Analyst)
- 15:00Explain the difference to Augustin (Black Belt)
Situation 1 of 2
11:00 · Wilcoxon test with Astrid (Data Analyst)How do you explain it?
Situation 2 of 2
15:00 · Explain the difference to Augustin (Black Belt)What's the right choice?
Is the median wait above 7? Two tests compared
The waits are skewed, so Amara also tests the median, with two tests that don't need normal data.
| Request | Wait (days) | Above or below 7 |
|---|---|---|
| R01 | 12 | Above |
| R02 | 13 | Above |
| R03 | 12 | Above |
| R04 | 28 | Above |
| R05 | 11 | Above |
| R06 | 12 | Above |
| R07 | 16 | Above |
| R08 | 7 | Equal |
| R09 | 3 | Below |
| R10 | 4 | Below |
| R11 | 4 | Below |
| R12 | 10 | Above |
| R13 | 4 | Below |
| R14 | 17 | Above |
| R15 | 5 | Below |
| R16 | 8 | Above |
| R17 | 5 | Below |
| R18 | 5 | Below |
| R19 | 5 | Below |
| R20 | 20 | Above |
| R21 | 3 | Below |
| R22 | 15 | Above |
| R23 | 5 | Below |
| R24 | 9 | Above |
| R25 | 5 | Below |
| R26 | 5 | Below |
| R27 | 15 | Above |
| R28 | 15 | Above |
| R29 | 14 | Above |
| R30 | 13 | Above |
| R31 | 18 | Above |
| R32 | 16 | Above |
| R33 | 3 | Below |
| R34 | 5 | Below |
| R35 | 10 | Above |
| R36 | 7 | Equal |
| R37 | 6 | Below |
| R38 | 10 | Above |
| R39 | 10 | Above |
| R40 | 5 | Below |
| R41 | 5 | Below |
| R42 | 4 | Below |
| R43 | 5 | Below |
| R44 | 6 | Below |
| R45 | 7 | Equal |
| R46 | 11 | Above |
| R47 | 11 | Above |
| R48 | 3 | Below |
| R49 | 13 | Above |
| R50 | 26 | Above |
| R51 | 12 | Above |
| R52 | 22 | Above |
| R53 | 27 | Above |
| R54 | 18 | Above |
| R55 | 4 | Below |
| R56 | 14 | Above |
| R57 | 20 | Above |
| R58 | 3 | Below |
| R59 | 6 | Below |
| R60 | 19 | Above |
- Hypotheses
H0: the median is 7. H1: it is above 7 - Sign test: count signs
above 7: 33 · below 7: 24 · equal: 3 (left out)= 57 used - Sign test: p-value
chance of 33 or more “above” out of 57 if each were 50:50= 0.14 - Wilcoxon: rank the distances
rank |wait − 7| for the 57, add the ranks of waits above 7= W = 1,277.5 - Wilcoxon: p-value
from the rank sum= 0.0002 - Compare
the sign test only uses direction; Wilcoxon also uses how far= Wilcoxon is more powerful
Try it yourself in a spreadsheet
| Count above | =COUNTIF(B2:B61,">7") |
| Sign test p-value | =1-BINOM.DIST(32,57,0.5,TRUE) |
| Wilcoxon | rank =ABS(B2-7) with RANK.AVG, sum the ranks where B2>7; spreadsheets have no built-in p-value: use the normal approximation or a statistics add-on |
In another sample, 40 of 50 values are above the target and 10 below. Would the sign test show a difference?
Show the answer
Yes. 40 of 50 is far from 25 of 50: p = 1 − BINOM.DIST(39,50,0.5,TRUE), about 0.00001.
Key concepts
The ideas behind today. Concept how the work is done, in our own words · Common practice widely used ways of working.
Tests that don't need normal data
- Rank-based and sign-based tests work on skewed data. They compare medians or ranks instead of averages.
Where you will meet this: Non-parametric tests
Sign test and Wilcoxon
- The sign test uses only whether each value is above or below the target. Wilcoxon also uses how far, through ranks, so it finds real differences more often.
Where you will meet this: One-sample sign test · one-sample Wilcoxon
Choose before you look
- Pick the test from the question and the data before seeing results. Running tests until one says yes is fooling yourself.
Explained in our own words. This helps you understand the concepts behind the certifications; it does not reproduce or replace any official guide. Sources
Day 29 complete
2 situations today.
- Tests that use more of the data (Wilcoxon) are more powerful than tests that use less (sign test). Choose before you run them.
- Choose the test from the question and the data type before looking at results.