View source: R/update.delayedGSD.R
update.delayedGSD | R Documentation |
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.
## 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,
...
)
object |
object of class |
delta |
[data.frame or lmmGSD] estimated effect ( |
Info.i |
[numeric] information at the current stage when interim. Not used when argument |
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 |
k |
[integer] index of the analysis. |
type.k |
[character] type of analysis: |
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. |
#### 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.