Runs Test Calculator

Enter your numerical or binary sequence into the Runs Test Calculator to test whether it is random. Input your data sequence (space or comma-separated values) and choose a significance level. You get back the number of runs, expected runs, Z-statistic, and a clear randomness conclusion at your chosen alpha level.

Enter numeric values separated by spaces or commas. The sequence will be converted to above/below median (or use 0s and 1s directly).

Select the significance level for the hypothesis test.

Choose 'Binary' if your data is already 0/1. Choose 'Numeric' to split values above/below the median.

Results

Z-Statistic

--

Number of Runs (R)

--

Expected Runs (μ)

--

Standard Deviation (σ)

--

Count of Group 1 (n₁)

--

Count of Group 2 (n₂)

--

Total Observations (N)

--

Critical Z-Value (±)

--

Conclusion

--

Runs Test: Observed vs Expected Runs

Frequently Asked Questions

What is the Runs Test?

The Runs Test (also called the Wald–Wolfowitz runs test) is a non-parametric statistical test used to determine whether a sequence of values is random. A 'run' is a consecutive series of identical values or values on the same side of the median. Too few or too many runs compared to what is expected by chance suggests the sequence is not random.

What is a 'run' in statistics?

A run is an unbroken sequence of identical elements or elements sharing the same characteristic (e.g., all 1s or all 0s, or all values above the median). For example, in the sequence 1 1 0 0 1 0, there are 4 runs: [1 1], [0 0], [1], [0].

What null hypothesis does the Runs Test evaluate?

The null hypothesis (H₀) states that the sequence is random. The alternative hypothesis (H₁) is that the sequence is not random. If the absolute value of the Z-statistic exceeds the critical value at your chosen significance level, you reject H₀ and conclude the sequence is not random.

How do I interpret the Z-statistic?

The Z-statistic measures how many standard deviations the observed number of runs is from the expected number. If |Z| > critical value (e.g., 1.96 at α = 0.05), the sequence is statistically non-random. A large positive Z suggests too many runs (alternating pattern); a large negative Z suggests too few runs (clustering pattern).

What significance level should I use?

The most commonly used significance level is α = 0.05, which corresponds to a 95% confidence level and a critical Z-value of ±1.96. Use α = 0.01 (critical Z = ±2.576) for stricter tests, or α = 0.10 (critical Z = ±1.645) for a more lenient test. The choice depends on how much risk of a Type I error you are willing to accept.

When should I use 'Binary' vs 'Numeric (split at median)'?

Choose 'Binary' if your sequence already consists of only two values (e.g., 0s and 1s, H/T, success/failure). Choose 'Numeric (split at median)' if you have continuous or discrete numeric data — the calculator will automatically classify each value as above or below the median before performing the test.

What are the assumptions of the Runs Test?

The Runs Test assumes that the data can be classified into exactly two categories (dichotomous), observations are independent, and the sequence order matters. The normal approximation used for the Z-statistic is reliable when both n₁ and n₂ are greater than 10. For very small samples, consult exact runs test tables instead.

Can the Runs Test be used for stock market or time series data?

Yes. The Runs Test is commonly applied to stock price movements (up/down days) to test whether price changes are random, which is a component of the Efficient Market Hypothesis. It is also used in quality control, simulation validation, and any field where the randomness of a sequence is important.

More Statistics Tools