Skip to contents

Adjusted p-values for several hypotheses tested together, from the joint null distribution of their statistics (permutations or bootstrap draws), holding the family-wise error rate while using the correlation between the tests.

Usage

stpdnpv(obs, null)

Arguments

obs

The observed statistics, one per hypothesis.

null

A matrix of statistics under the null: one row per draw, one column per hypothesis.

Value

The adjusted p-values, in the order of observed.

Details

The statistics are ordered by size, \(|t_{(1)}| \ge \dots \ge |t_{(K)}|\). For each null draw \(b\), \(q_{b,j} = \max_{r \ge j} |t^*_{b,(r)}|\). The adjusted p-value of the \(j\)th is the share of draws with \(q_{b,j} \ge |t_{(j)}|\), made monotone: \(\tilde p_{(j)} = \max(\tilde p_{(j-1)}, p_{(j)})\) (Westfall and Young 1993, algorithm 2.8).

References

Westfall PH, Young SS (1993). Resampling-Based Multiple Testing. Wiley, New York.

See also

Examples

set.seed(1)
null <- matrix(rnorm(3000), ncol = 3)
stpdnpv(c(2.5, 0.4, -2.1), null)
#> [1] 0.044 0.694 0.081