View source: R/updateBoundaries.R
updateBoundaries | R Documentation |
Recompute the boundaries based according to the current information.
updateBoundaries(
object,
delta,
Info.i,
Info.d,
k,
type.k,
update.stage,
trace = FALSE
)
object |
Object of type |
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: |
update.stage |
[logical] should the arguments |
trace |
[logical] should the execution of the function be traced? |
#### 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.