get_pivotal_stat: Get a vector of pivotal statistics associated to permutation...

View source: R/calibration.R

get_pivotal_statR Documentation

Get a vector of pivotal statistics associated to permutation p-values and to a reference family

Description

Get a vector of pivotal statistics associated to permutation p-values and to a reference family

Usage

get_pivotal_stat(p0, m, t_inv = t_inv_linear, K = nrow(p0))

Arguments

p0

A matrix with B rows. Each row is a vector of null p-values

m

The total number of tested hypotheses

t_inv

An inverse threshold function (same I/O as 't_inv_linear')

K

An integer value in ⁠[1,m]⁠, the number of elements in the reference family. Defaults to m

Value

A vector of length B pivotal statitics, whose j-th entry corresponds to psi(g_j.X) with notation of the AoS 2020 paper cited below (section 4.5)

References

Blanchard, G., Neuvial, P., & Roquain, E. (2020). Post hoc confidence bounds on false positives using reference families. Annals of Statistics, 48(3), 1281-1303.

Examples


m <- 50
n <- 45
X <- matrix(rnorm(m*n), ncol = n, nrow = m)
categ <- rbinom(n, 1, 0.4)
B <- 10
null_groups <- replicate(B, sample(categ))
p0 <- rowWelchTests(X, null_groups)$p.value
pivStat <- get_pivotal_stat(p0, m)
quantile(pivStat, 0.2)



pneuvial/sanssouci documentation built on Feb. 12, 2024, 4:18 a.m.