sampleSizeBin {miniMeta} | R Documentation |
Sample size calculator for binary outcomes
Description
Calculates sample size for a trial with a binomial outcome, for a given power and false positive rate.
Usage
sampleSizeBin(cer, RRR = 25, ier = NULL, a = 0.05, b = 0.2, K = 1)
Arguments
cer |
Control group event rate, a value between 0 and 1. All should be named. |
RRR |
Relative Risk Reduction (%) in the intervention group. |
ier |
Intervention group event rate, a value between 0 and 1
If |
a |
False positive rate (alpha). Defaults to 0.05 (5%). |
b |
False negative rate (beta). Defaults to 0.2. Power is one minus beta; thus the default is 80% power. |
K |
Ratio of intervention group size to control group size.
Defaults to 1, meaning both groups have the same size.
Set to infinity ( |
Value
An integer vector of length 2, with the sample sizes for the control and intervention groups.
If K=Inf
, then the sample size calculation is not for a study
with two groups, but for a single-group study in which a fixed known
population event rate is assumed. In that case, argument cer
represents the population event rate, and ier
the study event
rate that it we anticipate. And the return value is a single value,
i.e. the sample size of the study.
Examples
# Sample size for a trial with 40\% control event rate and 1:1 randomization,
# aiming to show a Relative Risk Reduction of 30\% with 80\% power.
sampleSizeBin(0.4, RRR=30)
# Sample size for a single-group study aiming to show an event rate of 20\%
# against a population event rate of 10\%, with 90\% power.
sampleSizeBin(0.1, ier=0.2, b=0.1, K=Inf)