direct.discrete.BH {DiscreteFDR}R Documentation

Direct Application of Multiple Testing Procedures to Dataset

Description

Apply the [HSU], [HSD], [AHSU] or [AHSD] procedure, with or without computing the critical constants, to a data set of 2x2 contingency tables using Fisher's exact tests which may have to be transformed before computing p-values.

Usage

direct.discrete.BH(
  dat,
  test.fun,
  test.args = NULL,
  alpha = 0.05,
  direction = "su",
  adaptive = FALSE,
  ret.crit.consts = FALSE,
  select.threshold = 1,
  preprocess.fun = NULL,
  preprocess.args = NULL
)

Arguments

dat

input data; must be suitable for the first parameter of the provided preprocess.fun function or, if preprocess.fun is NULL, for the first parameter of the test.fun function.

test.fun

function from package DiscreteTests, i.e. one whose name ends with ⁠*.test.pv⁠ and which performs hypothesis tests and provides an object with p-values and their support sets; can be specified by a single character string (which is automatically checked for being a suitable function from that package and may be abbreviated) or a single function object.

test.args

optional named list with arguments for test.fun; the names of the list fields must match the test function's parameter names. The first parameter of the test function MUST NOT be included!

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.

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.

preprocess.fun

optional function for pre-processing the input data; its result must be suitable for the first parameter of the test.fun function.

preprocess.args

optional named list with arguments for preprocess.fun; the names of the list fields must match the pre-processing function's parameter names. The first parameter of the test function MUST NOT be included!

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 <- direct.discrete.BH(df, "fisher", direction = "su")
summary(DBH.su)

DBH.sd <- direct.discrete.BH(df, "fisher", direction = "sd")
DBH.sd$Adjusted
summary(DBH.sd)

ADBH.su <- direct.discrete.BH(df, "fisher", direction = "su", adaptive = TRUE)
summary(ADBH.su)

ADBH.sd <- direct.discrete.BH(df, "fisher", direction = "sd", adaptive = TRUE)
ADBH.sd$Adjusted
summary(ADBH.sd)


[Package DiscreteFDR version 2.0.0 Index]