CalcBoundaries: Calculate boundaries for a group sequential design with...

View source: R/CalcBoundaries.R

CalcBoundariesR Documentation

Calculate boundaries for a group sequential design with delayed endpoints

Description

Calculate boundaries (interim and decision) for a group sequential design with delayed endpoints based on planned and/or observed information using an error spending approach

Usage

CalcBoundaries(
  kMax = 2,
  alpha = 0.025,
  beta = 0.2,
  InfoR.i = 0.5,
  rho_alpha = 2,
  rho_beta = 2,
  method = 1,
  cNotBelowFixedc = FALSE,
  delta = 1.5,
  InfoR.d = c(0.55, 1),
  bindingFutility = TRUE,
  alternative = "greater",
  conf.level = 1 - 2 * alpha,
  n = NA,
  trace = FALSE,
  mycoefMax = 1.2,
  PowerCorrection = FALSE
)

Arguments

kMax

max number of analyses (including final)

alpha

type I error

beta

type II error

InfoR.i

planned or observed information rates at the interim analyses 1:(Kmax-1)

rho_alpha

rho parameter for alpha error spending function

rho_beta

rho parameter for beta error spending function

method

use method 1 or 2 from paper H&J

cNotBelowFixedc

whether the value c at the decision analysis can be below that of a fixed sample test (H & J page 10)

delta

effect that the study is powered for

InfoR.d

(expected) information rate at each decision analysis, including the final analysis.

bindingFutility

[logical] whether the futility stopping rule is binding.

alternative

a character string specifying the alternative hypothesis, "greater" or "less". H0 \theta=0 vs H1 theta<0 ("less") or theta > 0 ("greater"). Note that in Jennison and Turnbull's book chapter (2013) they consider greater.

conf.level

confidence level for the confidence intervals. By default the complement to 1 of twice the type 1 error.

n

planned sample size in each group. Optional argument.

trace

whether to print some messages

PowerCorrection

whether to correct the power for Method 1

Examples

myBound <- CalcBoundaries(kMax=2,
              alpha=0.025,  
              beta=0.2,  
              InfoR.i=c(0.5),
              rho_alpha=2,
              rho_beta=2,
              method=2,
              cNotBelowFixedc=TRUE,
              delta=1.5,
              InfoR.d=c(0.55,1))
myBound
plot(myBound)

## to reproduce bounds from CJ DSBS course slide 106
myBound <- CalcBoundaries(kMax=3,
              alpha=0.025,  
              beta=0.1,  
              InfoR.i=c(3.5,6.75)/12,
              rho_alpha=1.345,
              rho_beta=1.345,
              method=1, ## has been changed from 2 to 1
              cNotBelowFixedc=TRUE,
              bindingFutility=FALSE,
              delta=1,
              InfoR.d=c(5.5,8.75,12)/12)
myBound
plot(myBound)

paulowhite/DelayedGSD documentation built on Nov. 1, 2023, 5:36 p.m.