## example 1
doses <- c(0, 62.5, 125, 250, 500)
mods <- list(emax = 25, linear = NULL, logistic = c(50, 50), betaMod = c(1, 1))
clinRel <- 200
d <- 4
prior <- list(a=350^2*(d+2), d=d, m=c(60,280), V=matrix(c(100000,0,0,100000),2,2), S=10)
dats <- genDFdata("emax", c(e0 = 60, eMax = 294, ed50 = 25), doses, rep(46, 5), 350)
## calculate posterior means
calcBayesEst(dats, mods, prior, weights = rep(1/4, 4), clinRel = clinRel, scal=600)
## calculate posterior mode
calcBayesEst(dats, mods, prior, weights = rep(1/4, 4), clinRel =
clinRel, scal=600, meanInd = FALSE)
## example 2 (investigate under different prior scenarios)
s2 <- 1
models <- list(emax = c(7.5), logistic = matrix(c(30,60,4,11), nrow=2),
betaMod=c(1,1))
data <- genDFdata("emax", c(e0 = 0, eMax = 1, ed50 = 7.5), c(0, 10, 37.5, 75),
n=(280/4), sigma=sqrt(s2))
priorProp <- list(S=3, a = s2*6, d = 4, m = c(0, 1), V = c(10,0,0,10))
priorAlt1 <- list(S=3, a = s2*6, d = 4, m = c(-0.5, 1.2), V = c(10,0,0,10))
priorAlt2 <- list(S=3, a = s2*6, d = 4, m = c(0, 1), V = c(1000,0,0,1000))
priorAlt3 <- list(S=3, a = s2*60, d = 40, m = c(0, 1), V = c(40,0,0,40))
priorAlt4 <- list(S=20, a = s2*60, d = 40, m = c(0, 1), V = c(40,0,0,40))
calcBayesEst(data, models, prior = priorProp, clinRel = 0.5, scal = 100,
meanInd = FALSE)
calcBayesEst(data, models, prior = priorAlt1, clinRel = 0.5, scal = 100,
meanInd = FALSE)
calcBayesEst(data, models, prior = priorAlt2, clinRel = 0.5, scal = 100,
meanInd = FALSE)
calcBayesEst(data, models, prior = priorAlt3, clinRel = 0.5, scal = 100,
meanInd = FALSE)
calcBayesEst(data, models, prior = priorAlt4, clinRel = 0.5, scal = 100,
meanInd = FALSE)
Run the code above in your browser using DataLab