match_pvals {DiscreteFWER}R Documentation

Matching Raw P-Values with Supports

Description

Constructs the observed p-values from the raw observed p-values, by rounding them to their nearest neighbour, matching with the supports of their respective CDFs (as in function p.discrete.adjust() of package discreteMTP, which is no longer available on CRAN).

Note: This is an internal function and has to be called directly via :::, i.e. DiscreteFWER:::match_pvals().

Usage

match_pvals(test_results, pCDFlist, pCDFlist_indices = NULL)

Arguments

test_results

either a numeric vector with p-values or an R6 object of class DiscreteTestResults from package DiscreteTests for which a discrete FWER procedure is to be performed.

pCDFlist

list of the supports of the CDFs of the p-values; each list item must be a numeric vector, which is sorted in increasing order and whose last element equals 1.

pCDFlist_indices

list of numeric vectors containing the test indices that indicate to which raw p-value(s) each support in pCDFlist belongs; if NULL (the default) the lengths of test_results and pCDFlist must be equal.

Details

Well computed raw p-values should already belong to their respective CDF support. So this function is called at the beginning of discrete_FWER.default() and its wrappers, just in case raw p-values may be biased.

For each raw p-value that needs to be rounded, a warning is issued.

Value

A vector where each raw p-value has been replaced by its nearest neighbour, if necessary.

See Also

discrete_FWER()


[Package DiscreteFWER version 1.0.0 Index]