Day 29 of 55Stage 3 · AnalyseThursdayOne-sample tests

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.

Stage goal: Find and prove the root causes.
Team
Astrid (Data Analyst)
Stakeholders
Augustin (Black Belt)
Documents today Analysis record
How the day goes
  1. 09:00Sign test with Astrid (Data Analyst)
  2. 11:00Wilcoxon test with Astrid (Data Analyst)
  3. 15:00Explain the difference to Augustin (Black Belt)

Situation 1 of 2

11:00 · Wilcoxon test with Astrid (Data Analyst)
Astrid (Data Analyst)
The sign test says p = 0.14, not significant. The Wilcoxon test says p = 0.0002. Which one is wrong?

How do you explain it?

Tests that use more of the data (Wilcoxon) are more powerful than tests that use less (sign test). Choose before you run them.

Situation 2 of 2

15:00 · Explain the difference to Augustin (Black Belt)
Augustin (Black Belt)mentor
So which test should you have chosen, before seeing any results?

What's the right choice?

Choose the test from the question and the data type before looking at results.
Worked example 1

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.

RequestWait (days)Above or below 7
R0112Above
R0213Above
R0312Above
R0428Above
R0511Above
R0612Above
R0716Above
R087Equal
R093Below
R104Below
R114Below
R1210Above
R134Below
R1417Above
R155Below
R168Above
R175Below
R185Below
R195Below
R2020Above
R213Below
R2215Above
R235Below
R249Above
R255Below
R265Below
R2715Above
R2815Above
R2914Above
R3013Above
R3118Above
R3216Above
R333Below
R345Below
R3510Above
R367Equal
R376Below
R3810Above
R3910Above
R405Below
R415Below
R424Below
R435Below
R446Below
R457Equal
R4611Above
R4711Above
R483Below
R4913Above
R5026Above
R5112Above
R5222Above
R5327Above
R5418Above
R554Below
R5614Above
R5720Above
R583Below
R596Below
R6019Above
Download the data (spreadsheet file)
  1. HypothesesH0: the median is 7. H1: it is above 7
  2. Sign test: count signsabove 7: 33 · below 7: 24 · equal: 3 (left out)= 57 used
  3. Sign test: p-valuechance of 33 or more “above” out of 57 if each were 50:50= 0.14
  4. Wilcoxon: rank the distancesrank |wait − 7| for the 57, add the ranks of waits above 7= W = 1,277.5
  5. Wilcoxon: p-valuefrom the rank sum= 0.0002
  6. Comparethe sign test only uses direction; Wilcoxon also uses how far= Wilcoxon is more powerful
What it meansThe sign test can't prove the median is above 7 with this sample (p = 0.14), because it ignores how far above or below each wait is. The Wilcoxon test uses those distances and shows clearly that it is (p = 0.0002).
What Amara decidesUse the Wilcoxon test when the data is roughly symmetrical around the median; use the sign test only when you can't trust the distances, for example with ratings. Here the conclusion matches the t-test.
Try it yourself in a spreadsheet
Count above=COUNTIF(B2:B61,">7")
Sign test p-value=1-BINOM.DIST(32,57,0.5,TRUE)
Wilcoxonrank =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.

Concept

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

Common practice

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

Concept

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.

Your responsibility todayTesting skewed data
Technique you usedSign test, Wilcoxon test
Key points to remember
  • 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.
Documents today Analysis record