cloglog.sample.size.RdPower and sample size for a binomial proportion using the cloglog parameterization.
cloglog.sample.size(p.alt, n = NULL, p = 0.5, power = 0.8, alpha = 0.05,
alternative = c("two.sided", "greater", "less"), exact.n = FALSE,
recompute.power = FALSE, phi = 1)The alternative proportion in a one-sample test.
The sample size in a one-sample test.
The null proportion in a one-sample test. Default is 0.5.
The desired power level. Default is 0.80.
The desired alpha level - probability of a Type I error. Default is 0.05.
Nature of alternative hypothesis. One of "two.sided", "greater", "less".
logical; If TRUE, the computed sample size will
not be rounded up. Default is FALSE.
logical; If TRUE, after the sample size
is computed, the power will be recomputed. This is only advantageous
when the sample size is rounded up. Default is FALSE.
Dispersion parameter by which to inflate (phi > 1) or
deflate (phi < 1) variance. Default is 1.
This function can be used to calculate sample size, power or minimum
detectable difference. It determines what to compute base on the
arguments provided. If p.alt is given, but n is not, then
sample size is computed. If p.alt is given along with n,
then the power is computed. If only n is provided, the minimum
detectable difference is computed using the default power of 0.80.
A data.frame containing the power, sample size and all of the
input which was used to perform the computations.
cloglog.sample.size(p.alt = 0.8)
#> p.null p.alt delta alpha power n phi
#> 1 0.5 0.8 0.3 0.05 0.8 18 1
cloglog.sample.size(n = 20)
#> p.null p.alt delta alpha power n phi
#> 1 0.5 0.7819064 0.2819064 0.05 0.8 20 1
cloglog.sample.size(n = 20, power = 0.9)
#> p.null p.alt delta alpha power n phi
#> 1 0.5 0.8331336 0.3331336 0.05 0.9 20 1