Check order patterns using flexible numeric or binary inputs. See runs, thresholds, graphs, and summaries. Make better randomness judgments using transparent formulas and outputs.
This example uses a numeric sequence and the median as the classification threshold.
| Position | Value | Median comparison | Code |
|---|---|---|---|
| 1 | 12 | Above | A |
| 2 | 9 | Below | B |
| 3 | 15 | Above | A |
| 4 | 13 | Above | A |
| 5 | 8 | Below | B |
| 6 | 16 | Above | A |
The runs test checks whether the order of two categories appears random. A run is a consecutive block of the same category.
Expected runs: μ = 1 + (2 n₁ n₂) / (n₁ + n₂)
Variance: σ² = [2 n₁ n₂ (2 n₁ n₂ - n₁ - n₂)] / [(n₁ + n₂)² (n₁ + n₂ - 1)]
Standardized statistic without continuity correction: z = (R - μ) / σ
With continuity correction: z = (R - μ ± 0.5) / σ
Where:
It checks whether the order of two categories looks random. It does not measure average size, only how values alternate or cluster through the sequence.
Use numeric mode when you have measured values and want to convert them into above-threshold and below-threshold groups using the mean, median, or a custom cut point.
Ties occur when a value equals the threshold. Different tie rules change category assignments, which can slightly change run counts, z scores, and p values.
Too few runs usually suggests clustering, persistence, or trend behavior. Similar categories stay together longer than randomness would predict.
Too many runs usually suggests rapid alternation between categories. The sequence switches more often than expected under random ordering.
For small samples, exact p values are preferable because they use the discrete distribution directly. Larger samples commonly rely on the normal approximation.
No. The formulas already account for unequal counts in the two categories. Very unbalanced groups can still reduce sensitivity.
No. It only checks one aspect of randomness: ordering. A sequence may pass the runs test yet still fail other randomness checks.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.