gsDesign()
is used to find boundaries and trial size required for a group sequential design.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)
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, asymmettest.type=5
or 6
, astar
specifies the total
probability of crossing a lower bound at all analyses combined.
This will be changed to $1 -$alpha
when default value of 0 is un.fix=NULL
. See details and examples.k
or k-1
.
The values should satisfy 0 < timing[1] < timing[2] < ... < timing[k-1] <
timin
sfupar
specifies any parameterstest.type = 3
,
4
, 5
, or 6
).
Unlike the upper bound, only spending functionsr
will not be changed by tnFixSurv
computed as the sample size from nSurvival
may be entered to have gsDesign
compute the total sample size required as well as the number of events at each analysis that delta1
and delta0
may be used to store information about the natural parameter scale compared to delta
that is a standardized effect size. delta1
is the alternative hypothesis parameter value on the natudelta0
is the null hypothesis parameter value on the natural parameter scale.gsDesign
. This class has the following elements and upon return from
gsDesign()
contains:test.type=5
or 6
and astar
is input as 0; in this case
astar
is changed to 1-alpha
.gsDesign()
unless it was input as 0; in that case, value will be computed to give desired power for fixed design with input
sample size n.fix
.delta
.k
containing the portion of the total planned information or sample size at each analysis.test.type=3
or 4
.
For test.type=2
, 5
or 6
, lower spending is under the null hypothesis.
For test.type=1
, output value is NULL
. See Spending function overview and manual.k
. If values are input, same values are output.
Otherwise, n.I
will contain the sample size required at each analysis
to achieve desired timing
and beta
for the output value of delta
.
If delta=0
was input, then this is the sample size required for the specified group sequential design when a fixed design requires a sample size of n.fix
.
If delta=0
and n.fix=1
then this is the relative sample size compared to a fixed design; see details and examples.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 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 one-sample 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 (non-binding lower bound); that is a Type I error can be made by crossing an upper bound after crossing a previous lower bound.
Beta-spending 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.gsProbability
,
Spending function overview, Wang-Tsiatis Bounds# symmetric, 2-sided design with O'Brien-Fleming-like boundaries
# lower bound is non-binding (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 user-specified spending that is non-binding
# 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)
Run the code above in your browser using DataLab