permutation.test | R Documentation |
Given a binary sequence of 0's and 1's, computes the p-value of a permutation test of randomness using a simulation-based permutation test. The sum of squared spacings is used as the measure of streakiness (the clumpiness statistic).
permutation.test(x, ITER = 1000)
x |
vector of 0's and 1's |
ITER |
number of iterations of simulation |
the p-value, the probability that the clumpiness statistic under the randomness model is at least as large as the observed value
Jim Albert
Albert, J. (2013), Looking at Spacings to Access Streakiness, Journal of Quantitative Analysis of Sports, Vol 9, Issue 2, 151-163.
y <- rgeom(500, prob=0.3)
permutation.test(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.