# NOT RUN {
## SIMULATE DATA AND SET SIMULATION PARAMS
nSims <- 100 ## would be much more in practice
meanTime <- 0.01
sdTime <- 0.0000000001
mu0 <- 0.45
phi0 <- 1.00
ppEffCrit <- 0.985
ppFutCrit <- 0.2750
pmp0 <- 2
n1 <- 7
n2 <- 16
targSSPer <- c(n1, n2)
nInterim <- 2
futOnly <- 1
K0 <- 5
row <- 0
mss <- 4
minSSFut <- mss ## minimum number of subjects in basket to assess futility using BMA
minSSEff <- mss ## minimum number of subjects in basket to assess activity using BMA
rTarg <- 0.45
rNull <- 0.15
rRatesMod <- matrix(rNull,(K0+1)+3,K0)
rRatesNull <- rep(rNull,K0)
rRatesMid <- rep(rTarg,K0)
eRatesMod <- rep(1, K0)
## min and max #' of new subjects per basket before next analysis (each row is interim)
minSSEnr <- matrix(rep(mss, K0), nrow=nInterim ,ncol=K0, byrow=TRUE)
maxSSEnr <- matrix(rep(100, K0), nrow=nInterim, ncol=K0, byrow=TRUE)
## construct matrix of rates
for (i in 1:K0)
{
rRatesMod[(i+1):(K0+1),i]= rTarg
}
rRatesMod[(K0+2),] <- c(0.05,0.15,0.25,0.35,0.45)
rRatesMod[(K0+3),] <- c(0.15,0.30,0.30,0.30,0.45)
rRatesMod[(K0+4),] <- c(0.15,0.15,0.30,0.30,0.30)
## conduct simulation of trial data and analysis
x <- bma_design(
nSims, K0, K0, eRatesMod, rRatesMod[i+1,], meanTime, sdTime,
ppEffCrit, ppFutCrit, as.logical(futOnly), rRatesNull, rRatesMid,
minSSFut, minSSEff, minSSEnr, maxSSEnr, targSSPer, nInterim, mu0,
phi0, priorModelProbs = NULL, pmp0 = pmp0
)
# }
Run the code above in your browser using DataLab