Title: | Multiple Testing Approach using Average Power Function (APF) and Bayes FDR Robust Estimation |
---|---|
Description: | Implements a multiple testing approach to the choice of a threshold gamma on the p-values using the Average Power Function (APF) and Bayes False Discovery Rate (FDR) robust estimation. Function apf_fdr() estimates both quantities from either raw data or p-values. Function apf_plot() produces smooth graphs and tables of the relevant results. Details of the methods can be found in Quatto P, Margaritella N, et al. (2019) <doi:10.1177/0962280219844288>. |
Authors: | Nicolò Margaritella [cre, aut], Piero Quatto [aut] |
Maintainer: | Nicolò Margaritella <[email protected]> |
License: | GPL-3 |
Version: | 1.0.2 |
Built: | 2024-11-13 03:11:58 UTC |
Source: | https://github.com/cran/APFr |
apf_fdr
returns robust estimates of the Average Power Function (APF)
and Bayes False Discovery Rate (FDR) for each value of the threshold Gamma
on the p-value and Tau on the correlation coefficient.
apf_fdr(data, type = "datf", corr = "spearman", lobs = 0, seed = 111, gamm = c(1e-04, 0.1, 0.002))
apf_fdr(data, type = "datf", corr = "spearman", lobs = 0, seed = 111, gamm = c(1e-04, 0.1, 0.002))
data |
Either a vector, matrix or dataframe. |
type |
Set |
corr |
The type of correlation to use when |
lobs |
When |
seed |
A seed (natural number) for the resampling. |
gamm |
The threshold gamma on the p-values to explore (typically |
A list with four elements. A vector APF_gamma
containing the robust
estimates of APF (5th quantiles) for all the gamma values set in gamm
. A vector
FDR_gamma
with the robust estimates of Bayes FDR (95th quantiles). A
vector tau_gamma
with the correlation coefficients tau for each gamma
value explored and another vector with the relative values gamma (gammaval
).
Quatto, P, Margaritella, N, et al. Brain networks construction using Bayes FDR and average power function. Stat Methods Med Res. Published online May 14th, 2019; DOI:10.1177/0962280219844288.
data("Ex1") APF_lst <- apf_fdr(Ex1,"pvl",lobs=100) # The example uses the dataset Ex1 (in the APFr package) which is # a vector of 100 p-values. The number of datapoints used to # compute each p-value in this example is set to 100. As a result, # a list of 4 objects is returned.
data("Ex1") APF_lst <- apf_fdr(Ex1,"pvl",lobs=100) # The example uses the dataset Ex1 (in the APFr package) which is # a vector of 100 p-values. The number of datapoints used to # compute each p-value in this example is set to 100. As a result, # a list of 4 objects is returned.
apf_plot
returns a graph with Average Power Function (APF),
Bayes False Discovery Rate (FDR) and APF vs. FDR. In addition, when
tab = TRUE
, a table containing APF, FDR, tau and gamma values
for a selected subset of APF and FDR is printed.
apf_plot(APF_lst, tab = TRUE, APF_inf = 0.5, FDR_sup = 0.05)
apf_plot(APF_lst, tab = TRUE, APF_inf = 0.5, FDR_sup = 0.05)
APF_lst |
The output from the |
tab |
If |
APF_inf |
Sets the minimum value of APF to appear in the table
when |
FDR_sup |
Sets the maximum value of Bayes FDR to appear in the
table when |
Smooth graphs for APF vs Gamma (left), FDR vs Gamma (centre)
and APF vs FDR (right). Regions where FDR
FDR_sup
and
APF
APF_inf
(if presents) are highlighted in yellow
and printed in a table (if tab = TRUE
) together with the relative
values of gamma and tau.
Quatto, P, Margaritella, N, et al. Brain networks construction using Bayes FDR and average power function. Stat Methods Med Res. Published online May 14th, 2019; DOI:10.1177/0962280219844288.
data("Ex2") apf_plot(Ex2) # Ex2 is an example of output obtained # from the apf_fdr() function.
data("Ex2") apf_plot(Ex2) # Ex2 is an example of output obtained # from the apf_fdr() function.
A dataset containing 100 simulated p-values, 70 from a N(2,1) and 30 from a N(0,1).
Ex1
Ex1
A vector containing 100 p-values.
Quatto, P, Margaritella, N, et al. Brain networks construction using Bayes FDR and average power function. Stat Methods Med Res. Published online May 14th, 2019; DOI:10.1177/0962280219844288.
data(Ex1)
data(Ex1)
A list containing 4 vectors. This is an example of output obtained with apf_fdr()
to use with apf_plot()
.
Ex2
Ex2
A list containing 4 vectors called APF_gamma, FDR_gamma,
tau_gamma, gammaval
.
Quatto, P, Margaritella, N, et al. Brain networks construction using Bayes FDR and average power function. Stat Methods Med Res. Published online May 14th, 2019; DOI:10.1177/0962280219844288.
data(Ex2)
data(Ex2)