What is the run test?
We can use the run test to test whether a given data is from a random process. For example, let’s say we tossed a coin 15 times, and we got a sequence of heads and tails. Now, we want to know whether the sequence of heads and tails is random or the coin is biased. To determine that, we can perform a run test.
What is a run in a run test?
A run is defined as a series of consecutive values of the same type. For example, let’s say in the above example, we get the following sequence of heads and tails.
H H T H H H H T T T H H T H T
So, ‘HH’ is one run.
‘T’ is one run.
Then, ‘HHHH’ is one run, and so on.
So, all total, we got 8 runs.
How to calculate the test statistic in a run test?
Let’s first define certain variables. Let n be the total number of observations in the sample. n1 is the number of observations of the first type.
n2 is the number of observations of the second type.
And r is the total number of runs.
The test statistic is calculated in the following way:
If n1 and n2 are both less than or equal to 20, then our test statistic = r
If at least one of n1 and n2 is more than 20, then our test statistic is calculated in the following way: …






0 Comments