updateBoundaries: Update Boundaries of a GSD

View source: R/updateBoundaries.R

updateBoundariesR Documentation

Update Boundaries of a GSD

Description

Recompute the boundaries based according to the current information.

Usage

updateBoundaries(
  object,
  delta,
  Info.i,
  Info.d,
  k,
  type.k,
  update.stage,
  trace = FALSE
)

Arguments

object

Object of type delayedGSD, typically output from CalcBoundaries.

Info.i

[numeric vector of size k] Optional argument used to update the information at interim (only past or current information).

Info.d

[numeric vector of size k] Optional argument used to update the information at decision or final (observed or predicted information).

k

[integer] Index of the analysis.

type.k

[character] Type of analysis: "interim" (after continuing recruitment), "decision" (after stopping recruitment for efficacy or futility), or "final" (after reaching the last stage of the trial).

update.stage

[logical] should the arguments k and type.k be used to update to stage of the trial?

trace

[logical] should the execution of the function be traced?

Examples


#### Planning #####
theAlpha <- 0.025
theBeta <- 0.2
theDelta <- 1.5
theK <- 2
theN <- 82

myBound0 <- CalcBoundaries(kMax=theK,
                     alpha=theAlpha,
                     beta=theBeta,
                     InfoR.i=c(0.5,1),
                     rho_alpha=2,
                     rho_beta=2,
                     method=1,
                     delta=theDelta,
                     InfoR.d=0.55)

#### Simulate data ####
## generate data with all data for in case trial completes
set.seed(10)
theData <- GenData(n=theN*2,delta=theDelta*0.8,ar=5)   

theAR <- 10  #accrual rate (pt per month)
theDelay <- 0.7500001  #time in months to process data
tau.i <- theData$d$t3[theN + ceiling(theAR*theDelay)] #time point at which to do IA


#### Analyse data at the first interim ####
theInterimData <- SelectData(theData$d, t = tau.i)

myLMM <- analyzeData(theInterimData)
myBound1 <- update(myBound0, delta = myLMM)
print(myBound1)
print(myBound1, planned = FALSE)
print(myBound1, planned = "only")

par(mfrow = c(1,2))
plot(myBound1, planned = "only")
plot(myBound1)

#### Analyse data at the final ####
theFinalData <- SelectData(theData$d, t = 1e7, Delta.t = theDelay) 

myLMM <- analyzeData(theFinalData)
myBound2 <- update(myBound1, delta = myLMM)
plot(myBound2)

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