find.sample.size | R Documentation |
Determines the sample size needed to achieve the desired FDR and average power by given the proportion of true null hypothesis.
find.sample.size(alpha, pwr, avepow.func, n0 = 3, n1 = 6, max.its = 50, ...)
alpha |
the fixed p-value threshold (scalar numeric) |
pwr |
desired average power (scalar numeric) |
avepow.func |
an R function to compute average power |
n0 |
lower limit for initial sample size range |
n1 |
upper limit for initial sample size range |
max.its |
maximum number of iterations |
... |
additional arguments to average power function |
A list with the following components:
n |
a sample size estimate |
computed.avepow |
average power |
desired.avepow |
desired average power |
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 |
For the test with power calculation based on asymptotic normal approximation, we suggest checking FDRsamplesize2
calculation by simulation.
#Here, calculating the sample size for the study involving many sign tests
average.power.signtest;
p.adj = 0.001;
p = rep(c(0.8,0.5), c(100,9900));
find.sample.size(alpha = p.adj, pwr = 0.8, avepow.func = average.power.signtest, p = p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.