Nonparametric Tests
Runs Test Table: Critical Values for the Number of Runs
Critical numbers of runs for testing whether a sequence of two kinds of item is random.
- n₁, n₂ = 2 to 20
- Exact values
- Paste a sequence
Runs Test Table
Two tables: lower and upper critical values for two-sided α = 0.05. Rows: n₁ · Columns: n₂.
Lower critical values: reject H₀ if R ≤ the value
| Size of the second group (n₂) → n₁ \ n₂ ↓ | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | — | — | — | — | — | — | — | — | — | — | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| 3 | — | — | — | — | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 3 |
| 4 | — | — | — | 2 | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 4 | 4 | 4 | 4 | 4 |
| 5 | — | — | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 5 | 5 | 5 |
| 6 | — | 2 | 2 | 3 | 3 | 3 | 3 | 4 | 4 | 4 | 4 | 5 | 5 | 5 | 5 | 5 | 5 | 6 | 6 |
| 7 | — | 2 | 2 | 3 | 3 | 3 | 4 | 4 | 5 | 5 | 5 | 5 | 5 | 6 | 6 | 6 | 6 | 6 | 6 |
| 8 | — | 2 | 3 | 3 | 3 | 4 | 4 | 5 | 5 | 5 | 6 | 6 | 6 | 6 | 6 | 7 | 7 | 7 | 7 |
| 9 | — | 2 | 3 | 3 | 4 | 4 | 5 | 5 | 5 | 6 | 6 | 6 | 7 | 7 | 7 | 7 | 8 | 8 | 8 |
| 10 | — | 2 | 3 | 3 | 4 | 5 | 5 | 5 | 6 | 6 | 7 | 7 | 7 | 7 | 8 | 8 | 8 | 8 | 9 |
| 11 | — | 2 | 3 | 4 | 4 | 5 | 5 | 6 | 6 | 7 | 7 | 7 | 8 | 8 | 8 | 9 | 9 | 9 | 9 |
| 12 | 2 | 2 | 3 | 4 | 4 | 5 | 6 | 6 | 7 | 7 | 7 | 8 | 8 | 8 | 9 | 9 | 9 | 10 | 10 |
| 13 | 2 | 2 | 3 | 4 | 5 | 5 | 6 | 6 | 7 | 7 | 8 | 8 | 9 | 9 | 9 | 10 | 10 | 10 | 10 |
| 14 | 2 | 3 | 3 | 4 | 5 | 5 | 6 | 7 | 7 | 8 | 8 | 9 | 9 | 9 | 10 | 10 | 10 | 11 | 11 |
| 15 | 2 | 3 | 3 | 4 | 5 | 6 | 6 | 7 | 7 | 8 | 8 | 9 | 9 | 10 | 10 | 11 | 11 | 11 | 12 |
| 16 | 2 | 3 | 4 | 4 | 5 | 6 | 6 | 7 | 8 | 8 | 9 | 9 | 10 | 10 | 11 | 11 | 11 | 12 | 12 |
| 17 | 2 | 3 | 4 | 4 | 5 | 6 | 7 | 7 | 8 | 9 | 9 | 10 | 10 | 11 | 11 | 11 | 12 | 12 | 13 |
| 18 | 2 | 3 | 4 | 5 | 5 | 6 | 7 | 8 | 8 | 9 | 9 | 10 | 10 | 11 | 11 | 12 | 12 | 13 | 13 |
| 19 | 2 | 3 | 4 | 5 | 6 | 6 | 7 | 8 | 8 | 9 | 10 | 10 | 11 | 11 | 12 | 12 | 13 | 13 | 13 |
| 20 | 2 | 3 | 4 | 5 | 6 | 6 | 7 | 8 | 9 | 9 | 10 | 10 | 11 | 12 | 12 | 13 | 13 | 13 | 14 |
Upper critical values: reject H₀ if R ≥ the value
| Size of the second group (n₂) → n₁ \ n₂ ↓ | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
| 3 | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
| 4 | — | — | — | 9 | 9 | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
| 5 | — | — | 9 | 10 | 10 | 11 | 11 | — | — | — | — | — | — | — | — | — | — | — | — |
| 6 | — | — | 9 | 10 | 11 | 12 | 12 | 13 | 13 | 13 | 13 | — | — | — | — | — | — | — | — |
| 7 | — | — | — | 11 | 12 | 13 | 13 | 14 | 14 | 14 | 14 | 15 | 15 | 15 | — | — | — | — | — |
| 8 | — | — | — | 11 | 12 | 13 | 14 | 14 | 15 | 15 | 16 | 16 | 16 | 16 | 17 | 17 | 17 | 17 | 17 |
| 9 | — | — | — | — | 13 | 14 | 14 | 15 | 16 | 16 | 16 | 17 | 17 | 18 | 18 | 18 | 18 | 18 | 18 |
| 10 | — | — | — | — | 13 | 14 | 15 | 16 | 16 | 17 | 17 | 18 | 18 | 18 | 19 | 19 | 19 | 20 | 20 |
| 11 | — | — | — | — | 13 | 14 | 15 | 16 | 17 | 17 | 18 | 19 | 19 | 19 | 20 | 20 | 20 | 21 | 21 |
| 12 | — | — | — | — | 13 | 14 | 16 | 16 | 17 | 18 | 19 | 19 | 20 | 20 | 21 | 21 | 21 | 22 | 22 |
| 13 | — | — | — | — | — | 15 | 16 | 17 | 18 | 19 | 19 | 20 | 20 | 21 | 21 | 22 | 22 | 23 | 23 |
| 14 | — | — | — | — | — | 15 | 16 | 17 | 18 | 19 | 20 | 20 | 21 | 22 | 22 | 23 | 23 | 23 | 24 |
| 15 | — | — | — | — | — | 15 | 16 | 18 | 18 | 19 | 20 | 21 | 22 | 22 | 23 | 23 | 24 | 24 | 25 |
| 16 | — | — | — | — | — | — | 17 | 18 | 19 | 20 | 21 | 21 | 22 | 23 | 23 | 24 | 25 | 25 | 25 |
| 17 | — | — | — | — | — | — | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 23 | 24 | 25 | 25 | 26 | 26 |
| 18 | — | — | — | — | — | — | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 25 | 26 | 26 | 27 |
| 19 | — | — | — | — | — | — | 17 | 18 | 20 | 21 | 22 | 23 | 23 | 24 | 25 | 26 | 26 | 27 | 27 |
| 20 | — | — | — | — | — | — | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 25 | 26 | 27 | 27 | 28 |
Tip: click any value to highlight its row and column.
How to read this table
- Count n₁ and n₂, the numbers of items of each kind, and R, the number of runs (unbroken stretches of the same kind).
- Look up the lower critical value and the upper critical value for n₁ and n₂.
- Reject randomness if R is less than or equal to the lower value (clustering) or greater than or equal to the upper value (too much alternation).
Worked example
Responses in 20 consecutive patients (10 responders, 10 non-responders) form only R = 5 runs. The lower table at n₁ = n₂ = 10 gives 6 and the upper table gives 16. Because 5 ≤ 6, the responses are clustered in time, which could point to a change in patient selection or procedures during enrolment.
Click the underlined links to highlight the value in the table.
Calculator
For values between the rows and columns of the table. Results update as you type.
Formula and how the values were computed
Values come from the exact distribution of the number of runs, P(R = r), from its closed-form combinatorial expression. The lower value is the largest r with P(R ≤ r) ≤ 0.025 and the upper value the smallest r with P(R ≥ r) ≤ 0.025.
Frequently asked questions
How do I use the runs test on numbers?
Classify each value as above or below the median (dropping values equal to it), then count runs of "above" and "below". The calculator does this when you paste numbers.
Where is it used?
Checking the randomness of a sequence, such as a randomization list, residuals from a regression model in time order, or events in a series.