ww_test: Wald-Wolfowitz Runs Tests for Randomness

Description Usage Arguments Value See Also Examples

View source: R/my_functions.r

Description

This is the k-category asymptotic Z Test with continuity correction. Imagine rolling a die multiple times to obtain a sequence of rolls. This statistic tests whether there exists a "run" within the sequence where one particular number comes up more times in a row than expected randomly. If the test is significant, it can be concluded that the die rolls are not independent.

Usage

1

Arguments

x

A vector of items, coerced into a factor.

Value

A p-value for the statistical test.

See Also

Reference https://ncss-wpengine.netdna-ssl.com/wp-content/themes/ncss/pdf/Procedures/NCSS/Analysis_of_Runs.pdf

Examples

1
2
3
set.seed(1)
ww_test(sample(2, 100, replace=T))
ww_test(c(sample(6, 90, replace=T),rep(1,10)))

traversc/trqwe documentation built on Dec. 4, 2020, 4:21 a.m.