### follow same steps as the example in function toxicity_est()
# Generate a data including 3 columns: DoseLevel, DLT, ORR (DLT and ORR are binary outcomes)
currDat <- data.frame(sample(1:9, 6, replace=TRUE), rbinom(6, 1, 0.2), rbinom(6, 1, 0.5))
names(currDat) <- c("DoseLevel", "DLT", "ORR")
# Generate toxicity and efficacy skeleton
DLT_skeleton_p <- priorSkeletons(updelta = 0.045, target = 0.3, npos= 5, ndose = 9,
model = "logistic", prior = "normal", beta_mean = 0, a0 = 3)
eff_skeleton_p <- priorSkeletons(updelta = 0.045, target = 0.5, npos= 5, ndose = 9,
model = "logistic", prior = "normal", beta_mean = 0, a0 = 3)
# Obtain 6 complete orderings for toxicity skeleton and efficacy skeleton
orderings <- get_ordering(doseComb_forMat=c(3,3), type_forMat="matrix")
DLT_skeleton_l <- lapply(orderings, function(or){DLT_skeleton_p[or]})
eff_skeleton_l <- lapply(orderings, function(or){eff_skeleton_p[or]})
# estimate toxicity
tox <- toxicity_est(Dat=currDat, I=9, M=6, M_prob=rep(1/6, 6),
DLT_skeleton=DLT_skeleton_l, DLT_thresh=0.33,
model="logistic", para_prior="normal",
beta_mean=0, beta_sd=1, intcpt_lgst1=3,
beta_shape=NULL, beta_inverse_scale=NULL,
alpha_mean=NULL, alpha_sd=NULL,
alpha_shape=NULL, alpha_inverse_scale=NULL,
seed=42)
### efficacy estimation
eff <- efficacy_est(Dat=currDat, AR=tox$AR, I=9, K=6, K_prob=rep(1/6, 6),
efficacy_skeleton=eff_skeleton_l, Nphas=20,
model="logistic", para_prior="normal",
theta_mean=0, theta_sd=1, theta_intcpt_lgst1=3,
theta_shape=NULL, theta_inverse_scale=NULL,
alphaT_mean=NULL, alphaT_sd=NULL,
alphaT_shape=NULL, alphaT_inverse_scale=NULL,
seed=1, seed_rand=2, seed_max=3)
Run the code above in your browser using DataLab