Learn R Programming

gsDesign (version 2.8-7)

sfLinear: 4.6: Piecewise Linear Spending Function

Description

The function sfLinear() allows specification of a piecewise linear spending function. This provides complete flexibility in setting spending at desired timepoints in a group sequential design. Normally this function will be passed to gsDesign() in the parameter sfu for the upper bound or sfl for the lower bound to specify a spending function family for a design. When passed to gsDesign(), the value of param would be passed to sfLinear through the gsDesign() arguments sfupar for the upper bound and sflpar for the lower bound.

Usage

sfLinear(alpha, t, param)

Arguments

alpha
Real value $> 0$ and no more than 1. Normally, alpha=0.025 for one-sided Type I error specification or alpha=0.1 for Type II error specification. However, this could be set to 1 if for descriptive purposes you wish to see the
t
A vector of points with increasing values from 0 to 1, inclusive. Values of the proportion of sample size or information for which the spending function will be computed.
param
A vector with a positive, even length. Values must range from 0 to 1, inclusive. Letting m <- length(param/2), the first m points in param specify increasing values strictly between 0 and 1, where the interim timing (proportion

Value

  • An object of type spendfn. The cumulative spending returned in sfLinear$spend is 0 for t=0 and alpha for t>=1. For t between specified points, linear interpolation is used to determine sfLinear$spend. See Spending function overview for further details.

References

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

See Also

Spending function overview, gsDesign, gsDesign package overview

Examples

Run this code
# set up alpha spending and beta spending to be piecewise linear
sfupar <- c(.2, .4, .05, .2)
sflpar <- c(.3, .5, .65, .5, .75, .9)
x <- gsDesign(sfu=sfLinear, sfl=sfLinear, sfupar=sfupar, sflpar=sflpar)
plot(x, plottype="sf")
x

# now do an example where there is no lower-spending at interim 1
# and no upper spending at interim 2
sflpar<-c(1/3,2/3,0,.25)
sfupar<-c(1/3,2/3,.1,.1)
x <- gsDesign(sfu=sfLinear, sfl=sfLinear, sfupar=sfupar, sflpar=sflpar)
plot(x, plottype="sf")
x

Run the code above in your browser using DataLab