permutation.test: Permutation Test of a Binary Sequence

permutation.testR Documentation

Permutation Test of a Binary Sequence

Description

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).

Usage

permutation.test(x, ITER = 1000)

Arguments

x

vector of 0's and 1's

ITER

number of iterations of simulation

Value

the p-value, the probability that the clumpiness statistic under the randomness model is at least as large as the observed value

Author(s)

Jim Albert

References

Albert, J. (2013), Looking at Spacings to Access Streakiness, Journal of Quantitative Analysis of Sports, Vol 9, Issue 2, 151-163.

Examples

y <- rgeom(500, prob=0.3)
permutation.test(y)

bayesball/BayesTestStreak documentation built on Dec. 15, 2022, 11:36 a.m.