DBR: The Discrete Blanchard-Roquain Procedure

View source: R/DBR_fun.R

DBRR Documentation

The Discrete Blanchard-Roquain Procedure

Description

Applies the [HBR-\lambda] procedure, with or without computing the critical constants, to a set of p-values and their respective discrete supports.

Usage

DBR(test.results, ...)

## Default S3 method:
DBR(
  test.results,
  pCDFlist,
  alpha = 0.05,
  lambda = NULL,
  ret.crit.consts = FALSE,
  select.threshold = 1,
  pCDFlist.indices = NULL,
  ...
)

## S3 method for class 'DiscreteTestResults'
DBR(
  test.results,
  alpha = 0.05,
  lambda = NULL,
  ret.crit.consts = FALSE,
  select.threshold = 1,
  ...
)

Arguments

test.results

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

...

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.

lambda

real number strictly between 0 and 1 specifying the DBR tuning parameter; if lambda = NULL (the default), lambda is chosen to be equal to alpha.

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 threshold = 1 (the default), all raw p-values are selected.

pCDFlist.indices

list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in pCDFlist belongs; ignored if the lengths of test.results and pCDFlist are equal.

Details

[DBR-\lambda] is the discrete version of the [Blanchard-Roquain-\lambda] procedure (see References). The authors of the latter suggest to take lambda = alpha (see their Proposition 17), which explains the choice of the default value here.

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.

Critical.constants

critical values (only exists if computations where performed with ret.crit.consts = TRUE).

Select$Threshold

p-value selection threshold (only exists if threshold < 1).

Select$Effective.Thresholds

results of each p-value CDF evaluated at the selection threshold (only exists if threshold < 1).

Select$Pvalues

selected p-values that are \leq selection threshold (only exists if threshold < 1).

Select$Indices

indices of p-values \leq selection threshold (only exists if threshold < 1).

Select$Scaled

scaled selected p-values (only exists if threshold < 1).

Select$Number

number of selected p-values \leq threshold (only exists if threshold < 1).

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 alpha.

Data$Data.name

the respective variable names of the input data.

DBR.Tuning

value of the tuning parameter lambda.

References

G. Blanchard and E. Roquain (2009). Adaptive false discovery rate control under independence and dependence. Journal of Machine Learning Research, 10, pp. 2837-2871.

See Also

discrete.BH(), DBH(), ADBH()

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()

# DBR without critical values; using extracted p-values and supports
DBR.fast <- DBR(raw.pvalues, pCDFlist)
summary(DBR.fast)

# DBR with critical values; using test results
DBR.crit <- DBR(test.result, ret.crit.consts = TRUE)
summary(DBR.crit)


DiscreteFDR documentation built on Sept. 11, 2024, 9:17 p.m.