discrete.BH {DiscreteFDR} | R Documentation |
The Discrete Benjamini-Hochberg Procedure
Description
Applies the [HSU], [HSD], [AHSU] and [AHSD] procedures at a given FDR level, with or without computing the critical constants, to a set of p-values and their respective discrete supports.
Usage
discrete.BH(test.results, ...)
## Default S3 method:
discrete.BH(
test.results,
pCDFlist,
alpha = 0.05,
direction = "su",
adaptive = FALSE,
ret.crit.consts = FALSE,
select.threshold = 1,
pCDFlist.indices = NULL,
...
)
## S3 method for class 'DiscreteTestResults'
discrete.BH(
test.results,
alpha = 0.05,
direction = "su",
adaptive = FALSE,
ret.crit.consts = FALSE,
select.threshold = 1,
...
)
Arguments
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
further arguments to be passed to or from other methods. They are ignored here. |
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. |
alpha |
single real number strictly between 0 and 1 indicating the target FDR level. |
direction |
single character string specifying whether to perform a step-up ( |
adaptive |
single boolean specifying whether to conduct an adaptive procedure or not. |
ret.crit.consts |
single boolean specifying whether critical constants are to be computed. |
select.threshold |
single real number strictly between 0 and 1 indicating the largest raw p-value to be considered, i.e. only p-values below this threshold are considered and the procedures are adjusted in order to take this selection effect into account; if |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
Details
The adaptive variants [AHSU] and [AHSD], which are executed via
adaptive = TRUE
, are often slightly more powerful than [HSU] and [HSD],
respectively. But they are also computationally more demanding.
Computing critical constants (ret.crit.consts = TRUE
) requires considerably
more execution time, especially if the number of unique supports is large.
We recommend that users should only have them calculated when they need them,
e.g. for illustrating the rejection area in a plot or other theoretical
reasons.
Value
A DiscreteFDR
S3 class object whose elements are:
Rejected |
rejected raw p-values. |
Indices |
indices of rejected hypotheses. |
Num.rejected |
number of rejections. |
Adjusted |
adjusted p-values (only for step-down direction). |
Critical.constants |
critical values (only exists if computations where performed with |
Select$Threshold |
p-value selection |
Select$Effective.Thresholds |
results of each p-value CDF evaluated at the selection threshold (only exists if |
Select$Pvalues |
selected p-values that are |
Select$Indices |
indices of p-values |
Select$Scaled |
scaled selected p-values (only exists if |
Select$Number |
number of selected p-values |
Data$Method |
character string describing the used algorithm, e.g. 'Discrete Benjamini-Hochberg procedure (step-up)' |
Data$raw.pvalues |
observed p-values. |
Data$pCDFlist |
list of the p-value supports. |
Data$FDR.level |
FDR level |
Data$Data.name |
the respective variable names of the input data. |
References
Döhler, S., Durand, G., & Roquain, E. (2018). New FDR bounds for discrete and heterogeneous tests. Electronic Journal of Statistics, 12(1), pp. 1867-1900. doi:10.1214/18-EJS1441
See Also
Examples
X1 <- c(4, 2, 2, 14, 6, 9, 4, 0, 1)
X2 <- c(0, 0, 1, 3, 2, 1, 2, 2, 2)
N1 <- rep(148, 9)
N2 <- rep(132, 9)
Y1 <- N1 - X1
Y2 <- N2 - X2
df <- data.frame(X1, Y1, X2, Y2)
df
# Compute p-values and their supports of Fisher's exact test
test.result <- generate.pvalues(df, "fisher")
raw.pvalues <- test.result$get_pvalues()
pCDFlist <- test.result$get_pvalue_supports()
# DBH (SU) without critical values; using extracted p-values and supports
DBH.su.fast <- discrete.BH(raw.pvalues, pCDFlist)
summary(DBH.su.fast)
# DBH (SD) without critical values; using extracted p-values and supports
DBH.sd.fast <- discrete.BH(raw.pvalues, pCDFlist, direction = "sd")
summary(DBH.sd.fast)
# DBH (SU) with critical values; using test results
DBH.su.crit <- discrete.BH(test.result, ret.crit.consts = TRUE)
summary(DBH.su.crit)
# DBH (SD) with critical values; using test results
DBH.sd.crit <- discrete.BH(test.result, direction = "sd", ret.crit.consts = TRUE)
summary(DBH.sd.crit)
# ADBH (SU) without critical values; using extracted p-values and supports
ADBH.su.fast <- discrete.BH(raw.pvalues, pCDFlist, adaptive = TRUE)
summary(ADBH.su.fast)
# ADBH (SD) without critical values; using extracted p-values and supports
ADBH.sd.fast <- discrete.BH(raw.pvalues, pCDFlist, direction = "sd", adaptive = TRUE)
summary(ADBH.sd.fast)
# ADBH (SU) with critical values; using test results
ADBH.su.crit <- discrete.BH(test.result, adaptive = TRUE, ret.crit.consts = TRUE)
summary(ADBH.su.crit)
# ADBH (SD) with critical values; using test results
ADBH.sd.crit <- discrete.BH(test.result, direction = "sd", adaptive = TRUE, ret.crit.consts = TRUE)
summary(ADBH.sd.crit)