View source: R/randomization.test.R
randomization.test | R Documentation |
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)\}~.
randomization.test(Tn, Tng, alpha = 0.05)
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. |
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.
Maurcio Olivares
Ignacio Sarmiento Barbieri
Lehmann, Erich L. and Romano, Joseph P (2005) Testing statistical hypotheses.Springer Science & Business Media.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.