Runs Test for Randomness
The runs test for randomness is a nonparametric test of whether a sequence of observations is random, based on the number of runs above and below a cutoff such as the median.
런 검정은 관측값을 기준값(보통 중앙값) 위아래로 나눈 뒤 같은 쪽이 이어지는 묶음의 수를 세어 자료의 순서가 무작위인지 검정하는 비모수 방법이다.
How do I check whether the order of my measurements shows clustering or alternation rather than randomness?
측정 순서에 따라 값이 몰리거나 번갈아 나타나는 패턴이 있는지 어떻게 확인하나요?
The runs test dichotomizes the sequence at a cutoff, counts maximal runs of consecutive values on the same side, and compares the count with its distribution under random ordering. Too few runs suggest clustering or trend, and too many suggest systematic alternation.
When to use Runs Test for Randomness
- Observations were recorded in a meaningful order, such as time or production sequence.
- You want a simple check of independence or randomness before further analysis.
- Residuals from a model are to be screened for serial patterns.
When to use something else
- You need to model the strength of autocorrelation; use the Ljung-Box test or an autocorrelation function instead.
- The aim is to detect a monotone trend; use the Mann-Kendall test instead.
Assumptions and requirements
- The row order reflects the order of observation.
- Values equal to the cutoff can be set aside without biasing the sequence.
What the analysis reports
- Observed and expected number of runs
- Counts above and below the cutoff
- Exact p-value
- Normal-approximation z and p-value
How to report it
A Wald-Wolfowitz runs test about the median found [value] runs against [value] expected, z = [value], p = [value], indicating [no] departure from randomness.
Related methods
- Autocorrelation Analysis (ACF, PACF, Ljung-Box)
- Mann-Kendall Trend Test with Sen's Slope
- Change Point Detection (Binary Segmentation)
Run Runs Test for Randomness on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable
- Price
- 150 credits for one analysis up to 10,000 rows (complexity level 1); larger or wider data costs more. Optional methodologist review: 900 credits.
- Checking
- Checked by property tests in every deployment
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.