Type: | Package |
Title: | Multiple Testing Approach using Average Power Function (APF) and Bayes FDR Robust Estimation |
Version: | 1.0.2 |
Date: | 2019-06-14 |
Author: | Nicolò Margaritella [cre, aut], Piero Quatto [aut] |
Maintainer: | Nicolò Margaritella <N.Margaritella@sms.ed.ac.uk> |
Depends: | R (≥ 3.5.0) |
Imports: | stats (≥ 3.5.2), graphics (≥ 3.5.2) |
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>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.1 |
NeedsCompilation: | no |
Packaged: | 2019-06-17 07:49:35 UTC; Nico |
Repository: | CRAN |
Date/Publication: | 2019-06-18 12:20:07 UTC |
Implementation of APF and FDR robust estimation
Description
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.
Usage
apf_fdr(data, type = "datf", corr = "spearman", lobs = 0,
seed = 111, gamm = c(1e-04, 0.1, 0.002))
Arguments
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 |
Value
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
).
References
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.
Examples
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.
Generate smooth graphs for the APF and FDR estimates
Description
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.
Usage
apf_plot(APF_lst, tab = TRUE, APF_inf = 0.5, FDR_sup = 0.05)
Arguments
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 |
Value
Smooth graphs for APF vs Gamma (left), FDR vs Gamma (centre)
and APF vs FDR (right). Regions where FDR \le
FDR_sup
and
APF \ge
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.
References
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.
Examples
data("Ex2")
apf_plot(Ex2)
# Ex2 is an example of output obtained
# from the apf_fdr() function.
Example dataset 1
Description
A dataset containing 100 simulated p-values, 70 from a N(2,1) and 30 from a N(0,1).
Usage
Ex1
Format
A vector containing 100 p-values.
References
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.
Examples
data(Ex1)
Example 2
Description
A list containing 4 vectors. This is an example of output obtained with apf_fdr()
to use with apf_plot()
.
Usage
Ex2
Format
A list containing 4 vectors called APF_gamma, FDR_gamma,
tau_gamma, gammaval
.
References
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.
Examples
data(Ex2)