Description Usage Arguments Value References Examples
View source: R/fleming1stage.R
Therapeutic 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).
1 | 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | fleming1stage(p0 = 0.45, pa = 0.7, alpha = 0.05, beta = 0.2)
fleming1stage(p0 = 0.1, pa = 0.3, alpha = 0.05, beta = 0.1, eps = 0.005)
fleming1stage(p0 = 0.1, pa = 0.3, alpha = 0.05, beta = 0.1, eps = 0.00001)
## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.