Learn R Programming

FDRsamplesize2 (version 0.2.0)

n.fdr.fisher: Sample size calculation for Fisher's Exact tests

Description

Find the sample size needed to have a desired false discovery rate and average power for a large number of Fisher's exact tests.

Usage

n.fdr.fisher(fdr, pwr, p1, p2, alternative = "two.sided", pi0.hat = "BH")

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

Arguments

fdr

desired FDR (scalar numeric)

pwr

desired average power (scalar numeric)

p1

probability in one group (vector)

p2

probability in other group (vector)

alternative

one- or two-sided test

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)

Examples

Run this code
set.seed(1234);
p1 = sample(seq(0,0.5,0.1),10,replace = TRUE);
p2 = sample(seq(0.5,1,0.1),10,replace = TRUE);
n.fdr.fisher(fdr = 0.1, pwr = 0.8, p1 = p1, p2 = p2, alternative = "two.sided", pi0.hat = "BH")

Run the code above in your browser using DataLab