gsBinomialExact
computes power/Type I error and expected sample size for a group sequential design
in a single-arm trial with a binary outcome.
This can also be used to compare event rates in two-arm studies.
The print function has been extended using print.gsBinomialExact
to print gsBinomialExact
objects; see examples.
Similarly, a plot function has been extended using plot.gsBinomialExact
to plot gsBinomialExact
objects; see examples.
binomialSPRT
computes a truncated binomial sequential probability ratio test (SPRT) which is a specific instance of an exact binomial group sequential design for a single arm trial with a binary outcome. See, for example, gsBinomialExact(k=2, theta=c(.1, .2), n.I=c(50, 100), a=c(3, 7), b=c(20,30))
binomialSPRT(p0,p1,alpha,beta,minn,maxn)
## S3 method for class 'gsBinomialExact':
plot(x,plottype=1,\dots)
## S3 method for class 'binomialSPRT':
plot(x,plottype=1,\dots)
p0
when it is true (Type I error rate).p1
when it is trun (Type II error rate).gsBinomialExact
or binomialSPRT
for print.gsBinomialExact
. Item of class gsBinomialExact
for plot.gsBinomialExact
. Item of class binomialSPRT
for item of class binomialSPRT
, also produces linear SPRT bounds); 2 produces a plot with power to reject null and alternate response rates as well as the probability of not crossing a bound by the maximggplot
gsBinomialExact()
returns a list of class gsBinomialExact
and gsProbability
(see example); when displaying one of these objects, the default function to print is print.gsProbability()
.
The object returned from gsBinomialExact()
contains the following elements:bound
is as input in a
and prob
is a matrix of boundary
crossing probabilities. Element i,j
contains the boundary crossing probability at analysis i
for the j
-th element of theta
input. All boundary crossing is assumed to be binding for this computation; that is, the trial must stop if a boundary is crossed.lower
containing the upper bound and upper boundary crossing probabilities.theta
containing expected sample sizes for the trial design
corresponding to each value in the vector theta
.binomialSPRT
produces an object of class binomialSPRT
that is an extension of the gsBinomialExact
class. The values returned in addition to those returned by gsBinomialExact
are:gsBinomialExact
is based on the book "Group Sequential Methods with Applications to Clinical Trials,"
Christopher Jennison and Bruce W. Turnbull, Chapter 12, Section 12.1.2 Exact Calculations for Binary Data.
This computation is often used as an approximation for the distribution of the number of events in one treatment group out of all events when the probability of an event is small and sample size is large.
An object of class gsBinomialExact
is returned.
On output, the values of theta
input to gsBinomialExact
will be the parameter values for which the boundary crossing probabilities and expected sample sizes are computed.
Note that a[1] equal to -1 lower bound at n.I[1] means 0 successes continues at interim 1; a[2]==0 at interim 2 means 0 successes stops trial for futility at 2nd analysis.
For final analysis, set a[k] equal to b[k]-1 to incorporate all possibilities into non-positive trial; see example.
The sequential probability ratio test (SPRT) is a sequential testing scheme allowing testing after each observation. This likelihood ratio is used to determine upper and lower cutoffs which are linear and parallel in the number of responses as a function of sample size.
binomialSPRT
produces a variation the the SPRT that tests only within a range of sample sizes.
While the linear SPRT bounds are continuous, actual bounds are the integer number of response at or beyond each linear bound for each sample size where testing is performed. Because of the truncation and discretization of the bounds, power and Type I error achieve will be lower than the nominal levels specified by alpha
and beta
which can be altered to produce desired values that are achieved by the planned sample size. See also example that shows computation of Type I error when futility bound is considered non-binding.
Plots produced include boundary plots, expected sample size, response rate at the boundary and power.gsProbability
zz <- gsBinomialExact(k=3,theta=seq(0,1,0.1), n.I=c(12,24,36),
a=c(-1, 0, 11), b=c( 5, 9, 12))
# let's see what class this is
class(zz)
# because of "gsProbability" class above, following is equivalent to
# print.gsProbability(zz)
zz
# also plot (see also plots below for \code{binomialSPRT})
# add lines using geom_line()
plot(zz) + geom_line()
# now for SPRT examples
x <- binomialSPRT(p0=.05,p1=.25,alpha=.1,beta=.2)
# boundary plot
plot(x)
# power plot
plot(x,plottype=2)
# Response (event) rate at boundary
plot(x,plottype=3)
# Expect sample size at boundary crossing or end of trial
plot(x,plottype=6)
Run the code above in your browser using DataLab