Package 'grpseq'

Title: Group Sequential Analysis of Clinical Trials
Description: Design of group sequential trials, including non-binding futility analysis at multiple time points (Gallo, Mao, and Shih, 2014, <doi:10.1080/10543406.2014.932285>).
Authors: Lu Mao
Maintainer: Lu Mao <[email protected]>
License: GPL (>= 2)
Version: 1.0
Built: 2025-01-20 04:25:20 UTC
Source: https://github.com/cran/grpseq

Help Index


Design of non-binding futility analysis at multiple points

Description

Design of non-binding futility looks at multiple information times based on conditional power (CP), predictive power (PP), or condition power under current estimate (CPd) (Gallo, Mao, and Shih, 2014).

Usage

fut(
  alpha,
  beta,
  t,
  gamma,
  side = 2,
  increment = 1e-04,
  si = 0,
  scale = "CP",
  seed = 12345
)

Arguments

alpha

Type I error.

beta

Type II error (1 - power).

t

A numeric vector of information times in (0,1)(0, 1) for futility looks.

gamma

A numeric vector of probabilities (whose meaning depends on scale) at information times t.

side

1- or 2-sided test.

increment

Error for the numerical solution of the sample size inflation factor.

si

0: without sample size inflation; 1: with sample size inflation.

scale

Character string specifying the scaled used: "CP", conditional power; "PP", predictive power; "CPd": condition power under current estimate.

seed

Seed number for the randomized evaluation of multivariate normal distribution.

Value

An object of class fut with the following components. gamma1: conditional power at information times t converted from the supplied gamma and scale; theta: local alternative associated with the actual power when the futility rules of enforced; IF: sample size inflation factor if si=1; loss: power loss if si=0.

References

Gallo, P., Mao, L., and Shih, V.H. (2014). Alternative views on setting clinical trial futility criteria. Journal of Biopharmaceutical Statistics, 24, 976-993.

See Also

print.fut, summary.fut, plot.fut, powerplot

Examples

## load the package
library(grpseq)
## two-sided level 0.05 test with 80% power;
## evenly spaced three futility looks with predictive power 20%;
## inflate sample size to recoup power.
obj1 <- fut(alpha=0.05,beta=0.2,t=(1:3)/4,gamma=0.2*rep(1,3),side=2,scale="PP",si=1)
obj1
## print the summary results
summary(obj1)

## do the same thing without sample size inflation
obj2 <- fut(alpha=0.05,beta=0.2,t=(1:3)/4,gamma=0.2*rep(1,3),side=2,scale="PP",si=0)
obj2
## print the summary results
summary(obj2)
oldpar <- par(mfrow = par("mfrow"))
par(mfrow=c(1,2))
## plot the futility boundaries by z-value
plot(obj2,scale='z',lwd=2,main="")
## plot the futility boundaries by B-value
plot(obj2,scale='b',lwd=2,main="")
par(oldpar)
## plot the power curve as a function of the (local)
## effect size in units of the hypothesized effect size
## ref=TRUE requests the power curve for the original one-time analysis
powerplot(obj2,lwd=2, ref=TRUE)

Plot the planned futility boundaries

Description

Plot the planned futility boundaries in B- or z-values as a function of information time.

Usage

## S3 method for class 'fut'
plot(
  x,
  scale = "z",
  add = FALSE,
  lty = 8,
  xlab = "Info Time",
  ylab = "z score",
  type = "b",
  pch = 1,
  cex = 1,
  main = "Futility Boundary for the Planned Test",
  xlim = c(0, 1.1),
  ylim = NULL,
  ...
)

Arguments

x

An object returned by fut.

scale

"z": plot z-values; "b": plot B-values.

add

If TRUE, the curve will be overlaid on an existing plot; otherwise, a separate plot will be constructed.

lty

Line type for the segments connecting the z-/B-value points.

xlab

A label for the x axis, defaults to a description of x.

ylab

A label for the y axis, defaults to a description of y.

type

Plot type. "l": only line segments; "p": only z-/B-value points; "b": both.

pch

Point types for the z-/B-values.

cex

Point size.

main

A main title for the plot.

xlim

The x limits of the plot.

ylim

The y limits of the plot.

...

Other arguments that can be passed to the underlying plot method.

Value

No return value, called for side effects.

See Also

fut, summary.fut, powerplot.

Examples

# see example for fut

Plot the power function of the planned analysis

Description

Plot the power curve of the planned futility analysis as a function of the effect size (in units of the hypothesized effect size).

Usage

powerplot(
  x,
  ref = FALSE,
  add = FALSE,
  lty = 1,
  ref.lty = 2,
  lwd = 1,
  xlab = expression(delta),
  ylab = "Power",
  main = "Power curve of the planned futility analysis",
  xlim = c(0, 1.5),
  ylim = c(0, 1),
  ...
)

Arguments

x

An object returned by fut.

ref

If TRUE, power curve of the reference test (one that ignores the futility boundaries) will be overlaid.

add

If TRUE, the curve will be overlaid on an existing plot; otherwise, a separate plot will be constructed.

lty

Line type for the power curve of the futility analysis.

ref.lty

Line type for the power curve of the reference if ref=TRUE.

lwd

Line width.

xlab

A label for the x axis, defaults to a description of x.

ylab

A label for the y axis, defaults to a description of y.

main

A main title for the plot.

xlim

The x limits of the plot.

ylim

The y limits of the plot.

...

Other arguments that can be passed to the underlying plot method.

Value

No return value, called for side effects.

See Also

fut, summary.fut, plot.fut.

Examples

# see example for fut

Print basic information about the futility design

Description

Print the power loss or sample size inflation factor due to the planned futility analysis.

Usage

## S3 method for class 'fut'
print(x, ...)

Arguments

x

An object of class fut.

...

Further arguments passed to or from other methods.

Value

Print the results of fut object.

See Also

fut, summary.fut

Examples

# see example for fut

Print method for summary.fut objects

Description

Print the detailed summary of the futility design.

Usage

## S3 method for class 'summary.fut'
print(x, ...)

Arguments

x

An object returned by summary.fut.

...

Further arguments passed to or from other methods

Value

No return value, called for side effects.

See Also

fut, summary.fut.


Detailed summary of the futility design

Description

Provide key information about the futility design, including B-/z-values, beta (type II error) spent, and power loss at each futility look as well the the sample size distribution under the null hypothesis.

Usage

## S3 method for class 'fut'
summary(object, ...)

Arguments

object

An object returned by fut.

...

further arguments passed to or from other methods.

Value

An object of class summary.fut with components:

t

A KK-dimensional vector of information times.

b

A KK-dimensional vector of B-values at t.

z

A KK-dimensional vector of z-values at t.

type2

A KK-dimensional vector of beta spent at t.

loss

A KK-dimensional vector of power loss at t.

ess

Expected sample size at H0H_0.

...

See Also

fut, print.fut, print.summary.fut.

Examples

# see example for fut