randomization.test: General Construction of Randomization Tests

View source: R/randomization.test.R

randomization.testR Documentation

General Construction of Randomization Tests

Description

Calculates the randomization test. Further discussion can be found in chapter 15 of Lehmann and Romano (2005, p 633). Consider data X taking values in a sample space Ω. Let \mathbf{G} be a finite group of transformations from Ω onto itself, with M=\vert \mathbf{G}\vert. Let T(X) be a real-valued test statistic such that large values provide evidence against the null hypothesis. Denote by

T^{(1)}(X)≤ T^{(2)}(X)≤…≤ T^{(M)}(X)

the ordered values of \{T(gX)\,:\,g\in\mathbf{G}\}. Let k=M-\lfloor Mα\rfloor and define M^{+}(x) and M^{0}(x) be the number of values T^{(j)}(X), j=1,…,M, which are greater than T^{(k)}(X) and equal to T^{(k)}(X) respectively. Set

a(X)=\frac{α M-M^{+}(X)}{M^{0}(X)}~.

The randomization test is given by

φ(X)=1\{T(x)> T^{(k)}(X)\}+a(X)\times 1\{T(X)= T^{(k)}(X)\}~.

Usage

randomization.test(Tn, Tng, alpha = 0.05)

Arguments

Tn

Numeric. A scalar representing the observed test statistic T(X).

Tng

Numeric. A vector containing \{T(gX)\,:\,g\in\mathbf{G}\}.

alpha

Numeric. Nominal level for the test. The default is 0.05.

Value

Numeric. A vector containing φ(X)\in\{0,1\} and T^{(k)}(X). The test rejects the null hypothesis if φ(X)=1, and does not reject otherwise.

Author(s)

Maurcio Olivares

Ignacio Sarmiento Barbieri

References

Lehmann, Erich L. and Romano, Joseph P (2005) Testing statistical hypotheses.Springer Science & Business Media.


RATest documentation built on Sept. 29, 2022, 9:08 a.m.