# NOT RUN {
##Note: nSims should be set larger than the example below.
nSims=1
###TRIAL PARAMETERS###
##Specify reference toxicity time and target
T1=6
Target=.3
##Number of Groups
##Specify upper bound for determining if the lowest dose is too toxic in a subgroup
Upper=c(.95,.95)
#' ##Standardized Dose Values and starting dose index
Dose=sort(rnorm(5))
DoseStart=1
##Maximum Sample Size
Nmax=25
##Number of patients to run separately
NSep=0
##Number of patients to borrow, but NOT cluster
NBorrow=0
##Number of patients to fully evaluate or TREAT before ESCALATING
cohort=3
##Do we fully evaluate a cohort before escalating?
FULL=0
#HYPERPARAMETERS#
##Hypermeans for baseline terms
meanmu=2.21
meanslope=-.57
##Hypervectors for subgroup specific terms
MeanInts = c(0,.46)
MeanSlopes = c(0,.04)
##Hypervariances
VarInt=5
VarSlope=1
######SIMULATION TRUTH####
##True Accrual Rate
Accrue=2
##True Distribution of subgroups
groupprob=c(.5,.5)
##True Group Toxicity probabilities at each dose level
GroupProb =matrix(c(.05,.3,.6,.7,.8,.01,.02,.13,.27,.5),nrow=2,byrow=TRUE)
##True Simulation distribution
Family="Uniform"
SimTruth = as.list(c(0,0))
SimTruth[[1]]=GroupProb
SimTruth[[2]]=GroupProb
phetero=.9
RESULTS=SimTrial(nSims,Nmax,T1,Target,Dose,DoseStart,
Upper,Accrue,groupprob,meanmu,meanslope,
MeanInts,MeanSlopes,VarInt,VarSlope,phetero,
Family,SimTruth,NSep,NBorrow,cohort,FULL)
RESULTS[[1]]
# }
Run the code above in your browser using DataLab