update.delayedGSD: Perform Next Analysis Stage in a GSD

View source: R/update.delayedGSD.R

update.delayedGSDR Documentation

Perform Next Analysis Stage in a GSD

Description

Use the newly observed data to perform the next stage of the analysis: fit a mixed model, update the information, recompute the boundaries, take a decision, and possibly correct the estimated treatment effect.

Usage

## S3 method for class 'delayedGSD'
update(
  object,
  delta,
  Info.i,
  Info.d,
  k = NULL,
  type.k = NULL,
  overrule.futility = FALSE,
  p.value = TRUE,
  ci = TRUE,
  estimate = TRUE,
  trace = TRUE,
  ...
)

Arguments

object

object of class delayedGSD, typically output from CalcBoundaries.

delta

[data.frame or lmmGSD] estimated effect ("estimate"), standard error ("se"), test statistic ("statistic"), degrees of freedom ("df"), and p-value ("p.value") all unadjusted for GSD. Alternatively output of analyzeData.

Info.i

[numeric] information at the current stage when interim. Not used when argument beta is a lmmGSD object.

Info.d

[numeric] information at the current stage when decision or final or at the coming decision when interim leading to early stop. Not used when argument beta is a lmmGSD object.

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).

p.value

[logical] should the p-value be computed at decision?

ci

[logical] should the confidence intervalsbe computed at decision?

estimate

[logical] should a de-biased estimate be computed at decision? WARNING: this is experiment and not reliable.

trace

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

...

not used, for compatibility with the generic method.

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)
myLmmI <- analyzeData(theInterimData)
myInterim1 <- update(myBound0, delta = myLmmI) ## k = 1, analysis = "interim"
print(myInterim1)
print(myInterim1, planned = FALSE)
print(myInterim1, planned = "only")

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

#### Analyse data at the final stage ####
theFinalData <- SelectData(theData$d, t = 1e7) 
myLmmF <- analyzeData(theFinalData)
myFinal <- update(myInterim1, delta = myLmmF) ## k = 2, analysis = "final"
myFinal
print(myFinal, abreviated = FALSE)
plot(myFinal)

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