gsDesign()
is used to find boundaries and trial size required for a group sequential design.
1 2 3 4 
k 
Number of analyses planned, including interim and final. 
test.type 

alpha 
Type I error, always onesided. Default value is 0.025. 
beta 
Type II error, default value is 0.1 (90% power). 
astar 
Normally not specified. If 
delta 
Effect size for theta under alternative hypothesis. This can be set to the standardized effect size to generate a sample size if 
n.fix 
Sample size for fixed design with no interim; used to find maximum group sequential sample size. For a timetoevent outcome, input number of events required for a fixed design rather than sample size
and enter fixed design sample size (optional) in 
timing 
Sets relative timing of interim analyses. Default of 1 produces equally spaced analyses.
Otherwise, this is a vector of length 
sfu 
A spending function or a character string indicating a boundary type (that is, “WT” for WangTsiatis bounds, “OF” for O'BrienFleming bounds and “Pocock” for Pocock bounds).
For onesided and symmetric twosided testing is used to completely specify spending ( 
sfupar 
Real value, default is 4 which is an O'BrienFleminglike conservative bound when used with the default HwangShihDeCani spending function. This is a realvector for many spending functions.
The parameter 
sfl 
Specifies the spending function for lower boundary crossing probabilities when asymmetric, twosided testing is performed ( 
sflpar 
Real value, default is 2, which, with the default HwangShihDeCani spending function, specifies a less conservative spending rate than the default for the upper bound. 
tol 
Tolerance for error (default is 0.000001). Normally this will not be changed by the user. This does not translate directly to number of digits of accuracy, so use extra decimal places. 
r 
Integer value controlling grid for numerical integration as in Jennison and Turnbull (2000);
default is 18, range is 1 to 80.
Larger values provide larger number of grid points and greater accuracy.
Normally 
n.I 
Used for resetting bounds when timing of analyses changes from initial design; see examples. 
maxn.IPlan 
Used for resetting bounds when timing of analyses changes from initial design; see examples. 
nFixSurv 
If a timetoevent variable is used, 
endpoint 
An optional character string that should represent the type of endpoint used for the study. This may be used by output functions. Types most likely to be recognized initially are "TTE" for timetoevent outcomes with fixed design sample size generated by 
delta1 

delta0 

overrun 
Scalar or vector of length 
Many parameters normally take on default values and thus do not require explicit specification.
One and twosided designs are supported. Twosided designs may be symmetric or asymmetric.
WangTsiatis designs, including O'BrienFleming and Pocock designs can be generated.
Designs with common spending functions as well as other builtin and userspecified functions for Type I error and
futility are supported.
Type I error computations for asymmetric designs may assume binding or nonbinding lower bounds.
The print function has been extended using print.gsDesign()
to print gsDesign
objects; see examples.
The user may ignore the structure of the value returned by gsDesign()
if the standard
printing and plotting suffice; see examples.
delta
and n.fix
are used together to determine what sample size output options the user seeks.
The default, delta=0
and n.fix=1
, results in a ‘generic’ design that may be used with any sampling
situation. Sample size ratios are provided and the user multiplies these times the sample size for a fixed design
to obtain the corresponding group sequential analysis times. If delta>0
, n.fix
is ignored, and
delta
is taken as the standardized effect size  the signal to noise ratio for a single observation;
for example, the mean divided by the standard deviation for a onesample normal problem.
In this case, the sample size at each analysis is computed.
When delta=0
and n.fix>1
, n.fix
is assumed to be the sample size for a fixed design
with no interim analyses. See examples below.
Following are further comments on the input argument test.type
which is used to control what type of error measurements are used in trial design.
The manual may also be worth some review in order to see actual formulas for boundary crossing probabilities for the various options.
Options 3 and 5 assume the trial stops if the lower bound is crossed for Type I and Type II error computation (binding lower bound).
For the purpose of computing Type I error, options 4 and 6 assume the trial continues if the lower bound is crossed (nonbinding lower bound); that is a Type I error can be made by crossing an upper bound after crossing a previous lower bound.
Betaspending refers to error spending for the lower bound crossing probabilities
under the alternative hypothesis (options 3 and 4).
In this case, the final analysis lower and upper boundaries are assumed to be the same.
The appropriate total beta spending (power) is determined by adjusting the maximum sample size
through an iterative process for all options.
Since options 3 and 4 must compute boundary crossing probabilities under both the null and alternative hypotheses,
deriving these designs can take longer than other options.
Options 5 and 6 compute lower bound spending under the null hypothesis.
An object of the class gsDesign
. This class has the following elements and upon return from
gsDesign()
contains:
k 
As input. 
test.type 
As input. 
alpha 
As input. 
beta 
As input. 
astar 
As input, except when 
delta 
The standardized effect size for which the design is powered. Will be as input to 
n.fix 
Sample size required to obtain desired power when effect size is 
timing 
A vector of length 
tol 
As input. 
r 
As input. 
n.I 
Vector of length 
maxn.IPlan 
As input. 
nFixSurv 
As input. 
nSurv 
Sample size for Lachin and Foulkes method when 
endpoint 
As input. 
delta1 
As input. 
delta0 
As input. 
overrun 
As input. 
upper 
Upper bound spending function, boundary and boundary crossing probabilities under the NULL and alternate hypotheses. See Spending function overview and manual for further details. 
lower 
Lower bound spending function, boundary and boundary crossing probabilities at each analysis.
Lower spending is under alternative hypothesis (beta spending) for 
theta 
Standarized effect size under null (0) and alternate hypothesis. If 
falseprobnb 
For 
en 
Expected sample size accounting for early stopping. For timetoevent outcomes, this would be the expected number of events (although 
The manual is not linked to this help file, but is available in library/gsdesign/doc/gsDesignManual.pdf in the directory where R is installed.
Keaven Anderson keaven\_anderson@merck.
Jennison C and Turnbull BW (2000), Group Sequential Methods with Applications to Clinical Trials. Boca Raton: Chapman and Hall.
gsDesign package overview, gsDesign print, summary and table summary functions, Plots for group sequential designs, gsProbability
,
Spending function overview, WangTsiatis Bounds
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  # symmetric, 2sided design with O'BrienFleminglike boundaries
# lower bound is nonbinding (ignored in Type I error computation)
# sample size is computed based on a fixed design requiring n=800
x < gsDesign(k=5, test.type=2, n.fix=800)
# note that "x" below is equivalent to print(x) and print.gsDesign(x)
x
plot(x)
plot(x, plottype=2)
# Assuming after trial was designed actual analyses occurred after
# 300, 600, and 860 patients, reset bounds
y < gsDesign(k=3, test.type=2, n.fix=800, n.I=c(300,600,860),
maxn.IPlan=x$n.I[x$k])
y
# asymmetric design with userspecified spending that is nonbinding
# sample size is computed relative to a fixed design with n=1000
sfup < c(.033333, .063367, .1)
sflp < c(.25, .5, .75)
timing < c(.1, .4, .7)
x < gsDesign(k=4, timing=timing, sfu=sfPoints, sfupar=sfup, sfl=sfPoints,
sflpar=sflp,n.fix=1000)
x
plot(x)
plot(x, plottype=2)
# same design, but with relative sample sizes
gsDesign(k=4, timing=timing, sfu=sfPoints, sfupar=sfup, sfl=sfPoints,
sflpar=sflp)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.