Learn R Programming

DiscreteFDR (version 2.1.0)

fast.Discrete: 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 preprocessed 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
)

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

Data

list with input data.

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.

Select

list with data related to \(p\)-value selection; only exists if select.threshold < 1.

Select$Threshold

\(p\)-value selection threshold (select.threshold).

Select$Effective.Thresholds

results of each \(p\)-value CDF evaluated at the selection threshold.

Select$Pvalues

selected \(p\)-values that are \(\leq\) selection threshold.

Select$Indices

indices of \(p\)-values \(\leq\) selection threshold.

Select$Scaled

scaled selected \(p\)-values.

Select$Number

number of selected \(p\)-values \(\leq\) selection threshold.

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.

See Also

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

Examples

Run this code
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)

Run the code above in your browser using DataLab