Description Usage Arguments Details Value References Examples
Compute the p-value of a test statistic for Monte Carlo tests.
1 |
S |
The value of the test statistic |
sample_S |
Simulated values of the |
alternative |
A string specifying the alternative hypothesis, or
|
unif_gen |
If not |
Let S be a test statistic and S_i be simulated values of that
test statistic under the null hypothesis, with 1 ≤q i ≤q N. If
unif_gen
is not NULL
, this function computes p-values via
p = \hat{p} = \frac{1}{N}∑_{i = 1}^{N} I_{\{(S, U_0) ≤q (S_i, U_i)\}}
where I_{\{S \in A\}} = 1 if S \in A and is 0 otherwise, U_i are uniformly distributed random variables, and the ordering over tuples is lexicographical ordering, as described by \insertCitedufour06;textualMCHT.
If unif_gen
is NULL
, then the random variables are not
generated and not used to break ties.
This function is designed to handle an alternative
parameter similar
to what appears in other stats functions like
t.test
. If alternative
is "less"
, then
p = \hat{p}; if alternative
is "greater"
, then
p = 1 - \hat{p}; and if alternative
is "two.sided"
, then
p = 2 \min(\hat{p}, 1 - \hat{p}). Any other value raises an error.
The parameter S
is S, and the vector sample_S
is the
vector containing the values S_i.
A number representing the p-value.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.