n_poisson.Rd
Estimation of required sample size as given by Cundill & Alexander (2015).
n_poisson(
mean0,
effect,
alpha = 0.05,
power = 0.9,
q = 0.5,
link = c("log", "identity"),
two_sided = TRUE
)
Mean in control group
Effect size, \(1 - (\mu_1 / \mu_0)\), where
\(\mu_0\) is the mean in the control group (mean0
) and
\(\mu_1\) is the mean in the treatment group.
Type I error rate
1 - Type II error rate
Proportion of observations allocated to the control group
Link function to use. Currently implement: 'log' and 'identity'
logical, if TRUE
the sample size
will be calculated for a two-sided test. Otherwise, the sample
size will be calculated for a one-sided test.
Returns an object of class "sample_size"
. It contains
the following components:
the total sample size
sample size in Group 0 (control group)
sample size in Group 1 (treatment group)
logical, TRUE
, if the estimated sample size
refers to a two-sided test
type I error rate used in sample size estimation
target power used in sample size estimation
effect size used in sample size estimation
short description of the type of effect size
additional comment, if there is any
the matched call.
Cundill, B., & Alexander, N. D. E. (2015). Sample size calculations for skewed distributions. BMC Medical Research Methodology, 15(1), 1–9. https://doi.org/10.1186/s12874-015-0023-0
n_poisson(mean0 = 5, effect = 0.3)
#> Estimated sample size for group difference.
#> Generalized Regression, Poisson Distribution, link: log
#>
#> N (total) 80.23
#> n0 (Group 0) 40.12
#> n1 (Group 1) 40.12
#>
#> Effect size 0.3
#> Effect type 1 - (mean1/mean0)
#> Type I error 0.05
#> Target power 0.9
#> Two-sided TRUE
#>
#> Call: n_poisson(mean0 = 5, effect = 0.3)