p.fdr | R Documentation |
This function computes FDRs and Method Adjusted p-values.
p.fdr( pvalues = NA, zvalues = "two.sided", threshold = 0.05, adjust.method = "BH", BY.corr = "positive", just.fdr = FALSE, default.odds = 1, estim.method = "set.pi0", set.pi0 = 1, hist.breaks = "scott", ties.method = "random", sort.results = FALSE, na.rm = TRUE )
pvalues |
A numeric vector of raw p-values. |
zvalues |
A numeric vector of z-values to be used in pi0 estimation or a string with options "two.sided", "greater" or "less". Defaults to "two.sided". |
threshold |
A numeric value in the interval |
adjust.method |
A string used to identify the p-value and false discovery rate adjustment method. Defaults to |
BY.corr |
A string of either "positive" or "negative" to determine which correlation is used in the BY method. Defaults to |
just.fdr |
A Boolean TRUE or FALSE value which output only the FDR vector instead of the list output. Defaults to FALSE. |
default.odds |
A numeric value determining the ratio of pi1/pi0 used in the computation of one FDR. Defaults to 1. |
estim.method |
A string used to determine which method is used to estimate the null proportion or pi0 value. Defaults to |
set.pi0 |
A numeric value to specify a known or assumed pi0 value in the interval |
hist.breaks |
A numeric or string variable representing how many breaks are used in the pi0 estimation histogram methods. Defaults to "scott". |
ties.method |
A string a character string specifying how ties are treated. Options are "first", "last", "average", "min", "max", or "random". Defaults to "random". |
sort.results |
A Boolean TRUE or FALSE value which sorts the output in either increasing or non-increasing order dependent on the FDR vector. Defaults to FALSE. |
na.rm |
A Boolean TRUE or FALSE value indicating whether NA's should be removed from the inputted raw p-value vector before further computation. Defaults to TRUE. |
We run into errors or warnings when pvalues, zvalues, threshold, set.pi0, BY.corr, or default.odds are not inputted correctly.
A list containing the following components:
fdrs |
A numeric vector of method adjusted FDRs. |
Results Matrix |
A numeric matrix of method adjusted FDRs, method adjusted p-values, and raw p-values. |
Reject Vector |
A vector containing Reject.H0 and/or FTR.H0 based off of the threshold value and hypothesis test on the adjusted p-values. |
pi0 |
A numeric value for the pi0 value used in the computations. |
threshold |
A numeric value for the threshold value used in the hypothesis tests. |
Adjustment Method |
The string with the method name used in computation(needed for the plot.fdr function). |
Rpack:bibtexRdpack
\insertRefRFDRestimation
\insertRefefron:2013FDRestimation
\insertRefbh:1995FDRestimation
\insertRefshaffer:1995FDRestimation
\insertRefstorey:2003FDRestimation
\insertRefby:2001FDRestimation
\insertRefmein:2006FDRestimation
\insertRefjiang:2008FDRestimation
\insertRefnett:2006FDRestimation
\insertRefpounds:2003FDRestimation
\insertRefholm:1979FDRestimation
\insertRefbon:1936FDRestimation
\insertRefhoch:1988FDRestimation
\insertRefsidak:1967FDRestimation
\insertRefmurray2020falseFDRestimation
plot.p.fdr, summary.p.fdr, get.pi0
# Example 1 pi0 = 0.8 pi1 = 1-pi0 n = 10000 n.0 = ceiling(n*pi0) n.1 = n-n.0 sim.data = c(rnorm(n.1,3,1),rnorm(n.0,0,1)) sim.data.p = 2*pnorm(-abs(sim.data)) fdr.output = p.fdr(pvalues=sim.data.p, adjust.method="BH") fdr.output$fdrs fdr.output$pi0 # Example 2 sim.data.p = output = c(runif(800),runif(200, min=0, max=0.01)) fdr.output = p.fdr(pvalues=sim.data.p, adjust.method="Holm", sort.results = TRUE) fdr.output$`Results Matrix`
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.