Runs test
Checks whether a sequence is random by counting runs — unbroken stretches of values above or below a cut point.
Menu: Analyze → Nonparametric Tests → Legacy Dialogs → Runs…
When should I use it?
- Are residuals in time order random?
- Is the order of heads and tails in a sequence random?
What are the assumptions?
- The data are in a meaningful order (time or collection order).
How do I run it in StatLab?
- Choose the variable(s).
- Pick the cut point: median (default), mean, mode or a custom value.
How do I read the output?
| Output | Meaning |
|---|---|
| Number of Runs | Too few runs suggests clustering/trend; too many suggests alternation. |
| Z, Asymp. Sig. | Normal approximation (continuity-corrected when N < 50). |
| Exact Sig. | Exact run-count distribution (tick 'Exact'). |
Worked example
On the practice survey dataset (File → Sample dataset), this command — which the dialog's Paste button also produces — runs the procedure:
PROC npRuns /vars=(score age) /cut=median /exact=NO.
Output tables: Runs Test.
How would I report it in APA style?
Wellbeing score: 71 runs around 69.19, Z = −0.82, p = .413; Age (years): 67 runs around 40.00, Z = −1.47, p = .141.
Computed by StatLab's validated procedure code when this page was built. The example only illustrates the steps; choose variables that fit your own research question.
What are common mistakes?
- Sorting the file before running the test — the order is the whole point.