ldBands {Hmisc} | R Documentation |
This function computes and plots group sequential stopping boundaries
from the Lan-DeMets method with a variety of α-spending
functions using the ld98
program from the Department of
Biostatistics, University of Wisconsin written by DM Reboussin, DL
DeMets, KM Kim, and KKG Lan. Such stopping boundaries are
useful for early termination of clinical trials for safety problems or
for efficacy. Simple plot
and print
methods are
implemented. Simple sample size and minimally detectable effect sizes
given sample sizes may be obtained with a summary
method if
power
was specified to ldBands
. Alternatively,
summary
computes, for each look, the difference in means that
must be achieved to cross a boundary if n
and sd
are
specified, or the minimum difference in proportions and the odds ratios
that must be achieved to cross a boundary if n
and pbar
are specified.
ldBands(n = length(times), times = NULL, alpha = 0.05, sided = 2, alphaLower=alpha/2, alphaUpper=alpha/2, information = NULL, spending=c('OBrien-Fleming','Pocock','alpha*t^phi', 'Hwang-Shih-DeCani'), phi=1, spending2=c('OBrien-Fleming','Pocock','alpha*t^phi', 'Hwang-Shih-DeCani'), phi2=phi, truncate = Inf, power = NULL, pr = TRUE) ## S3 method for class 'ldBands' print(x, ...) ## S3 method for class 'ldBands' plot(x, xlab='Time', ylab='Z', actual=NULL, type='b', labels=NULL, ...) ## S3 method for class 'ldBands' summary(object, stdiff=NULL, n=NULL, p1=NULL, p2=NULL, hr=NULL, events=NULL, pbar=NULL, sd=NULL, ...) ## S3 method for class 'summary.ldBands' print(x, ...)
n |
number of interim analyses. If |
times |
times at which interim analyses are done |
alpha |
overall α level for the multiple tests.
Default is |
sided |
set to |
alphaLower |
α -level for lower bound if
|
alphaUpper |
α -level for upper bound if
|
information |
a vector of information times if different from
|
spending |
an α spending function. Default is
O'Brien-Fleming function. If |
phi |
parameter for the third and fourth types of spending
functions (exponent of time for the third, default is |
spending2 |
spending function for the upper bounds if
|
phi2 |
parameter for third and fourth spending functions if
|
truncate |
a value at which to truncate Z critical values so that early looks will have some power without really affecting the overall α level. Default is no truncation. |
power |
A power for which to compute a drift parameter; useful in sample size calculations |
pr |
set to |
x |
an object created by |
xlab |
x -axis label |
ylab |
y -axis label |
actual |
an optional list with two components: times and z values to add as points to the first plot |
type |
default is |
labels |
an optional character vector to be used to label time
points corresponding to those generated by |
object |
an object created by |
stdiff |
standardized difference to detect |
p1 |
probability of event in group 1 |
p2 |
probability of event in group 2, to compare with |
hr |
hazard ratio to detect, to obtain needed number of events at end of study for either treatment arm using the logrank test |
events |
number of events per treatment arm at end of study, to obtain detectable hazard ratio |
pbar |
mean of actual probabilities of events in two treatment arms |
sd |
standard deviation of an observation |
... |
unused |
This function assumes that you have stored the ld98
executable
in a subdirectory that is in your system path. Obtain ld98
program from the URL given in the reference below.
The plot
method makes two plots if power
is specified, the
second containing exit and cumulative exit probabilities as a function
of time. If par(mfrow=c())
is not already set to something besides
c(1,1)
, par(mfrow=c(2,1))
is set temporarily.
A list of class "ldBands"
with the following components. When
summary
is used and n
and either pbar
or
sd
are given, summary
returns the same object returned
by ldBands
but with possible components
diff.lower,diff.lower
(needed difference means or proportions) and
or.lower,or.upper
(needed odds ratios).
data |
a data frame containing the main calculations |
power |
power specified, if any |
drift |
drift calculated, if |
type |
|
n |
number of interim analyses, for |
alpha |
input value of |
sided |
|
alphaLower |
lower α |
alphaUpper |
upper α |
spending |
name of α spending function used |
phi |
parameter for spending function |
spending2 |
name of spending function for upper boundary.
Defaults to |
phi2 |
parameter for second spending function. Defaults to
|
truncate |
value at which Z statistics truncated (default
is |
Frank E Harrell Jr
Reboussin DM, DeMets DL, Kim K-M, Lan KKG (1996): Programs for computing group sequential boundaries using the Lan-DeMets method. http://www.biostat.wisc.edu/landemets/
Reboussin DM, DeMets DL, Kim K, Lan KKG (2000): Computations for group sequential boundaries using the Lan-DeMets spending function method. Controlled Clinical Trials 21:190-207.
## Not run: # Get boundaries for O'Brien-Fleming spending function, 5 looks, alpha=.05 b <- ldBands(5, pr=FALSE) plot(b) # Same but times are irregular, and information times are different than # test times. Use Pocock spending function. b <- ldBands(times= c(.4, .6, .8, .9, .95), information=c(.42,.65,.83,.89,.94), spending='Pocock') # Get power calculations u <- ldBands(times=c(.4, .6, .8, .9, .95), power=.9) u$drift # standardize difference * sqrt(n per arm) # needed to provide power=.9 summary(u, n=50) # obtain detectable standardized difference summary(u, p1=.4, p2=.5) # get sample size per arm, two-sample binomial summary(u, hr=1.5) # get number of events per arm needed # to detect a hazard ratio of 1.5 # Asymmetric boundaries with different spending functions, truncate b <- ldBands(5, sided=3, spending='alpha*t^phi', phi=1, phi2=1.5, alphaLower=.01, alphaUpper=.04, truncate=4) b plot(b) # Compute differences in proportions and odds ratios needed to cross # the boundaries, given a mean probability in two treatment arms of 0.1 # and given a vector of sample sizes per arm corresponding to the looks s <- summary(b, n=seq(200,1000,by=200), pbar=.1) s d <- s$data plot(d$n, d$or.lower, xlab='N Per Arm', ylab='Critical Odds Ratio', type='b', ylim=range(d$or.lower, d$or.upper), log='y') lines(d$n, d$or.upper, type='b') abline(h=1, lty=2) ## End(Not run)