Learn R Programming

sommer (version 2.1)

fdr: False Discovery Rate calculation

Description

This function calculates the false discovery rate (FDR) at a certain value specified by the user. Is a wrapper of the p.adjust function from the stats package. It has been adjusted to facilitate the user to find the FDR value for a vector of values in scale minus log10. It is used internally of the mmer function when the argument W is used to perform GWAS.

Usage

fdr(p, fdr.level = 0.05)

Arguments

p
a vector of minus log(p values)
fdr.level
the level of false discovery rate desired

Value

References

Benjamini, Y., and Yekutieli, D. 2001. The control of the false discovery rate in multiple testing under dependency. Annals of Statistics 29, 1165-1188.

Covarrubias-Pazaran G (2016) Genome assisted prediction of quantitative traits using the R package sommer. PLoS ONE 11(6): doi:10.1371/journal.pone.0156744

See Also

The core function of the package mmer

Examples

Run this code
####=========================================####
#### generate your mickey mouse -log10(p-values)
####=========================================####
set.seed(1253)
pp <- abs(rnorm(500,0,3));pp[23:34] <- abs(rnorm(12,0,20))

####=========================================####
#### see how they look like
####=========================================####
plot(pp, col=transp("cadetblue"), pch=20, cex=1.5)

####=========================================####
#### adjust the values for FDR and see how they look like
####=========================================####
new.pp <- fdr(pp)
plot(new.pp$p.ad, col=transp("cadetblue"), pch=20, cex=1.5)

####=========================================####
#### or you may want to plot your original values 
#### with the FDR line instead
####=========================================####
plot(pp, col=transp("cadetblue"), pch=20, cex=1.5)
abline(h=new.pp$fdr.10, lty=3, col="red", lwd=2)

Run the code above in your browser using DataLab