Calculates sample size or power for single-stage trials with a binary endpoint according to: Ahern, R. P., Sample size tables for exact single-stage phase II designs. Statistics in medicine 20.6 (2001): 859-866.

OneStageSS(p0, p1, power = 0.8, n = NA, alpha = 0.05, nstart = 1)

Arguments

p0

Proportion of events under H0

p1

Proportion of events under H1

power

Power, default=0.8

n

Sample size, calculated if NA, otherwise power is calculated

alpha

Alpha, default=0.05

nstart

Number of patients to start iterations, default=1, can be increased to save time

Value

List with number of patients with events for a significant trial (r), number of patients (n), alpha and power.

Examples

# Calculate sample size
OneStageSS(p0=0.5,p1=0.6,alpha=0.05,power=0.8)
#> $r
#> [1] 90
#> 
#> $n
#> [1] 158
#> 
#> $alpha
#> [1] 0.04723727
#> 
#> $power
#> [1] 0.8056549
#> 
# Calculate power
OneStageSS(p0=0.5,p1=0.6,alpha=0.05,n=100)
#> Warning: Sample size given, power is calculated
#> $r
#> [1] 59
#> 
#> $n
#> [1] 100
#> 
#> $alpha
#> [1] 0.04431304
#> 
#> $power
#> [1] 0.6225327
#>