binary_cfdr: Perform cFDR leveraging binary auxiliary covariates

Description Usage Arguments Value Examples

View source: R/binary_cfdr.R

Description

Perform cFDR leveraging binary auxiliary covariates

Usage

1

Arguments

p

p-values for principal trait (vector of length n)

q

binary auxiliary data values (vector of length n)

group

group membership of each SNP for leave-one-out procedure (vector of length n) (e.g. chromosome number or LD block)

Value

data.frame of p, q and v values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# In this example, we generate some p-values (representing GWAS p-values)
# and some arbitrary auxiliary data values (e.g. representing functional genomic data).
# We use the parameters_in_locfdr() function to extract the parameters estimated by
# the locfdr function.

# generate p
set.seed(2)
n <- 1000
n1p <- 50 
zp <- c(rnorm(n1p, sd=5), rnorm(n-n1p, sd=1))
p <- 2*pnorm(-abs(zp))

# generate q
q <- rbinom(n, 1, 0.1)

group <- c(rep("A", n/2), rep("B", n/2)) 

binary_cfdr(p, q, group)

annahutch/fcfdr documentation built on Feb. 12, 2022, 6:49 a.m.