if (FALSE) {
# CRM example
fit1 <- stan_crm('1N 2N 3T', skeleton = c(0.1, 0.2, 0.35, 0.6),
target = 0.2, model = 'empiric', beta_sd = sqrt(1.34),
seed = 123)
fit2 <- stan_crm('1NNN 2NNN 3TTT', skeleton = c(0.1, 0.2, 0.35, 0.6),
target = 0.2, model = 'logistic', a0 = 3, beta_mean = 0,
beta_sd = sqrt(1.34), seed = 123)
# The seed is passed to the Stan sampler. The usual Stan sampler params like
# cores, iter, chains etc are passed on too via the ellipsis operator.
# TITE-CRM example, p.124 of Dose Finding by the CRM, Cheung (2010)
fit3 <-stan_crm(skeleton = c(0.05, 0.12, 0.25, 0.40, 0.55), target = 0.25,
doses_given = c(3, 3, 3, 3),
tox = c(0, 0, 0, 0),
weights = c(73, 66, 35, 28) / 126,
model = 'empiric', beta_sd = sqrt(1.34), seed = 123)
fit3$recommended_dose
}
Run the code above in your browser using DataLab