
Sample Size to Select the Best Group in a Binomial Test
Source:R/ss_best_binomial.R
ss_best_binomial.RdComputes the minimum sample size per group required to achieve a target probability
of correctly selecting the best group in a binomial test. The best group is assumed
to have success probability p1, and the other groups have p1 - dif.
Arguments
- power
Numeric. Desired probability of correctly selecting the best group (in [0, 1]).
- p1
Numeric. Probability of success in the best group (in [0, 1]).
- dif
Numeric. Difference in success probability with the next best group (> 0).
- ngroups
Integer. Number of groups (must be > 1).
- max_n
Integer. Maximum sample size to evaluate (default is 1000).
Value
An integer representing the minimum sample size per group required to reach the specified power.
Details
The function searches for the smallest npergroup such that the power from
power_best_binomial is at least the target power.