DiscreteFDR (version 1.0)

DBH: [HSU] and [HSD] procedures

Description

Apply the [HSU] or [HSD] procedure, with or without computing the critical constants, to a set of p-values and their discrete support.

Usage

DBH(pCDFlist, raw.pvalues, alpha = 0.05, direction = "su",
  ret.crit.consts = FALSE, bigMem = FALSE, verbose = FALSE)

Arguments

pCDFlist

a list of the supports of the CDFs of the p-values. Each support is represented by a vector that must be in increasing order.

raw.pvalues

vector of the raw observed p-values, as provided by the end user and before matching with their nearest neighbour in the CDFs supports.

alpha

the target FDR level, a number strictly between 0 and 1.

direction

a character string specifying whether to conduct a step-up (direction="su", by default) or step-down procedure (direction="sd").

ret.crit.consts

a boolean. If TRUE, critical constants are computed and returned (this is computationally intensive).

bigMem

a boolean. If TRUE, the code uses matrixes and functions of the apply family as far as possible (faster for small number of hypotheses and support size, but slower otherwise due to memory management overhead). If FALSE, computations are done with for loops and chunks to conserve memory.

verbose

a boolean indicating if msg must be printed. Used when bigMem=TRUE, to print messages informing if in-memory computation was successful or if loops and chunks were used as fallback.

Value

A list whose elements are:

Rejected

rejected raw p-values

Indices

indices of rejected hypotheses

Max.k

number of rejections

Alpha

maximum significance level for which a rejection occured, that is \(Alpha = alpha * Max.k / m\)

Critical.constants

critical constants (if requested)

Adjusted

adjusted p-values (only for step-down direction).

Details

This version: 2018-02-20.

Examples

Run this code
# NOT RUN {
data(amnesia)

#We only keep the first 100 lines to keep the computations fast.
amnesia<-amnesia[1:100,]

#Construction of the p-values and their support
amnesia.formatted <- fisher.pvalues.support(amnesia)
raw.pvalues <- amnesia.formatted$raw
pCDFlist <- amnesia.formatted$support

DBH.su.fast <- DBH(pCDFlist, raw.pvalues)
DBH.sd.fast <- DBH(pCDFlist, raw.pvalues, direction="sd")
DBH.su.crit <- DBH(pCDFlist, raw.pvalues, ret.crit.consts=TRUE)
DBH.sd.crit <- DBH(pCDFlist, raw.pvalues, direction="sd", ret.crit.consts=TRUE)

# }

Run the code above in your browser using DataCamp Workspace