Title: | False Discovery Exceedance Controlling Multiple Testing Procedures |
---|---|
Description: | Multiple testing procedures for heterogeneous and discrete tests as described in Döhler and Roquain (2020) <doi:10.1214/20-EJS1771>. The main algorithms of the paper are available as continuous, discrete and weighted versions. They take as input the results of a test procedure from package 'DiscreteTests', or a set of observed p-values and their discrete support under their nulls. A shortcut function to obtain such p-values and supports is also provided, along with wrappers allowing to apply discrete procedures directly to data. |
Authors: | Sebastian Döhler [aut] , Florian Junge [aut, cre] , Etienne Roquain [ctb] |
Maintainer: | Florian Junge <[email protected]> |
License: | GPL-3 |
Version: | 2.0.1 |
Built: | 2024-10-27 12:31:11 UTC |
Source: | CRAN |
This package implements the [HLR], [HGR] and [HPB] procedures for both heterogeneous and discrete tests (see Reference).
The functions are reorganized from the reference paper in the following way.
discrete.LR()
(for Discrete Lehmann-Romano) implements [DLR],
discrete.GR()
(for Discrete Guo-Romano) implements [DGR] and
discrete.PB()
(for Discrete Poisson-Binomial) implements [DPB].
DLR()
and NDLR()
are wrappers for discrete.LR()
to access
[DLR] and its non-adaptive version directly. Likewise, DGR()
,
NDGR()
, DPB()
and NDPB()
are wrappers for
discrete.GR()
and discrete.PB()
, respectively. Their main
parameters are a vector of raw observed p-values and a list of the same
length, whose elements are the discrete supports of the CDFs of the p-values.
In the same fashion, weighted.LR()
(for Weighted Lehmann-Romano),
weighted.GR()
(for Weighted Guo-Romano) and weighted.PB()
(for Weighted Poisson-Binomial) implement [wLR], [wGR] and [wGR],
respectively. They also possess wrapper functions, namely wLR.AM()
,
wGR.AM()
and wPB.AM()
for arithmetic weighting, and wLR.GM()
,
wPB.GM()
and wPB.GM()
for geometric weighting.
The functions fast.Discrete.LR()
, fast.Discrete.GR()
and fast.Discrete.PB()
are wrappers for
DiscreteFDR::fisher.pvalues.support()
and discrete.LR()
,
discrete.GR()
and discrete.PB()
, respectively, which allow to apply
discrete procedures directly to a data set of contingency tables.
Maintainer: Florian Junge [email protected] (ORCID)
Authors:
Sebastian Döhler [email protected] (ORCID)
Other contributors:
Etienne Roquain [contributor]
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
Lehmann, E. L. & Romano, J. P. (2005). Generalizations of the familywise error rate. The Annals of Statistics, 33(3), pp. 1138-1154. doi:10.1214/009053605000000084
Guo, W. & Romano, J. P. (2007). A generalized Sidak-Holm procedure and control of generalized error rates under independence. Statistical Applications in Genetics and Molecular Biology, 6(1), Art. 3, 35 pp. (electronic). doi:10.2202/1544-6115.1247
Useful links:
Apply the usual continuous [GR] procedure, with or without computing the critical values, to a set of p-values. A non-adaptive version is available as well.
continuous.GR( test.results, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, select.threshold = 1 ) GR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 ) NGR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 )
continuous.GR( test.results, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, select.threshold = 1 ) GR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 ) NGR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 )
test.results |
either a numeric vector with p-values or an R6 object of class |
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 |
adaptive |
single boolean indicating whether to conduct an adaptive procedure or not. |
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 |
GR
and NGR
are wrapper functions for continuous.GR
. The
first one simply passes all its arguments to continuous.GR
with
adaptive = TRUE
and NGR
does the same with
adaptive = FALSE
.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Guo, W. & Romano, J. P. (2007). A generalized Sidak-Holm procedure and control of generalized error rates under independence. Statistical Applications in Genetics and Molecular Biology, 6(1), Art. 3, 35 pp. (electronic). doi:10.2202/1544-6115.1247
kernel
, FDX-package
, continuous.LR()
,
discrete.LR()
, discrete.GR()
,
discrete.PB()
, weighted.LR()
,
weighted.GR()
, weighted.PB()
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() # GR without critical values; using extracted p-values GR.fast <- GR(raw.pvalues) summary(GR.fast) # LR with critical values; using test results object GR.crit <- GR(test.results, critical.values = TRUE) summary(GR.crit) # Non-adaptive GR without critical values; using test results object NGR.fast <- NGR(test.results) summary(NGR.fast) # Non-adaptive GR with critical values; using extracted p-values NGR.crit <- NGR(raw.pvalues, critical.values = TRUE) summary(NGR.crit)
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() # GR without critical values; using extracted p-values GR.fast <- GR(raw.pvalues) summary(GR.fast) # LR with critical values; using test results object GR.crit <- GR(test.results, critical.values = TRUE) summary(GR.crit) # Non-adaptive GR without critical values; using test results object NGR.fast <- NGR(test.results) summary(NGR.fast) # Non-adaptive GR with critical values; using extracted p-values NGR.crit <- NGR(raw.pvalues, critical.values = TRUE) summary(NGR.crit)
Apply the usual (continuous) [LR] procedure, with or without computing the critical values, to a set of p-values. A non-adaptive version is available as well.
continuous.LR( test.results, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, select.threshold = 1 ) LR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 ) NLR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 )
continuous.LR( test.results, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, select.threshold = 1 ) LR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 ) NLR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 )
test.results |
either a numeric vector with p-values or an R6 object of class |
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 |
adaptive |
single boolean indicating whether to conduct an adaptive procedure or not. |
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 |
LR
and NLR
are wrapper functions for continuous.LR
. The
first one simply passes all its arguments to continuous.LR
with
adaptive = TRUE
and NLR
does the same with
adaptive = FALSE
.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Lehmann, E. L. & Romano, J. P. (2005). Generalizations of the familywise error rate. The Annals of Statistics, 33(3), pp. 1138-1154. doi:10.1214/009053605000000084
kernel()
, FDX
, continuous.GR()
,
discrete.LR()
, discrete.GR()
,
discrete.PB()
, weighted.LR()
,
weighted.GR()
, weighted.PB()
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() # LR without critical values; using extracted p-values LR.fast <- LR(raw.pvalues) summary(LR.fast) # LR with critical values; using test results object LR.crit <- LR(test.results, critical.values = TRUE) summary(LR.crit) # Non-adaptive LR without critical values; using test results object NLR.fast <- NLR(test.results) summary(NLR.fast) # Non-adaptive LR with critical values; using extracted p-values NLR.crit <- NLR(raw.pvalues, critical.values = TRUE) summary(NLR.crit)
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() # LR without critical values; using extracted p-values LR.fast <- LR(raw.pvalues) summary(LR.fast) # LR with critical values; using test results object LR.crit <- LR(test.results, critical.values = TRUE) summary(LR.crit) # Non-adaptive LR without critical values; using test results object NLR.fast <- NLR(test.results) summary(NLR.fast) # Non-adaptive LR with critical values; using extracted p-values NLR.crit <- NLR(raw.pvalues, critical.values = TRUE) summary(NLR.crit)
DGR()
is a wrapper function of discrete.GR()
for computing [DGR]. It
simply passes its arguments to discrete.GR()
with fixed
adaptive = TRUE
.
DGR(test.results, ...) ## Default S3 method: DGR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' DGR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, ... )
DGR(test.results, ...) ## Default S3 method: DGR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' DGR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
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 |
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 |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
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.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
discrete.GR()
, NDGR()
, discrete.LR()
, DLR()
, NDLR()
,
discrete.PB()
, DPB()
, NDPB()
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() # DGR without critical values; using extracted p-values and supports DGR.fast <- DGR(raw.pvalues, pCDFlist) summary(DGR.fast) # DGR with critical values; using test results object DGR.crit <- DGR(test.results, critical.values = TRUE) summary(DGR.crit)
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() # DGR without critical values; using extracted p-values and supports DGR.fast <- DGR(raw.pvalues, pCDFlist) summary(DGR.fast) # DGR with critical values; using test results object DGR.crit <- DGR(test.results, critical.values = TRUE) summary(DGR.crit)
Apply the [DLR], [NDLR], [DGR], [NDGR], [PB] or [NPB] procedure, with or without computing the critical constants, to a data set of 2x2 contingency tables using a hypothesis test function from package DiscreteTests.
direct.discrete.LR( dat, test.fun, test.args = NULL, alpha = 0.05, zeta = 0.5, direction = "su", adaptive = FALSE, critical.values = FALSE, select.threshold = 1, preprocess.fun = NULL, preprocess.args = NULL ) direct.discrete.GR( dat, test.fun, test.args = NULL, alpha = 0.05, zeta = 0.5, adaptive = FALSE, critical.values = FALSE, select.threshold = 1, preprocess.fun = NULL, preprocess.args = NULL ) direct.discrete.PB( dat, test.fun, test.args = NULL, alpha = 0.05, zeta = 0.5, adaptive = FALSE, critical.values = FALSE, exact = TRUE, select.threshold = 1, preprocess.fun = NULL, preprocess.args = NULL )
direct.discrete.LR( dat, test.fun, test.args = NULL, alpha = 0.05, zeta = 0.5, direction = "su", adaptive = FALSE, critical.values = FALSE, select.threshold = 1, preprocess.fun = NULL, preprocess.args = NULL ) direct.discrete.GR( dat, test.fun, test.args = NULL, alpha = 0.05, zeta = 0.5, adaptive = FALSE, critical.values = FALSE, select.threshold = 1, preprocess.fun = NULL, preprocess.args = NULL ) direct.discrete.PB( dat, test.fun, test.args = NULL, alpha = 0.05, zeta = 0.5, adaptive = FALSE, critical.values = FALSE, exact = TRUE, select.threshold = 1, preprocess.fun = NULL, preprocess.args = NULL )
dat |
input data; must be suitable for the first parameter
of the provided |
test.fun |
function from package
|
test.args |
optional named list with arguments for |
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 |
direction |
single character string specifying whether to perform the step-up ( |
adaptive |
single boolean indicating whether to conduct an adaptive procedure or not. |
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 |
preprocess.fun |
optional function for pre-processing the input
|
preprocess.args |
optional named list with arguments for
|
exact |
single boolean indicating whether to compute the Poisson-Binomial distribution exactly or by normal approximation. |
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() # DLR DLR.sd <- direct.discrete.LR(df, "fisher") summary(DLR.sd) # Non-adaptive DLR (step-up variant; adjusted p-values do not exist here!) NDLR.su <- direct.discrete.LR(df, "fisher", direction = "su", adaptive = FALSE) summary(NDLR.su) # DGR DGR <- direct.discrete.GR(df, "fisher") summary(DGR) # Non-adaptive DGR NDGR <- direct.discrete.GR(df, "fisher", adaptive = FALSE) summary(NDGR) # DPB (normal approximation) PB.approx <- direct.discrete.PB(df, "fisher", exact = FALSE) summary(DGR) # Non-adaptive DPB NPB.exact <- direct.discrete.GR(df, "fisher", adaptive = FALSE) summary(NDGR)
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() # DLR DLR.sd <- direct.discrete.LR(df, "fisher") summary(DLR.sd) # Non-adaptive DLR (step-up variant; adjusted p-values do not exist here!) NDLR.su <- direct.discrete.LR(df, "fisher", direction = "su", adaptive = FALSE) summary(NDLR.su) # DGR DGR <- direct.discrete.GR(df, "fisher") summary(DGR) # Non-adaptive DGR NDGR <- direct.discrete.GR(df, "fisher", adaptive = FALSE) summary(NDGR) # DPB (normal approximation) PB.approx <- direct.discrete.PB(df, "fisher", exact = FALSE) summary(DGR) # Non-adaptive DPB NPB.exact <- direct.discrete.GR(df, "fisher", adaptive = FALSE) summary(NDGR)
Apply the [DGR] procedure, with or without computing the critical values, to a set of p-values and their discrete support. A non-adaptive version is available as well.
discrete.GR(test.results, ...) ## Default S3 method: discrete.GR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' discrete.GR( test.results, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, select.threshold = 1, ... )
discrete.GR(test.results, ...) ## Default S3 method: discrete.GR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' discrete.GR( test.results, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, select.threshold = 1, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
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 |
adaptive |
single boolean indicating whether to conduct an adaptive procedure or not. |
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 |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
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.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
FDX
, discrete.LR()
, discrete.PB()
,
continuous.LR()
, continuous.GR()
, weighted.LR()
,
weighted.GR()
, weighted.PB()
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() # DGR without critical values; using test results object DGR.fast <- discrete.GR(test.results) summary(DGR.fast) # DGR with critical values; using extracted p-values and supports DGR.crit <- discrete.GR(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DGR.crit) # Non-Adaptive DGR without critical values; using extracted p-values and supports NDGR.fast <- discrete.GR(raw.pvalues, pCDFlist, adaptive = FALSE) summary(NDGR.fast) # Non-Adaptive DGR without critical values; using test results object NDGR.crit <- discrete.GR(test.results, adaptive = FALSE, critical.values = TRUE) summary(NDGR.crit)
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() # DGR without critical values; using test results object DGR.fast <- discrete.GR(test.results) summary(DGR.fast) # DGR with critical values; using extracted p-values and supports DGR.crit <- discrete.GR(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DGR.crit) # Non-Adaptive DGR without critical values; using extracted p-values and supports NDGR.fast <- discrete.GR(raw.pvalues, pCDFlist, adaptive = FALSE) summary(NDGR.fast) # Non-Adaptive DGR without critical values; using test results object NDGR.crit <- discrete.GR(test.results, adaptive = FALSE, critical.values = TRUE) summary(NDGR.crit)
Apply the [DLR] procedure, with or without computing the critical values, to a set of p-values and their discrete support. Both step-down and step-up procedures can be computed and non-adaptive versions are available as well.
discrete.LR(test.results, ...) ## Default S3 method: discrete.LR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, direction = "sd", adaptive = TRUE, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' discrete.LR( test.results, alpha = 0.05, zeta = 0.5, direction = "sd", adaptive = TRUE, critical.values = FALSE, select.threshold = 1, ... )
discrete.LR(test.results, ...) ## Default S3 method: discrete.LR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, direction = "sd", adaptive = TRUE, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' discrete.LR( test.results, alpha = 0.05, zeta = 0.5, direction = "sd", adaptive = TRUE, critical.values = FALSE, select.threshold = 1, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
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 |
direction |
single character string specifying whether to perform the step-up ( |
adaptive |
single boolean indicating whether to conduct an adaptive procedure or not. |
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 |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
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.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
FDX
, discrete.GR()
, discrete.PB()
,
continuous.LR()
, continuous.GR()
, weighted.LR()
,
weighted.GR()
, weighted.PB()
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() # DLR without critical values; using results object DLR.sd.fast <- discrete.LR(test.results) summary(DLR.sd.fast) # DLR with critical values; using extracted p-values and supports DLR.sd.crit <- discrete.LR(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DLR.sd.crit) # DLR (step-up) without critical values; using extracted p-values and supports DLR.su.fast <- discrete.LR(raw.pvalues, pCDFlist, direction = "su") summary(DLR.su.fast) # DLR (step-up) with critical values; using results object DLR.su.crit <- discrete.LR(test.results, direction = "su", critical.values = TRUE) summary(DLR.su.crit) # Non-adaptive DLR without critical values; using results object NDLR.sd.fast <- discrete.LR(test.results, adaptive = FALSE) summary(NDLR.sd.fast) # Non-adaptive DLR with critical values; using extracted p-values and supports NDLR.sd.crit <- discrete.LR(raw.pvalues, pCDFlist, adaptive = FALSE, critical.values = TRUE) summary(NDLR.sd.crit) # Non-adaptive DLR (step-up) without critical values; using extracted p-values and supports NDLR.su.fast <- discrete.LR(raw.pvalues, pCDFlist, direction = "su", adaptive = FALSE) summary(NDLR.su.fast) # Non-adaptive DLR (step-up) with critical values; using results object NDLR.su.crit <- discrete.LR(test.results, direction = "su", adaptive = FALSE, critical.values = TRUE) summary(NDLR.su.crit)
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() # DLR without critical values; using results object DLR.sd.fast <- discrete.LR(test.results) summary(DLR.sd.fast) # DLR with critical values; using extracted p-values and supports DLR.sd.crit <- discrete.LR(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DLR.sd.crit) # DLR (step-up) without critical values; using extracted p-values and supports DLR.su.fast <- discrete.LR(raw.pvalues, pCDFlist, direction = "su") summary(DLR.su.fast) # DLR (step-up) with critical values; using results object DLR.su.crit <- discrete.LR(test.results, direction = "su", critical.values = TRUE) summary(DLR.su.crit) # Non-adaptive DLR without critical values; using results object NDLR.sd.fast <- discrete.LR(test.results, adaptive = FALSE) summary(NDLR.sd.fast) # Non-adaptive DLR with critical values; using extracted p-values and supports NDLR.sd.crit <- discrete.LR(raw.pvalues, pCDFlist, adaptive = FALSE, critical.values = TRUE) summary(NDLR.sd.crit) # Non-adaptive DLR (step-up) without critical values; using extracted p-values and supports NDLR.su.fast <- discrete.LR(raw.pvalues, pCDFlist, direction = "su", adaptive = FALSE) summary(NDLR.su.fast) # Non-adaptive DLR (step-up) with critical values; using results object NDLR.su.crit <- discrete.LR(test.results, direction = "su", adaptive = FALSE, critical.values = TRUE) summary(NDLR.su.crit)
DLR()
is a wrapper function of discrete.LR()
for computing [DLR]. It
simply passes its arguments to discrete.LR()
with fixed
adaptive = TRUE
.
DLR(test.results, ...) ## Default S3 method: DLR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, direction = "sd", critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' DLR( test.results, alpha = 0.05, zeta = 0.5, direction = "sd", critical.values = FALSE, select.threshold = 1, ... )
DLR(test.results, ...) ## Default S3 method: DLR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, direction = "sd", critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' DLR( test.results, alpha = 0.05, zeta = 0.5, direction = "sd", critical.values = FALSE, select.threshold = 1, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
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 |
direction |
single character string specifying whether to perform the step-up ( |
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 |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
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.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
discrete.LR()
, NDLR()
, discrete.GR()
, DGR()
, NDGR()
,
discrete.PB()
, DPB()
, NDPB()
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() # DLR without critical values; using results object DLR.sd.fast <- DLR(test.results) summary(DLR.sd.fast) # DLR with critical values; using extracted p-values and supports DLR.sd.crit <- DLR(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DLR.sd.crit) # DLR (step-up) without critical values; using extracted p-values and supports DLR.su.fast <- DLR(raw.pvalues, pCDFlist, direction = "su") summary(DLR.su.fast) # DLR (step-up) with critical values; using test results object DLR.su.crit <- DLR(test.results, direction = "su", critical.values = TRUE) summary(DLR.su.crit)
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() # DLR without critical values; using results object DLR.sd.fast <- DLR(test.results) summary(DLR.sd.fast) # DLR with critical values; using extracted p-values and supports DLR.sd.crit <- DLR(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DLR.sd.crit) # DLR (step-up) without critical values; using extracted p-values and supports DLR.su.fast <- DLR(raw.pvalues, pCDFlist, direction = "su") summary(DLR.su.fast) # DLR (step-up) with critical values; using test results object DLR.su.crit <- DLR(test.results, direction = "su", critical.values = TRUE) summary(DLR.su.crit)
DPB()
is a wrapper function of discrete.PB()
for computing [DPB]. It
simply passes its arguments to discrete.PB()
with fixed
adaptive = TRUE
.
DPB(test.results, ...) ## Default S3 method: DPB( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1, pCDFlist.indices = NULL, ... )
DPB(test.results, ...) ## Default S3 method: DPB( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1, pCDFlist.indices = NULL, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
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 |
critical.values |
single boolean indicating whether critical constants are to be computed. |
exact |
single boolean indicating whether to compute the Poisson-Binomial distribution exactly or by normal approximation. |
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 |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
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.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
discrete.PB()
, NDPB()
, discrete.GR()
, DGR()
, NDGR()
,
discrete.LR()
, DLR()
, NDLR()
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() # DPB (exact) without critical values; using results object DPB.exact.fast <- DPB(test.results) summary(DPB.exact.fast) # DPB (exact) with critical values; using extracted p-values and supports DPB.exact.crit <- DPB(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DPB.exact.crit) # DPB (normal approximation) without critical values; using extracted p-values and supports DPB.norm.fast <- DPB(raw.pvalues, pCDFlist, exact = FALSE) summary(DPB.norm.fast) # DPB (normal approximation) with critical values; using test results object DPB.norm.crit <- DPB(test.results, critical.values = TRUE, exact = FALSE) summary(DPB.norm.crit)
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() # DPB (exact) without critical values; using results object DPB.exact.fast <- DPB(test.results) summary(DPB.exact.fast) # DPB (exact) with critical values; using extracted p-values and supports DPB.exact.crit <- DPB(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DPB.exact.crit) # DPB (normal approximation) without critical values; using extracted p-values and supports DPB.norm.fast <- DPB(raw.pvalues, pCDFlist, exact = FALSE) summary(DPB.norm.fast) # DPB (normal approximation) with critical values; using test results object DPB.norm.crit <- DPB(test.results, critical.values = TRUE, exact = FALSE) summary(DPB.norm.crit)
Apply the [DPB] procedure, with or without computing the critical values, to a set of p-values and their discrete support. A non-adaptive version is available as well. Additionally, the user can choose between exact computation of the Poisson-Binomial distribution or a refined normal approximation.
## S3 method for class 'DiscreteTestResults' DPB( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1, ... ) discrete.PB(test.results, ...) ## Default S3 method: discrete.PB( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, exact = TRUE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' discrete.PB( test.results, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, exact = TRUE, select.threshold = 1, ... )
## S3 method for class 'DiscreteTestResults' DPB( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1, ... ) discrete.PB(test.results, ...) ## Default S3 method: discrete.PB( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, exact = TRUE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' discrete.PB( test.results, alpha = 0.05, zeta = 0.5, adaptive = TRUE, critical.values = FALSE, exact = TRUE, select.threshold = 1, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
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 |
critical.values |
single boolean indicating whether critical constants are to be computed. |
exact |
single boolean indicating whether to compute the Poisson-Binomial distribution exactly or by normal approximation. |
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 |
... |
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. |
adaptive |
single boolean indicating whether to conduct an adaptive procedure or not. |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
DPB
and NDPB
are wrapper functions for discrete.PB
.
The first one simply passes all its arguments to discrete.PB
with
adaptive = TRUE
and NDPB
does the same with
adaptive = FALSE
.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
kernel
, FDX
, continuous.LR()
,
continuous.GR()
, discrete.LR()
,
discrete.GR()
, weighted.LR()
,
weighted.GR()
, weighted.PB()
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() # DPB (exact) without critical values; using results object DPB.exact.fast <- discrete.PB(test.results) summary(DPB.exact.fast) # DPB (exact) with critical values; using extracted p-values and supports DPB.exact.crit <- discrete.PB(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DPB.exact.crit) # DPB (normal approximation) without critical values; using extracted p-values and supports DPB.norm.fast <- discrete.PB(raw.pvalues, pCDFlist, exact = FALSE) summary(DPB.norm.fast) # DPB (normal approximation) with critical values; using results object DPB.norm.crit <- discrete.PB(test.results, critical.values = TRUE, exact = FALSE) summary(DPB.norm.crit) # Non-adaptive DPB (exact) without critical values; using results object NDPB.exact.fast <- discrete.PB(test.results, adaptive = FALSE) summary(NDPB.exact.fast) # Non-adaptive DPB (exact) with critical values; using extracted p-values and supports NDPB.exact.crit <- discrete.PB(raw.pvalues, pCDFlist, adaptive = FALSE, critical.values = TRUE) summary(NDPB.exact.crit) # Non-adaptive DPB (normal approx.) without critical values; using extracted p-values and supports NDPB.norm.fast <- discrete.PB(raw.pvalues, pCDFlist, adaptive = FALSE, exact = FALSE) summary(NDPB.norm.fast) # Non-adaptive DPB (normal approx.) with critical values; using results object NDPB.norm.crit <- discrete.PB(test.results, adaptive = FALSE, critical.values = TRUE, exact = FALSE) summary(NDPB.norm.crit)
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() # DPB (exact) without critical values; using results object DPB.exact.fast <- discrete.PB(test.results) summary(DPB.exact.fast) # DPB (exact) with critical values; using extracted p-values and supports DPB.exact.crit <- discrete.PB(raw.pvalues, pCDFlist, critical.values = TRUE) summary(DPB.exact.crit) # DPB (normal approximation) without critical values; using extracted p-values and supports DPB.norm.fast <- discrete.PB(raw.pvalues, pCDFlist, exact = FALSE) summary(DPB.norm.fast) # DPB (normal approximation) with critical values; using results object DPB.norm.crit <- discrete.PB(test.results, critical.values = TRUE, exact = FALSE) summary(DPB.norm.crit) # Non-adaptive DPB (exact) without critical values; using results object NDPB.exact.fast <- discrete.PB(test.results, adaptive = FALSE) summary(NDPB.exact.fast) # Non-adaptive DPB (exact) with critical values; using extracted p-values and supports NDPB.exact.crit <- discrete.PB(raw.pvalues, pCDFlist, adaptive = FALSE, critical.values = TRUE) summary(NDPB.exact.crit) # Non-adaptive DPB (normal approx.) without critical values; using extracted p-values and supports NDPB.norm.fast <- discrete.PB(raw.pvalues, pCDFlist, adaptive = FALSE, exact = FALSE) summary(NDPB.norm.fast) # Non-adaptive DPB (normal approx.) with critical values; using results object NDPB.norm.crit <- discrete.PB(test.results, adaptive = FALSE, critical.values = TRUE, exact = FALSE) summary(NDPB.norm.crit)
Applies the [DLR], [DGR] or [DPB] procedures, without computing the critical values, to a data set of 2 x 2 contingency tables using Fisher's exact test.
Note: These functions are deprecated and will be removed in a future
version. Please use direct.discrete.*()
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 likedata |>
DiscreteDatasets::reconstruct_*(<args>) |>
DiscreteTests::*.test.pv(<args>) |>
discrete.*(<args>)
.
fast.Discrete.LR( counts, alternative = "greater", input = "noassoc", alpha = 0.05, zeta = 0.5, direction = "sd", adaptive = TRUE ) fast.Discrete.GR( counts, alternative = "greater", input = "noassoc", alpha = 0.05, zeta = 0.5, adaptive = TRUE ) fast.Discrete.PB( counts, alternative = "greater", input = "noassoc", alpha = 0.05, zeta = 0.5, adaptive = TRUE, exact = FALSE )
fast.Discrete.LR( counts, alternative = "greater", input = "noassoc", alpha = 0.05, zeta = 0.5, direction = "sd", adaptive = TRUE ) fast.Discrete.GR( counts, alternative = "greater", input = "noassoc", alpha = 0.05, zeta = 0.5, adaptive = TRUE ) fast.Discrete.PB( counts, alternative = "greater", input = "noassoc", alpha = 0.05, zeta = 0.5, adaptive = TRUE, exact = FALSE )
counts |
a data frame of 2 or 4 columns and any number of lines,
each line representing a 2 x 2 contingency table to
test. The number of columns and what they must contain
depend on the value of the |
alternative |
same argument as in |
input |
the format of the input data frame, see Details of
|
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 |
direction |
single character string specifying whether to perform the step-up ( |
adaptive |
single boolean indicating whether to conduct an adaptive procedure or not. |
exact |
single boolean indicating whether to compute the Poisson-Binomial distribution exactly or by normal approximation. |
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
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 # DLR DLR.sd <- fast.Discrete.LR(counts = df, input = "noassoc") summary(DLR.sd) # DLR DLR.su <- fast.Discrete.LR(counts = df, input = "noassoc", direction = "su") summary(DLR.su) # Non-adaptive DLR NDLR.sd <- fast.Discrete.LR(counts = df, input = "noassoc", adaptive = FALSE) summary(NDLR.sd) # Non-adaptive DLR NDLR.su <- fast.Discrete.LR(counts = df, input = "noassoc", direction = "su", adaptive = FALSE) summary(NDLR.su) # DGR DGR <- fast.Discrete.GR(counts = df, input = "noassoc") summary(DGR) # Non-adaptive DGR NDGR <- fast.Discrete.GR(counts = df, input = "noassoc", adaptive = FALSE) summary(NDGR) # DPB DPB <- fast.Discrete.PB(counts = df, input = "noassoc") summary(DPB) # Non-adaptive DPB NDPB <- fast.Discrete.PB(counts = df, input = "noassoc", adaptive = FALSE) summary(NDPB)
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 # DLR DLR.sd <- fast.Discrete.LR(counts = df, input = "noassoc") summary(DLR.sd) # DLR DLR.su <- fast.Discrete.LR(counts = df, input = "noassoc", direction = "su") summary(DLR.su) # Non-adaptive DLR NDLR.sd <- fast.Discrete.LR(counts = df, input = "noassoc", adaptive = FALSE) summary(NDLR.sd) # Non-adaptive DLR NDLR.su <- fast.Discrete.LR(counts = df, input = "noassoc", direction = "su", adaptive = FALSE) summary(NDLR.su) # DGR DGR <- fast.Discrete.GR(counts = df, input = "noassoc") summary(DGR) # Non-adaptive DGR NDGR <- fast.Discrete.GR(counts = df, input = "noassoc", adaptive = FALSE) summary(NDGR) # DPB DPB <- fast.Discrete.PB(counts = df, input = "noassoc") summary(DPB) # Non-adaptive DPB NDPB <- fast.Discrete.PB(counts = df, input = "noassoc", adaptive = FALSE) summary(NDPB)
Computes a histogram of the raw p-values of a FDX
object.
## S3 method for class 'FDX' hist(x, breaks = "FD", mode = c("raw", "selected", "weighted"), ...)
## S3 method for class 'FDX' hist(x, breaks = "FD", mode = c("raw", "selected", "weighted"), ...)
x |
object of class |
breaks |
as in |
mode |
single character string specifying for which $p$-values the
histogram is to be generated; must be one of |
... |
further arguments to |
If x
does not contain results of a weighting or selection approach, a
warning is issued and a histogram of the raw p-values is drawn.
An object of class histogram
.
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() # DGR DGR <- DGR(raw.pvalues, pCDFlist) # histogram of raw p-values hist(DGR) # arithmetic-weighted GR (using 1 - raw.pvalues as weights) wGR <- wGR.AM(raw.pvalues, 1 - raw.pvalues) # histogram of raw p-values hist(wGR) # histogram of weighted p-values hist(wGR, mode = "weighted")
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() # DGR DGR <- DGR(raw.pvalues, pCDFlist) # histogram of raw p-values hist(DGR) # arithmetic-weighted GR (using 1 - raw.pvalues as weights) wGR <- wGR.AM(raw.pvalues, 1 - raw.pvalues) # histogram of raw p-values hist(wGR) # histogram of weighted p-values hist(wGR, mode = "weighted")
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
.
NDGR(test.results, ...) ## Default S3 method: NDGR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' NDGR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, ... )
NDGR(test.results, ...) ## Default S3 method: NDGR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' NDGR( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
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 |
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 |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
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.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
discrete.GR()
, DGR()
, discrete.LR()
, DLR()
, NDLR()
,
discrete.PB()
, DPB()
, NDPB()
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)
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)
NDLR()
is a wrapper function of discrete.LR()
for computing
non-adaptive [DLR]. It simply passes its arguments to discrete.LR()
with fixed adaptive = FALSE
.
NDLR(test.results, ...) ## Default S3 method: NDLR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, direction = "sd", critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' NDLR( test.results, alpha = 0.05, zeta = 0.5, direction = "sd", critical.values = FALSE, select.threshold = 1, ... )
NDLR(test.results, ...) ## Default S3 method: NDLR( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, direction = "sd", critical.values = FALSE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' NDLR( test.results, alpha = 0.05, zeta = 0.5, direction = "sd", critical.values = FALSE, select.threshold = 1, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
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 |
direction |
single character string specifying whether to perform the step-up ( |
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 |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
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.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
discrete.GR()
, DGR()
, discrete.LR()
, DLR()
, NDLR()
,
discrete.PB()
, DPB()
, NDPB()
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 DLR without critical values; using results object NDLR.sd.fast <- NDLR(test.results) summary(NDLR.sd.fast) # Non-adaptive DLR with critical values; using extracted p-values and supports NDLR.sd.crit <- NDLR(raw.pvalues, pCDFlist, critical.values = TRUE) summary(NDLR.sd.crit) # Non-adaptive DLR (step-up) without critical values; using extracted p-values and supports NDLR.su.fast <- NDLR(raw.pvalues, pCDFlist, direction = "su") summary(NDLR.su.fast) # Non-adaptive DLR (step-up) with critical values; using test results object NDLR.su.crit <- NDLR(test.results, direction = "su", critical.values = TRUE) summary(NDLR.su.crit)
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 DLR without critical values; using results object NDLR.sd.fast <- NDLR(test.results) summary(NDLR.sd.fast) # Non-adaptive DLR with critical values; using extracted p-values and supports NDLR.sd.crit <- NDLR(raw.pvalues, pCDFlist, critical.values = TRUE) summary(NDLR.sd.crit) # Non-adaptive DLR (step-up) without critical values; using extracted p-values and supports NDLR.su.fast <- NDLR(raw.pvalues, pCDFlist, direction = "su") summary(NDLR.su.fast) # Non-adaptive DLR (step-up) with critical values; using test results object NDLR.su.crit <- NDLR(test.results, direction = "su", critical.values = TRUE) summary(NDLR.su.crit)
NDPB()
is a wrapper function of discrete.PB()
for computing
non-adaptive [DPB]. It simply passes its arguments to discrete.PB()
with fixed adaptive = FALSE
.
NDPB(test.results, ...) ## Default S3 method: NDPB( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' NDPB( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1, ... )
NDPB(test.results, ...) ## Default S3 method: NDPB( test.results, pCDFlist, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1, pCDFlist.indices = NULL, ... ) ## S3 method for class 'DiscreteTestResults' NDPB( test.results, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1, ... )
test.results |
either a numeric vector with p-values or an R6 object of class |
... |
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 |
critical.values |
single boolean indicating whether critical constants are to be computed. |
exact |
single boolean indicating whether to compute the Poisson-Binomial distribution exactly or by normal approximation. |
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 |
pCDFlist.indices |
list of numeric vectors containing the test indices that indicate to which raw p-value each unique support in |
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.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$pCDFlist |
list of the |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Adaptive |
boolean indicating whether an adaptive procedure was conducted or not. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
discrete.PB()
, DPB()
, discrete.GR()
, DGR()
, NDGR()
,
discrete.LR()
, DLR()
, NDLR()
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 DPB (exact) without critical values; using results object NDPB.exact.fast <- NDPB(test.results) summary(NDPB.exact.fast) # Non-adaptive DPB (exact) with critical values; using extracted p-values and supports NDPB.exact.crit <- NDPB(raw.pvalues, pCDFlist, critical.values = TRUE) summary(NDPB.exact.crit) # Non-adaptive DPB (normal approx.) without critical values; using extracted p-values and supports NDPB.norm.fast <- NDPB(raw.pvalues, pCDFlist, exact = FALSE) summary(NDPB.norm.fast) # Non-adaptive DPB (normal approx.) with critical values; using test results object NDPB.norm.crit <- NDPB(test.results, critical.values = TRUE, exact = FALSE) summary(NDPB.norm.crit)
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 DPB (exact) without critical values; using results object NDPB.exact.fast <- NDPB(test.results) summary(NDPB.exact.fast) # Non-adaptive DPB (exact) with critical values; using extracted p-values and supports NDPB.exact.crit <- NDPB(raw.pvalues, pCDFlist, critical.values = TRUE) summary(NDPB.exact.crit) # Non-adaptive DPB (normal approx.) without critical values; using extracted p-values and supports NDPB.norm.fast <- NDPB(raw.pvalues, pCDFlist, exact = FALSE) summary(NDPB.norm.fast) # Non-adaptive DPB (normal approx.) with critical values; using test results object NDPB.norm.crit <- NDPB(test.results, critical.values = TRUE, exact = FALSE) summary(NDPB.norm.crit)
FDX
objectsPlots raw $p$-values of a FDX
object and highlights rejected and
non-rejected $p$-values. If present, the critical values are plotted, too.
## S3 method for class 'FDX' plot( x, col = c(2, 4, 1), pch = c(20, 20, 17), lwd = rep(par()$lwd, 3), cex = rep(par()$cex, 3), type.crit = "b", legend = NULL, ... )
## S3 method for class 'FDX' plot( x, col = c(2, 4, 1), pch = c(20, 20, 17), lwd = rep(par()$lwd, 3), cex = rep(par()$cex, 3), type.crit = "b", legend = NULL, ... )
x |
an object of class " |
col |
numeric or character vector of length 3 indicating the colors of the
|
pch |
numeric or character vector of length 3 indicating the point characters of the
|
lwd |
numeric vector of length 3 indicating the thickness of the
points and lines; defaults to current |
cex |
numeric vector of length 3 indicating the size of point characters or lines of the
defaults to current |
type.crit |
single character giving the type of plot desired for the
critical values (e.g.: |
legend |
if |
... |
further arguments to |
If x
contains results of a weighted approach, the Y-axis of the plot
is derived from the weighted p-values. Otherwise, it is constituted by the
raw ones.
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() # DLR without critical values; using extracted p-values and supports DLR.sd.fast <- DLR(raw.pvalues, pCDFlist) # plot with default settings plot(DLR.sd.fast) # DLR (step-up) with critical values; using test results object DLR.su.crit <- DLR(test.results, direction = "su", critical.values = TRUE) # limited plot range plot(DLR.su.crit, xlim = c(1, 5), ylim = c(0, 0.4)) # DPB without critical values; using test results object DPB.fast <- DPB(test.results) # limited plot range, custom colors, line widths and point symbols, top-left legend plot(DPB.fast, col = c(2, 4), pch = c(2, 3), lwd = c(2, 2), legend = "topleft", xlim = c(1, 5), ylim = c(0, 0.4)) # DGR with critical values; using extracted p-values and supports DGR.crit <- DGR(raw.pvalues, pCDFlist, critical.values = TRUE) # additional customized plot parameters plot(DGR.crit, col = c(2, 4, 1), pch = c(1, 1, 4), lwd = c(1, 1, 2), type.crit = 'o', legend = c(1, 0.4), lty = 1, xlim = c(1, 5), ylim = c(0, 0.4), cex = c(3, 3, 2))
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() # DLR without critical values; using extracted p-values and supports DLR.sd.fast <- DLR(raw.pvalues, pCDFlist) # plot with default settings plot(DLR.sd.fast) # DLR (step-up) with critical values; using test results object DLR.su.crit <- DLR(test.results, direction = "su", critical.values = TRUE) # limited plot range plot(DLR.su.crit, xlim = c(1, 5), ylim = c(0, 0.4)) # DPB without critical values; using test results object DPB.fast <- DPB(test.results) # limited plot range, custom colors, line widths and point symbols, top-left legend plot(DPB.fast, col = c(2, 4), pch = c(2, 3), lwd = c(2, 2), legend = "topleft", xlim = c(1, 5), ylim = c(0, 0.4)) # DGR with critical values; using extracted p-values and supports DGR.crit <- DGR(raw.pvalues, pCDFlist, critical.values = TRUE) # additional customized plot parameters plot(DGR.crit, col = c(2, 4, 1), pch = c(1, 1, 4), lwd = c(1, 1, 2), type.crit = 'o', legend = c(1, 0.4), lty = 1, xlim = c(1, 5), ylim = c(0, 0.4), cex = c(3, 3, 2))
Prints the results of discrete FDX analysis, stored in a FDX
S3 class object.
## S3 method for class 'FDX' print(x, ...)
## S3 method for class 'FDX' print(x, ...)
x |
object of class |
... |
further arguments to be passed to or from other methods. They are ignored in this function. |
The respective input object is invisibly returned via invisible(x)
.
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() # DPB with critical values; using test results object DPB.crit <- DPB(test.results, critical.values = TRUE) # print results print(DPB.crit)
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() # DPB with critical values; using test results object DPB.crit <- DPB(test.results, critical.values = TRUE) # print results print(DPB.crit)
FDX
objects)Displays the number of rejections of the raw p-values in a FDX
object in dependence of the exceedance probability zeta
.
rejection.path( x, xlim = NULL, ylim = NULL, main = NULL, xlab = expression(zeta), ylab = "Number of Rejections", verticals = FALSE, pch = 19, ref.show = FALSE, ref.col = "gray", ref.lty = 2, ref.lwd = 2, ... )
rejection.path( x, xlim = NULL, ylim = NULL, main = NULL, xlab = expression(zeta), ylab = "Number of Rejections", verticals = FALSE, pch = 19, ref.show = FALSE, ref.col = "gray", ref.lty = 2, ref.lwd = 2, ... )
x |
object of class " |
xlim |
x axis limits of the plot. If |
ylim |
the y limits of the plot. If |
main |
main title. If |
xlab , ylab
|
labels for x and y axis. |
verticals |
logical; if |
pch |
jump point character. |
ref.show |
logical; if |
ref.col |
color of the reference line. |
ref.lty , ref.lwd
|
line type and thickness for the reference line. |
... |
further arguments to |
Invisibly returns a stepfun
object that computes the number of
rejections in dependence on the exceedance probability zeta
.
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() # DLR without critical values; using extracted p-values and supports DLR <- DLR(raw.pvalues, pCDFlist) # plot number of rejections dependent on the exceedance probability zeta rejection.path(DLR, xlim = c(0, 1), ref.show = TRUE, ref.col = "green", ref.lty = 4) # None-adaptive DLR without critical values; using test results object NDLR <- NDLR(test.results) # add plot for non-adaptive procedure (in red) rejection.path(NDLR, col = "red", add = TRUE)
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() # DLR without critical values; using extracted p-values and supports DLR <- DLR(raw.pvalues, pCDFlist) # plot number of rejections dependent on the exceedance probability zeta rejection.path(DLR, xlim = c(0, 1), ref.show = TRUE, ref.col = "green", ref.lty = 4) # None-adaptive DLR without critical values; using test results object NDLR <- NDLR(test.results) # add plot for non-adaptive procedure (in red) rejection.path(NDLR, col = "red", add = TRUE)
summary
method for class FDX
## S3 method for class 'FDX' summary(object, ...) ## S3 method for class 'summary.FDX' print(x, max = NULL, ...)
## S3 method for class 'FDX' summary(object, ...) ## S3 method for class 'summary.FDX' print(x, max = NULL, ...)
object |
object of class " |
... |
further arguments passed to or from other methods. |
x |
object of class " |
max |
numeric or |
summary.FDX
objects include all data of an FDX
class
object, but also include an additional table which includes the raw p-values,
their indices, the respective critical values (if present), the adjusted
p-values (if present) and a logical column to indicate rejection. The table
is sorted in ascending order by the raw p-values.
print.summary.FDX
simply prints the same output as
print.FDX
, but also prints the p-value table.
summary.FDX
computes and returns a list that includes all the
data of an input FDX
, plus
Table |
a |
print.summary.FDX
returns that object invisibly.
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() # DGR with critical values; using test results object DGR.crit <- DGR(test.results, critical.values = TRUE) # create summary DGR.crit.summary <- summary(DGR.crit) # print summary print(DGR.crit.summary)
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() # DGR with critical values; using test results object DGR.crit <- DGR(test.results, critical.values = TRUE) # create summary DGR.crit.summary <- summary(DGR.crit) # print summary print(DGR.crit.summary)
Apply the weighted [wGR] procedure, with or without computing the critical values, to a set of p-values. Both arithmetic and geometric weighting are available.
weighted.GR( test.results, weights = NULL, alpha = 0.05, zeta = 0.5, weighting.method = c("AM", "GM"), critical.values = FALSE, select.threshold = 1 ) wGR.AM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 ) wGR.GM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 )
weighted.GR( test.results, weights = NULL, alpha = 0.05, zeta = 0.5, weighting.method = c("AM", "GM"), critical.values = FALSE, select.threshold = 1 ) wGR.AM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 ) wGR.GM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 )
test.results |
either a numeric vector with p-values or an R6 object of class |
weights |
numeric vector that contains the weights for the p-values. |
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 |
weighting.method |
single character string specifying whether to conduct arithmetic ( |
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 |
wGR.AM
and wGR.GM
are wrapper functions for weighted.GR
.
The first one simply passes all its arguments to weighted.GR
with
weighting.method = "AM"
and wGR.GM
does the same with
weighting.method = "GM"
.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Weighted |
weighted |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$Weights |
the weights for the raw |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Weighting |
character string describing the weighting method. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
kernel
, FDX
, continuous.LR()
,
continuous.GR()
, discrete.LR()
,
discrete.GR()
, discrete.PB()
,
weighted.LR()
, weighted.PB()
# Construction of the p-values and their supports for weighted methods raw.pvalues.weighted <- c(0.7389727, 0.1882310, 0.1302457, 0.9513677, 0.7592122, 0.0100559, 0.0000027, 0.1651034) weights <- c(0.7947122, 1.2633867, 2.8097858, 2.2112801, 2.3878654, 1.2389620, 2.3878654, 0.7947122) # arithmetic-weighted Guo-Romano procedure without critical values wGR.AM.fast <- wGR.AM(raw.pvalues.weighted, weights) summary(wGR.AM.fast) # arithmetic-weighted Guo-Romano procedure with critical values wGR.AM.crit <- wGR.AM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wGR.AM.crit) # geometric-weighted Guo-Romano procedure without critical values wGR.GM.fast <- wGR.GM(raw.pvalues.weighted, weights) summary(wGR.GM.fast) # geometric-weighted Guo-Romano procedure with critical values wGR.GM.crit <- wGR.GM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wGR.GM.crit)
# Construction of the p-values and their supports for weighted methods raw.pvalues.weighted <- c(0.7389727, 0.1882310, 0.1302457, 0.9513677, 0.7592122, 0.0100559, 0.0000027, 0.1651034) weights <- c(0.7947122, 1.2633867, 2.8097858, 2.2112801, 2.3878654, 1.2389620, 2.3878654, 0.7947122) # arithmetic-weighted Guo-Romano procedure without critical values wGR.AM.fast <- wGR.AM(raw.pvalues.weighted, weights) summary(wGR.AM.fast) # arithmetic-weighted Guo-Romano procedure with critical values wGR.AM.crit <- wGR.AM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wGR.AM.crit) # geometric-weighted Guo-Romano procedure without critical values wGR.GM.fast <- wGR.GM(raw.pvalues.weighted, weights) summary(wGR.GM.fast) # geometric-weighted Guo-Romano procedure with critical values wGR.GM.crit <- wGR.GM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wGR.GM.crit)
Apply the weighted [wLR] procedure, with or without computing the critical values, to a set of p-values. Both arithmetic and geometric weighting are available.
weighted.LR( test.results, weights = NULL, alpha = 0.05, zeta = 0.5, weighting.method = c("AM", "GM"), critical.values = FALSE, select.threshold = 1 ) wLR.AM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 ) wLR.GM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 )
weighted.LR( test.results, weights = NULL, alpha = 0.05, zeta = 0.5, weighting.method = c("AM", "GM"), critical.values = FALSE, select.threshold = 1 ) wLR.AM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 ) wLR.GM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, select.threshold = 1 )
test.results |
either a numeric vector with p-values or an R6 object of class |
weights |
numeric vector that contains the weights for the p-values. |
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 |
weighting.method |
single character string specifying whether to conduct arithmetic ( |
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 |
wLR.AM
and wLR.GM
are wrapper functions for weighted.LR
.
The first one simply passes all its arguments to weighted.LR
with
weighting.method = "AM"
and wLR.GM
does the same with
weighting.method = "GM"
.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Weighted |
weighted |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$Weights |
the weights for the raw |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Weighting |
character string describing the weighting method. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
kernel
, FDX
, continuous.LR()
,
continuous.GR()
, discrete.LR()
,
discrete.GR()
, discrete.PB()
,
weighted.GR()
, weighted.PB()
# Construction of the p-values and their supports for weighted methods raw.pvalues.weighted <- c(0.7389727, 0.1882310, 0.1302457, 0.9513677, 0.7592122, 0.0100559, 0.0000027, 0.1651034) weights <- c(0.7947122, 1.2633867, 2.8097858, 2.2112801, 2.3878654, 1.2389620, 2.3878654, 0.7947122) # arithmetic-weighted Lehmann-Romano procedure without critical values wLR.AM.fast <- wLR.AM(raw.pvalues.weighted, weights) summary(wLR.AM.fast) # arithmetic-weighted Lehmann-Romano procedure with critical values wLR.AM.crit <- wLR.AM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wLR.AM.crit) # geometric-weighted Lehmann-Romano procedure without critical values wLR.GM.fast <- wLR.GM(raw.pvalues.weighted, weights) summary(wLR.GM.fast) # geometric-weighted Lehmann-Romano procedure with critical values wLR.GM.crit <- wLR.GM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wLR.GM.crit)
# Construction of the p-values and their supports for weighted methods raw.pvalues.weighted <- c(0.7389727, 0.1882310, 0.1302457, 0.9513677, 0.7592122, 0.0100559, 0.0000027, 0.1651034) weights <- c(0.7947122, 1.2633867, 2.8097858, 2.2112801, 2.3878654, 1.2389620, 2.3878654, 0.7947122) # arithmetic-weighted Lehmann-Romano procedure without critical values wLR.AM.fast <- wLR.AM(raw.pvalues.weighted, weights) summary(wLR.AM.fast) # arithmetic-weighted Lehmann-Romano procedure with critical values wLR.AM.crit <- wLR.AM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wLR.AM.crit) # geometric-weighted Lehmann-Romano procedure without critical values wLR.GM.fast <- wLR.GM(raw.pvalues.weighted, weights) summary(wLR.GM.fast) # geometric-weighted Lehmann-Romano procedure with critical values wLR.GM.crit <- wLR.GM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wLR.GM.crit)
Apply the weighted [wPB] procedure, with or without computing the critical values, to a set of p-values. Both arithmetic and geometric weighting are available. Additionally, the user can choose between exact computation of the Poisson-Binomial distribution or a refined normal approximation.
weighted.PB( test.results, weights = NULL, alpha = 0.05, zeta = 0.5, weighting.method = c("AM", "GM"), critical.values = FALSE, exact = TRUE, select.threshold = 1 ) wPB.AM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1 ) wPB.GM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1 )
weighted.PB( test.results, weights = NULL, alpha = 0.05, zeta = 0.5, weighting.method = c("AM", "GM"), critical.values = FALSE, exact = TRUE, select.threshold = 1 ) wPB.AM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1 ) wPB.GM( test.results, weights, alpha = 0.05, zeta = 0.5, critical.values = FALSE, exact = TRUE, select.threshold = 1 )
test.results |
either a numeric vector with p-values or an R6 object of class |
weights |
numeric vector that contains the weights for the p-values. |
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 |
weighting.method |
single character string specifying whether to conduct arithmetic ( |
critical.values |
single boolean indicating whether critical constants are to be computed. |
exact |
single boolean indicating whether to compute the Poisson-Binomial distribution exactly or by normal approximation. |
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 |
wPB.AM
and wPB.GM
are wrapper functions for weighted.PB
.
The first one simply passes all its arguments to weighted.PB
with
weighting.method = "AM"
and wPB.GM
does the same with
weighting.method = "GM"
.
A FDX
S3 class object whose elements are:
Rejected |
rejected raw |
Indices |
indices of rejected |
Num.rejected |
number of rejections. |
Weighted |
weighted |
Adjusted |
adjusted |
Critical.values |
critical values (only exists if computations where performed with |
Select |
list with data related to |
Select$Threshold |
|
Select$Effective.Thresholds |
results of each |
Select$Pvalues |
selected |
Select$Indices |
indices of |
Select$Scaled |
scaled selected |
Select$Number |
number of selected |
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 |
Data$Weights |
the weights for the raw |
Data$FDP.threshold |
FDP threshold |
Data$Exceedance.probability |
probability |
Data$Weighting |
character string describing the weighting method. |
Data$Data.name |
the respective variable name(s) of the input data. |
Döhler, S. & Roquain, E. (2020). Controlling False Discovery Exceedance for Heterogeneous Tests. Electronic Journal of Statistics, 14(2), pp. 4244-4272. doi:10.1214/20-EJS1771
kernel
, FDX
, continuous.LR()
,
continuous.GR()
, discrete.LR()
,
discrete.GR()
, discrete.PB()
,
weighted.LR()
, weighted.GR()
# Construction of the p-values and their supports for weighted methods raw.pvalues.weighted <- c(0.7389727, 0.1882310, 0.1302457, 0.9513677, 0.7592122, 0.0100559, 0.0000027, 0.1651034) weights <- c(0.7947122, 1.2633867, 2.8097858, 2.2112801, 2.3878654, 1.2389620, 2.3878654, 0.7947122) # arithmetic-weighted Poisson-binomial procedure without critical values wPB.AM.fast <- wPB.AM(raw.pvalues.weighted, weights) summary(wPB.AM.fast) # arithmetic-weighted Poisson-binomial procedure with critical values wPB.AM.crit <- wPB.AM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wPB.AM.crit) # geometric-weighted Poisson-binomial procedure without critical values wPB.GM.fast <- wPB.GM(raw.pvalues.weighted, weights) summary(wPB.GM.fast) # geometric-weighted Poisson-binomial procedure with critical values wPB.GM.crit <- wPB.GM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wPB.GM.crit)
# Construction of the p-values and their supports for weighted methods raw.pvalues.weighted <- c(0.7389727, 0.1882310, 0.1302457, 0.9513677, 0.7592122, 0.0100559, 0.0000027, 0.1651034) weights <- c(0.7947122, 1.2633867, 2.8097858, 2.2112801, 2.3878654, 1.2389620, 2.3878654, 0.7947122) # arithmetic-weighted Poisson-binomial procedure without critical values wPB.AM.fast <- wPB.AM(raw.pvalues.weighted, weights) summary(wPB.AM.fast) # arithmetic-weighted Poisson-binomial procedure with critical values wPB.AM.crit <- wPB.AM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wPB.AM.crit) # geometric-weighted Poisson-binomial procedure without critical values wPB.GM.fast <- wPB.GM(raw.pvalues.weighted, weights) summary(wPB.GM.fast) # geometric-weighted Poisson-binomial procedure with critical values wPB.GM.crit <- wPB.GM(raw.pvalues.weighted, weights, critical.values = TRUE) summary(wPB.GM.crit)