Skip to contents

The rank-based von Neumann ratio: the sum of squared successive rank differences over the rank variance. Reproduces randtests::bartels.rank.test.

Usage

morie_bartels_rank_test(x, alternative = "two.sided")

Arguments

x

Numeric vector.

alternative

"two.sided" (default), "left.sided", or "right.sided".

Value

A list with statistic (standardized), rvn (the ratio), p.value, method.

References

Bartels, R. (1982). The rank version of von Neumann's ratio test for randomness. JASA, 77(377), 40-46.

Examples

set.seed(4)
res <- morie_bartels_rank_test(rnorm(80))
res$p.value
#> [1] 0.6661415