toInteger: Translate group sequential design to integer events (survival...

View source: R/toInteger.R

toIntegerR Documentation

Translate group sequential design to integer events (survival designs) or sample size (other designs)

Description

Translate group sequential design to integer events (survival designs) or sample size (other designs)

Usage

toInteger(x, ratio = 0, roundUpFinal = TRUE)

Arguments

x

An object of class gsDesign or gsSurv.

ratio

A non-negative integer, usually corresponding to experimental:control sample size ratio. Rounding is done to a multiple of ratio + 1. If input x has class gsSurv (design for time-to-event outcome), and x$ratio is a whole number, ratio is replaced by x$ratio. See details.

roundUpFinal

Final value in returned n.I is rounded up if TRUE; otherwise, just rounded. For gsSurv input, final total sample size is also controlled by this. See details.

Details

If ratio = 3, rounding for final sample size is done to a multiple of 3 + 1 = 4. For a gsSurv object input in x, event counts output in n.I are rounded to nearest integer and final total sample size is rounded to a multiple of ratio + 1. For other input values of x (gsDesign class), n.I is interpreted as sample size; final value is rounded to a multiple of ratio + 1, with roundUpFinal controlling rounding of last value.

Value

Output is an object of the same class as input x; i.e., gsDesign with integer vector for n.I or gsSurv with integer vector n.I and integer total sample size. See details.

Examples

# The following code derives the group sequential design using the method
# of Lachin and Foulkes

x <- gsSurv(
  k = 3,                 # 3 analyses
  test.type = 4,         # Non-binding futility bound 1 (no futility bound) and 4 are allowable
  alpha = .025,          # 1-sided Type I error
  beta = .1,             # Type II error (1 - power)
  timing = c(0.45, 0.7), # Proportion of final planned events at interims
  sfu = sfHSD,           # Efficacy spending function
  sfupar = -4,           # Parameter for efficacy spending function
  sfl = sfLDOF,          # Futility spending function; not needed for test.type = 1
  sflpar = 0,            # Parameter for futility spending function
  lambdaC = .001,        # Exponential failure rate
  hr = 0.3,              # Assumed proportional hazard ratio (1 - vaccine efficacy = 1 - VE)
  hr0 = 0.7,             # Null hypothesis VE
  eta = 5e-04,           # Exponential dropout rate
  gamma = 10,            # Piecewise exponential enrollment rates
  R = 16,                # Time period durations for enrollment rates in gamma
  T = 24,                # Planned trial duration
  minfup = 8,            # Planned minimum follow-up
  ratio = 3              # Randomization ratio (experimental:control)
)
# Convert bounds to exact binomial bounds
toInteger(x, ratio = 3)

gsDesign documentation built on Sept. 11, 2024, 5:58 p.m.