fast.Discrete {DiscreteFDR}R Documentation

Fast Application of Discrete Multiple Testing Procedures

Description

[Deprecated]

Apply the [HSU], [HSD], [AHSU] or [AHSD] procedure, without computing the critical constants, to a data set of 2x2 contingency tables which may have to be pre-processed in order to have the correct structure for computing p-values using Fisher's exact test.

Note: This function is deprecated and will be removed in a future version. Please use direct.discrete.BH() with test.fun = DiscreteTests::fisher.test.pv and (optional) preprocess.fun = DiscreteDatasets::reconstruct_two or preprocess.fun = DiscreteDatasets::reconstruct_four instead. Alternatively, use a pipeline, e.g.
⁠data |>⁠
⁠ DiscreteDatasets::reconstruct_*(<args>) |>⁠
⁠ DiscreteTests::*.test.pv(<args>) |>⁠
⁠ discrete.BH(<args>)⁠.

Usage

fast.Discrete(
  counts,
  alternative = "greater",
  input = "noassoc",
  alpha = 0.05,
  direction = "su",
  adaptive = FALSE,
  select.threshold = 1
)

Arguments

counts

a data frame of two or four columns and any number of lines; each line representing a 2x2 contingency table to test. The number of columns and what they must contain depend on the value of the input argument (see Details section of fisher.pvalues.support()).

alternative

same argument as in stats::fisher.test(). The three possible values are "greater" (default), "two.sided" or "less" (may be abbreviated).

input

the format of the input data frame (see Details section of fisher.pvalues.support(). The three possible values are "noassoc" (default), "marginal" or "HG2011" (may be abbreviated).

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 ("su"; the default) or step-down procedure ("sd").

adaptive

single boolean specifying whether to conduct an adaptive procedure or not.

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.

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

See Also

fisher.pvalues.support(), discrete.BH()

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

DBH.su <- fast.Discrete(df, input = "noassoc", direction = "su")
summary(DBH.su)

DBH.sd <- fast.Discrete(df, input = "noassoc", direction = "sd")
DBH.sd$Adjusted
summary(DBH.sd)

ADBH.su <- fast.Discrete(df, input = "noassoc", direction = "su", adaptive = TRUE)
summary(ADBH.su)

ADBH.sd <- fast.Discrete(df, input = "noassoc", direction = "sd", adaptive = TRUE)
ADBH.sd$Adjusted
summary(ADBH.sd)


[Package DiscreteFDR version 2.0.0 Index]