Runs-test

Install required packages

DescTools

Runs-test

Using RunsTest() from package DescTools


    Runs Test for Randomness

data:  queue
runs = 5, m = 5, n = 3, p-value = 0.5714
alternative hypothesis: true number of runs is greater than expected

Manual permutation test

Exact test

Run Length Encoding
  lengths: int [1:5] 1 2 1 1 3
  values : chr [1:5] "f" "m" "f" "m" "f"
[1] 5
f 
3 
m 
2 
f 
7 
[1] 0.5714286
[1] 0.4285714
[1] 1

Normal approximation

        f 
0.4184066 

Detach (automatically) loaded packages (if possible)

Get the article source from GitHub

R markdown - markdown - R code - all posts