Learn R Programming

FDX (version 2.0.0)

NDGR: Wrapper Functions for the Non-Adaptive Discrete Guo-Romano Procedure

Description

NDGR() is a wrapper function of discrete.GR() for computing non-adaptive [DGR]. It simply passes its arguments to discrete.GR() with fixed adaptive = FALSE.

Usage

NDGR(test.results, ...)

# S3 method for default NDGR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... )

# S3 method for DiscreteTestResults NDGR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, ... )

Value

A FDX S3 class object whose elements are:

Rejected

rejected raw \(p\)-values.

Indices

indices of rejected \(p\)-values.

Num.rejected

number of rejections.

Adjusted

adjusted \(p\)-values.

Critical.values

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

Select

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

Select$Threshold

\(p\)-value selection 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\) threshold.

Data

list with input data.

Data$Method

character string describing the used algorithm, e.g. 'Discrete Lehmann-Romano procedure (step-up)'.

Data$Raw.pvalues

all observed raw \(p\)-values.

Data$pCDFlist

list of the \(p\)-value supports.

Data$FDP.threshold

FDP threshold alpha.

Data$Exceedance.probability

probability zeta of FDP exceeding alpha; thus, FDP is being controlled at level alpha with confidence 1 - zeta.

Data$Adaptive

boolean indicating whether an adaptive procedure was conducted or not.

Data$Data.name

the respective variable name(s) of the input data.

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 specifying the target FDP.

zeta

single real number strictly between 0 and 1 specifying the target probability of not exceeding the desired FDP. If zeta = NULL (the default), then zeta is chosen equal to alpha.

critical.values

single boolean indicating 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

Computing critical constants (critical.values = 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.

References

Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. tools:::Rd_expr_doi("10.1214/20-EJS1771")

See Also

discrete.GR(), DGR(), discrete.LR(), DLR(), NDLR(), discrete.PB(), DPB(), NDPB()

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

# Construction of the p-values and their supports with Fisher's exact test
library(DiscreteTests)  # for Fisher's exact test
test.results <- fisher_test_pv(df)
raw.pvalues <- test.results$get_pvalues()
pCDFlist <- test.results$get_pvalue_supports()
 
# Non-adaptive DGR without critical values; using extracted p-values and supports
NDGR.fast <- NDGR(raw.pvalues, pCDFlist)
summary(NDGR.fast)

# Non-adaptive DGR with critical values; using test results object
NDGR.crit <- NDGR(test.results, critical.values = TRUE)
summary(NDGR.crit)

Run the code above in your browser using DataLab