n.fdr.ttest {FDRsamplesize2} | R Documentation |
Sample size calculation for t-tests
Description
Find the sample size needed to have a desired false discovery rate and average power for a large number of t-tests.
Usage
n.fdr.ttest(
fdr,
pwr,
delta,
sigma = 1,
type = "two.sample",
pi0.hat = "BH",
alternative = "two.sided"
)
Arguments
fdr |
desired FDR (scalar numeric) |
pwr |
desired average power (scalar numeric) |
delta |
difference of population means (vector) |
sigma |
standard deviation (vector or scalar) |
type |
type of t-test |
pi0.hat |
method to estimate proportion |
alternative |
one- or two-sided test |
Value
A list with the following components:
n |
sample size (per group) 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 |
Examples
d = rep(c(2,0),c(100,900));
n.fdr.ttest(fdr = 0.1, pwr = 0.8, delta = d)