Data and statistics · cheat sheet

One-sample sign test

A simple test of whether the median differs from a target, using only whether each value is above or below it.

Common practice
3 steps
Used by Process Improvement Specialist

What it is

The sign test checks whether the median differs from a target by counting values above and below it. If the median were the target, each value would be equally likely to fall either side.

When to use it

With very skewed data, ordinal data such as ratings, or when only the direction of each value can be trusted.

Why it works

It makes almost no assumptions, so it works on very skewed or ordinal data.

Do

  • Use it when only direction can be trusted.

Don't

  • Using it when distances are meaningful: it throws that information away and has low power.

Step by step

  1. Count above and below Drop ties.
  2. Binomial p-value
  3. Decide
Also called: Sign test for the medianPrint the blank template ↗

Worked example

The situation. 15 delivery times against a promise of 3 days.

  1. 12 above, 2 below, 1 equal.

The result. Deliveries usually take longer than promised; the promise was changed to 4 days.

Sign test tally Print blank
PartValue
Values used14
Above12
p-value (one-sided)0.006

Filled in for: 15 delivery times against a promise of 3 days.

ItemValueAbove, below or equal

Copy this structure, or print the blank version and fill it in by hand. Above ______ Below ______ p = 1 − BINOM.DIST(above − 1, above + below, 0.5, TRUE)

Before you use it: check these

CheckIf it fails
Independent valuesUse methods for related data
Only the direction is trustedIf distances are meaningful, the Wilcoxon test is more powerful

How to do it with real data

The full calculation, as it happens in the story: the data, every step, how to read the result, and the spreadsheet functions to do it yourself.

Worked example with real data

Is the median wait above 7? Two tests compared

From Day 29: When the data isn't normal of the Process Improvement Specialist story

The waits are skewed, so Amara also tests the median, with two tests that don't need normal data.

Step by step

  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
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

How to read the result

The 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 it led to

Use 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.

Do it 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
Try it yourself: In another sample, 40 of 50 values are above the target and 10 below. Would the sign test show a difference?

Yes. 40 of 50 is far from 25 of 50: p = 1 − BINOM.DIST(39,50,0.5,TRUE), about 0.00001.

In the roles

How a Process Improvement Specialist uses it

Waits against 7 days: 33 above, 24 below, p = 0.14. Not enough on direction alone.

Questions people ask

Why is it weak?

It ignores how far each value is from the target.

Related techniques

← All techniques and tools