fleming1stage.RdTherapeutic efficacy in clinical trials is often evaluated principally on the basis of the probability p that
an eligible patient receiving the treatment regimen will experience a regression (like a tumor e.g.).
This function calculates sample sizes of the Fleming single-stage design, for \(p_0 < p_a\) for the requested Type I (alpha) and Type II error (beta).
fleming1stage(p0, pa, alpha = 0.05, beta = 0.2, eps = 0.005, CI_type = "exact")| p0 | probability of the uninteresting response (null hypothesis H0) |
|---|---|
| pa | probability of the interesting response (alternative hypothesis Ha) |
| alpha | Type I error rate \(P(reject H0|H0)\) |
| beta | Type II error rate \(P(reject Ha|Ha)\) |
| eps | tolerance default value = 0.005 |
| CI_type | any type for binom.confint |
a data.frame with elements
n: total number of patients
r: quantile function of 1 - (alpha + eps) at n under p0. Note if n <= r --> futility
eff: r/N
CI_LL: exact 1-2*alpha confidence interval lower limit
CI_UL: exact 1-2*alpha confidence interval upper limit
alpha: the actual alpha value which is smaller than alpha_param + eps
beta: the actual beta value where which is smaller than beta_param + eps
p0: your provided p0 value
pa: your provided pa value
alpha_param: your provided alpha value
beta_param: your provided beta value
Fleming TR. One-sample multiple testing procedure for phase II clinical trials. Biometrics. 1982;38(1):143-151.
fleming1stage(p0 = 0.45, pa = 0.7, alpha = 0.05, beta = 0.2)
#> design_nr N r eff 90%CI_LL 90%CI_UL alpha beta p0 pa
#> 1 1 25 15 16/25 (64%) 45.61 79.76 0.0439597 0.189436 0.45 0.7
#> alpha_param beta_param
#> 1 0.05 0.2
fleming1stage(p0 = 0.1, pa = 0.3, alpha = 0.05, beta = 0.1, eps = 0.005)
#> design_nr N r eff 90%CI_LL 90%CI_UL alpha beta p0 pa
#> 1 1 33 6 7/33 (21.2%) 10.4 36.18 0.04170385 0.0944455 0.1 0.3
#> alpha_param beta_param
#> 1 0.05 0.1
fleming1stage(p0 = 0.1, pa = 0.3, alpha = 0.05, beta = 0.1, eps = 0.00001)
#> design_nr N r eff 90%CI_LL 90%CI_UL alpha beta p0 pa
#> 1 1 33 6 7/33 (21.2%) 10.4 36.18 0.04170385 0.0944455 0.1 0.3
#> alpha_param beta_param
#> 1 0.05 0.1
## For several combinations of p0 and pa
## not it is important that p0 is not equal to pa
test <- expand.grid(p0 = seq(0, 0.95, by = 0.05),
pa = seq(0, 0.95, by = 0.05))
test <- subset(test, (pa - p0) > 0.00001)
samplesize <- fleming1stage(p0 = test$p0, pa = test$pa, alpha = 0.05, beta = 0.2, eps = 0.0005)
samplesize <- fleming1stage(p0 = test$p0, pa = test$pa, alpha = 0.05, beta = 0.1, eps = 0.0005)
samplesize <- fleming1stage(p0 = test$p0, pa = test$pa, alpha = 0.01, beta = 0.2, eps = 0.0005)
samplesize <- fleming1stage(p0 = test$p0, pa = test$pa, alpha = 0.01, beta = 0.1, eps = 0.0005)
## these 2 are the same
samplesize <- fleming1stage(p0 = test$p0, pa = test$pa, alpha = 0.05, beta = 0.2)
samplesize <- mapply(p0 = test$p0, pa = test$pa, FUN=function(p0, pa){
fleming1stage(p0 = p0, pa = pa, alpha = 0.05, beta = 0.2)
}, SIMPLIFY = FALSE)
samplesize <- do.call(rbind, samplesize)