These internal functions are not meant to be called directly. This help is to explain the
functions. The function calcPvals
calculates p-values from a set of either
completely enumerated test statistics (in which case all wgts are equal to one) or
a set of test statistics from a network algorithm (in which case the wgts come from the network algorithm).
The function calcPvalsMC
calculates p-values and the associated confidence intervals
from a Monte Carlo simulation. The p-values are estimated by (S+1)/(N+1) where S is the number of
more extreme test statistics, and N is the number of Monte Carlo simulations. This estimator is
guaranteed to be valid, and the confidence
interval is the appropriate one associated with this estimator (see e.g., Fay, Kim, and Hachey, 2007).
calcPvalsMC(Tj, T0, digits, alternative = NULL, twosidedTstat = FALSE, p.conf.level=0.99)
calcPvals(Tj, T0, digits, denom = NULL, wgts = NULL, twosidedTstat = FALSE)
pCI(S, N, p.conf.level = 0.99)
numeric vector of values of test statistic
observed value of test statistic
number of significant digits for rounding (see details)
character vector: one of "less", "greater", "two.sided"
logical, TRUE denotes test statistic is twosided
total number of test statistics
vector of weights the same length as Tj, NULL gives all ones
number of Monte Carlo replications equal or more extreme than T0
number of Monte Carlo replications
confidence level for confidence intervals about Monte Carlo p-values
Fay, MP, Kim, H-J, Hachey, M (2007). Journal of Computational and Graphical Statistics. 16:946-957. Available at https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2467508/
Called from permTS
, permKS
, permTREND