calc_perm_p_value {robnptests}R Documentation

Calculation of permutation p-value

Description

calc_perm_p_value calculates the permutation p-value following Phipson and Smyth (2010).

Usage

calc_perm_p_value(
  statistic,
  distribution,
  m,
  n,
  randomization,
  n.rep,
  alternative
)

Arguments

statistic

observed value of the test statistic.

distribution

a numeric vector with the permutation/randomization distribution.

m

an integer value giving size of first sample.

n

an integer value giving size of second sample.

randomization

a logical value indicating whether the p-value should be computed from a permutation (FALSE, default) or a randomization (TRUE) distribution.

n.rep

an integer value specifying the number of random splits used to calculate the randomization distribution if method = "randomization". This argument is ignored if method = "permutation" or method = "asymptotic". The default is n.rep = 10000.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater", or "less".

Value

p-value for the specified alternative.

References

Phipson B, Smyth GK (2010). “Permutation p-values should never be zero: Calculating exact p-values when permutations are randomly drawn.” Statistical Applications in Genetics and Molecular Biology, 9(1), Article 39. doi:10.2202/1544-6115.1585.


[Package robnptests version 1.1.0 Index]