n.fdr.negbin {FDRsamplesize2}R Documentation

Sample size calculation for Negative Binomial data

Description

Find the sample size needed to have a desired false discovery rate and average power for a large number of Negative Binomial comparisons.

Usage

n.fdr.negbin(fdr, pwr, log.fc, mu, sig, pi0.hat = "BH")

Arguments

fdr

desired FDR (scalar numeric)

pwr

desired average power (scalar numeric)

log.fc

log fold-change (vector), usual null hypothesis is log.fc=0

mu

read depth per gene (vector, same length as log.fc)

sig

coefficient of variation (CV) per gene (vector, same length as log.fc)

pi0.hat

method to estimate proportion pi0 of tests with true null, including: "HH" (p-value histogram height), "HM" (p-value histogram mean), "BH" (Benjamini & Hochberg 1995), "Jung" (Jung 2005)

Value

A list with the following components:

n

per-group sample size estimate

computed.avepow

average power

desired.avepow

desired average power

desired.fdr

desired FDR

input.pi0

proportion of tests with a true null hypothesis

alpha

fixed p-value threshold for multiple testing procedure

n.its

number of iteration

max.its

maximum number of iteration, default is 50

n0

lower limit for initial sample size range

n1

upper limit for initial sample size range

Note

For the test with power calculation based on asymptotic normal approximation, we suggest checking FDRsamplesize2 calculation by simulation.

References

SN Hart, TM Therneau, Y Zhang, GA Poland, and J-P Kocher (2013). Calculating Sample Size Estimates for RNA Sequencing Data. Journal of Computational Biology 20: 970-978.

Examples

logFC = log(rep(c(1,2),c(900,100)));
mu = rep(5,1000);
sig = rep(0.6,1000);
n.fdr.negbin(fdr = 0.1, pwr = 0.8, log.fc = logFC, mu = mu, sig = sig, pi0.hat = "BH")

[Package FDRsamplesize2 version 0.2.0 Index]