clfdr: Conditional Local False Discovery Rate

Description Usage Arguments Details Value Author(s) References Examples

Description

An implementaiton of the conditional local false discovery rate procedure of Cai and Sun (2009). This is a near copy of the implementation provided in the IHWpaper package, clfdr at the corresponding GitHub repo, written by Nikos Ignatiadis and made available under the GPL-3 license.

The original code has been modified to only return a vector of adjusted p-values and check the input of the lfdr_estimation= parameter.

Usage

1
clfdr(p, groups, lfdr_estimation = c("fdrtool", "locfdr"))

Arguments

p

numeric vector of unadjusted p-values.

groups

factor to which different hypotheses belong.

lfdr_estimation

method used to estimate the local fdr; must be one of "fdrtool" or "locfdr". (default = "fdrtool")

Details

If the covariate or variable for stratifying p-values is continuous, it should be converted into a discrete set of "groups" before applying this function. This can be accomplished by passing the continuous variable to IHW::groups_by_filter, ggplot2::cut_number, or any similar function. See examples for uses of these functions.

Value

Numeric vector of adjusted p-values of equal length and order as the to input vector of p-values.

Author(s)

Patrick Kimes

References

Reference for the conditional local false discovery rate (underlying theory):

Cai, T.T., Sun, W. (2009) Simultaneous testing of grouped hypotheses: Finding needles in multiple haystacks. Journal of the American Statistical Association, 104(488):1467-1481. https://doi.org/10.1198/jasa.2009.tm08415

Reference for the original implementation (underlying code):

Ignatiadis, N. (2017) IHWpaper: Reproduce figures in IHW paper. R package version 1.7.0. https://doi.org/doi:10.18129/B9.bioc.IHWpaper

Examples

1
2
3
4
5
6
7
8
9
## generate example p-values and covariate values
pv <- runif(100)
x <- sample(100)

## discretize 'x' into 10 bins
xd <- IHW::groups_by_filter(xd, nbins = 10)

## adjust p-values, grouping by covariate bin
adjpv <- clfdr(p = pv, groups = xd)

pkimes/otherfdr documentation built on May 6, 2019, 11:44 a.m.