library(gsDesign)
Manual
gsDesign(k=3, test.type=4, alpha=0.025, beta=0.1, astar=0,
delta=0, n.fix=1, timing=1, sfu=sfHSD, sfupar=-4,
sfl=sfHSD, sflpar=-2, tol=0.000001, r=18, n.I = 0,
maxn.IPlan = 0, nFixSurv=0, endpoint=NULL, delta1=1, delta0=0)
test.type:‘1=’one-sided
‘2=’two-sided symmetric
‘3=’two-sided, asymmetric, beta-spending with binding lower
bound
‘4=’two-sided, asymmetric, beta-spending with non-binding
lower bound
‘5=’two-sided, asymmetric, lower bound spending under the
null hypothesis with binding lower bound
‘6=’two-sided, asymmetric, lower bound spending under the
null hypothesis with non-binding lower bound.
See details, examples and manual.
alpha: Type I error, always one-sided. Default value is 0.025.
sfu: A spending function or a character string indicating a
boundary type (that is, “WT” for Wang-Tsiatis bounds, “OF”
for O'Brien-Fleming bounds and “Pocock” for Pocock bounds).
For one-sided and symmetric two-sided testing is used to
completely specify spending (‘test.type=1, 2’), ‘sfu’. The
default value is ‘sfHSD’ which is a Hwang-Shih-DeCani
spending function. See details, Spending function overview,
manual and examples.
Four interim analyses and 1 final analysis, equally spaced.
K = 5, one-sided alpha = 0.025 (equivalent of 0.05 two-sided)
Pocock
pocock <- gsDesign(k = 5, test.type = 2, alpha = 0.025, sfu = "Pocock")
pocock
Symmetric two-sided group sequential design with
90 % power and 2.5 % Type I Error.
Spending computations assume trial stops
if a bound is crossed.
Sample
Size
Analysis Ratio* Z Nominal p Spend
1 0.241 2.41 0.0079 0.0079
2 0.483 2.41 0.0079 0.0059
3 0.724 2.41 0.0079 0.0045
4 0.965 2.41 0.0079 0.0037
5 1.207 2.41 0.0079 0.0031
Total 0.0250
++ alpha spending:
Pocock boundary
* Sample size ratio compared to fixed design with no interim
Boundary crossing probabilities and expected sample size
assume any cross stops the trial
Upper boundary (power or Type I Error)
Analysis
Theta 1 2 3 4 5 Total E{N}
0.000 0.0079 0.0059 0.0045 0.0037 0.0031 0.025 1.1767
3.241 0.2059 0.2603 0.2086 0.1402 0.0851 0.900 0.6849
Lower boundary (futility or Type II Error)
Analysis
Theta 1 2 3 4 5 Total
0.000 0.0079 0.0059 0.0045 0.0037 0.0031 0.025
3.241 0.0000 0.0000 0.0000 0.0000 0.0000 0.000
plot(pocock) + scale_x_continuous(limit = c(0,1.2), breaks = seq(0,1,0.2))
O'Brien-Fleming
obf <- gsDesign(k = 5, test.type = 2, alpha = 0.025, sfu = "OF")
obf
Symmetric two-sided group sequential design with
90 % power and 2.5 % Type I Error.
Spending computations assume trial stops
if a bound is crossed.
Sample
Size
Analysis Ratio* Z Nominal p Spend
1 0.205 4.56 0.0000 0.0000
2 0.411 3.23 0.0006 0.0006
3 0.616 2.63 0.0042 0.0038
4 0.821 2.28 0.0113 0.0083
5 1.026 2.04 0.0207 0.0122
Total 0.0250
++ alpha spending:
O'Brien-Fleming boundary
* Sample size ratio compared to fixed design with no interim
Boundary crossing probabilities and expected sample size
assume any cross stops the trial
Upper boundary (power or Type I Error)
Analysis
Theta 1 2 3 4 5 Total E{N}
0.000 0.000 0.0006 0.0038 0.0083 0.0122 0.025 1.0191
3.241 0.001 0.1244 0.3421 0.2840 0.1484 0.900 0.7503
Lower boundary (futility or Type II Error)
Analysis
Theta 1 2 3 4 5 Total
0.000 0 0.0006 0.0038 0.0083 0.0122 0.025
3.241 0 0.0000 0.0000 0.0000 0.0000 0.000
plot(obf) + scale_x_continuous(limit = c(0,1.2), breaks = seq(0,1,0.2))
O'Brien-Fleming boundary with various K's and one-sided alpha = 0.025 '
gsDesign(k = 5, test.type = 1, alpha = 0.025, sfu = "OF")$upper$bound
[1] 4.562 3.226 2.634 2.281 2.040
obf.result <- lapply(1:10, function(X) gsDesign(k = X, test.type = 1, alpha = 0.025, sfu = "OF")$upper$bound)
obf.result
[[1]]
[1] 1.96
[[2]]
[1] 2.797 1.977
[[3]]
[1] 3.471 2.454 2.004
[[4]]
[1] 4.049 2.863 2.337 2.024
[[5]]
[1] 4.562 3.226 2.634 2.281 2.040
[[6]]
[1] 5.028 3.556 2.903 2.514 2.249 2.053
[[7]]
[1] 5.459 3.860 3.152 2.730 2.441 2.229 2.063
[[8]]
[1] 5.861 4.144 3.384 2.931 2.621 2.393 2.215 2.072
[[9]]
[1] 6.240 4.412 3.602 3.120 2.790 2.547 2.358 2.206 2.080
[[10]]
[1] 6.598 4.666 3.809 3.299 2.951 2.694 2.494 2.333 2.199 2.087
In the group sequential method demonstrated above the number of interim analysis must be pre-determined. Use of alpha spending functions can accomodate the unequal numbers of participants or event between analyses and the possibility of larger or fewer numbers of interim analyses than pre-specified (page 319, Fundamentals of Clinical Trials). A alpha spending function guarantees that at the end of the trial, the overall type I error will be the prespecified value.
O'Brien-Fleming
For the 4th interim analysis, the difference between the 4th Y value and 3rd Y value is allocated.
information.fractions <- c(0.05, 0.12, 0.5, 0.9, 1)
res.sfLDOF <- sfLDOF(alpha = 0.025, t = information.fractions)
round(res.sfLDOF$spend, 5)
[1] 0.00000 0.00000 0.00153 0.01814 0.02500
plot(x = information.fractions, y = res.sfLDOF$spend)