Learn R Programming

DoseFinding (version 0.5-5)

calcBayesEst: Calculates posterior estimates and posterior model probabilities for a set of candidate models.

Description

Calculates posterior means (or a variant of the posterior mode, see Details below) and the posterior model probabilities for a set of candidate models. The data are assumed to be homoscedastic normally distributed and no additional covariates are allowed. The methodology is described in Bornkamp et al. (2011), see below for the reference.

Usage

calcBayesEst(data, models, prior, bnds = getBnds(mD = max(data$dose)), 
             weights = NULL, numPar = c(100, 1597), meanInd = TRUE,
             clinRel, scal = NULL, off = NULL)

Arguments

data
Data frame containing the dose and the response data. The code assumes the columns to be named "dose" and "resp".
models
models list (as in MCPMod function). Note that for this function only the models "linear", "linlog", "emax", "exponential", "logistic" and "betaMod" are allowed.
prior
List with the following entries a, d, m (vector of length 2), V (2x2 matrix), S components of prior list: a,d,m,V determine the normal inverse gamma prior for baseline, maximum effect and sigma2 see O'Hagan and Forster (p., 305, 2006) or Bornkamp et
bnds
List of parameter bounds for models (see getBnds for details)
weights
prior model probabilities: in same order as models in list. By default equal prior model probabilities are assumed.
numPar
vector with two entries (number of glp points for 1d and 2d integration)
meanInd
indicator, whether posterior means (meanInd = TRUE) or the posterior mode (meanInd = FALSE) should be calculates. See Details for more information
clinRel
Clinical relevance
scal
scale parameter for beta model
off
Offset parameter for linlog model

Value

  • Returns a list with the Bayesian parameter estimates, each list entry corresponds to one model. The list has an attribute weights, which contains the calculated model probabilities. In addition there is an attribute existsMED containing a logical vector indicating, whether the MED estimate exists for the given dose-response parameter estimates.

Details

When meanInd = FALSE, the code finds the mode of the marginal distribution of the non-linear parameters. Then it calculates the posterior mode of the linear parameters given the mode of the non-linear parameters.

References

Bornkamp, B., Bretz, F., Dette, H. and Pinheiro, J. C. (2011). Response-Adaptive Dose-Finding under model uncertainty, to appear in Annals of Applied Statistics

O'Hagan, A. and Forster, J. (2006) Kendall's Advanced Theory of Statistics 2B: Bayesian Inference, 2nd edition, Arnold, London

Examples

Run this code
# 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