fleming1stage: The Fleming 1-stage function

Description Usage Arguments Value References Examples

View source: R/fleming1stage.R

Description

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).

Usage

1
fleming1stage(p0, pa, alpha = 0.05, beta = 0.2, eps = 0.005, CI_type = "exact")

Arguments

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

Value

a data.frame with elements

References

Fleming TR. One-sample multiple testing procedure for phase II clinical trials. Biometrics. 1982;38(1):143-151.

Examples

 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)

IDDI-BE/PhIIdesign documentation built on June 5, 2021, 2:03 p.m.