Learn R Programming

gsDesign (version 3.2.1)

gsProbability: Boundary Crossing Probabilities

Description

Computes power/Type I error and expected sample size for a group sequential design across a selected set of parameter values for a given set of analyses and boundaries. The print function has been extended using print.gsProbability to print gsProbability objects; see examples.

Depending on the calling sequence, an object of class gsProbability or class gsDesign is returned. If it is of class gsDesign then the members of the object will be the same as described in gsDesign. If d is input as NULL (the default), all other arguments (other than r) must be specified and an object of class gsProbability is returned. If d is passed as an object of class gsProbability or gsDesign the only other argument required is theta; the object returned has the same class as the input d. On output, the values of theta input to gsProbability will be the parameter values for which the design is characterized.

Usage

gsProbability(k = 0, theta, n.I, a, b, r = 18, d = NULL, overrun = 0)

# S3 method for gsProbability print(x, ...)

Arguments

k

Number of analyses planned, including interim and final.

theta

Vector of standardized effect sizes for which boundary crossing probabilities are to be computed.

n.I

Sample size or relative sample size at analyses; vector of length k. See gsDesign and manual.

a

Lower bound cutoffs (z-values) for futility or harm at each analysis, vector of length k.

b

Upper bound cutoffs (z-values) for futility at each analysis; vector of length k.

r

Control for grid as in Jennison and Turnbull (2000); default is 18, range is 1 to 80. Normally this will not be changed by the user.

d

If not NULL, this should be an object of type gsDesign returned by a call to gsDesign(). When this is specified, the values of k, n.I, a, b, and r will be obtained from d and only theta needs to be specified by the user.

overrun

Scalar or vector of length k-1 with patients enrolled that are not included in each interim analysis.

x

An item of class gsProbability.

Not implemented (here for compatibility with generic print input).

Value

k

As input.

theta

As input.

n.I

As input.

lower

A list containing two 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.

upper

A list of the same form as lower containing the upper bound and upper boundary crossing probabilities.

en

A vector of the same length as theta containing expected sample sizes for the trial design corresponding to each value in the vector theta.

r

As input.

Note: print.gsProbability() returns the input x.

References

Jennison C and Turnbull BW (2000), Group Sequential Methods with Applications to Clinical Trials. Boca Raton: Chapman and Hall.

See Also

plot.gsDesign, gsDesign, gsDesign package overview

Examples

Run this code
# NOT RUN {
library(ggplot2)
# making a gsDesign object first may be easiest...
x <- gsDesign()

# take a look at it
x

# default plot for gsDesign object shows boundaries
plot(x)

# \code{plottype=2} shows boundary crossing probabilities
plot(x, plottype = 2)

# now add boundary crossing probabilities and
# expected sample size for more theta values
y <- gsProbability(d = x, theta = x$delta * seq(0, 2, .25))
class(y)

# note that "y" below is equivalent to \code{print(y)} and
# \code{print.gsProbability(y)}
y

# the plot does not change from before since this is a
# gsDesign object; note that theta/delta is on x axis
plot(y, plottype = 2)

# now let's see what happens with a gsProbability object
z <- gsProbability(
  k = 3, a = x$lower$bound, b = x$upper$bound,
  n.I = x$n.I, theta = x$delta * seq(0, 2, .25)
)

# with the above form,  the results is a gsProbability object
class(z)
z

# default plottype is now 2
# this is the same range for theta, but plot now has theta on x axis
plot(z)
# }

Run the code above in your browser using DataLab