BCEs0: An R package for Bayesian Cost-Effectiveness models in the presence of structural zero costs

BCEs0 is a R library specifically designed to run a full Bayesian cost-effectiveness analysis of individual data in the presence of structural zero costs for some subjects. The framework assumes that data are available for n0 and n1 subjects, that are respectively given some treatment t0 and t1. Typically, costs and clinical benefits should be modelled assuming some form of correlation. But in the case of structural zeros, the model gets even more complicated, since the population average costs need to be computed accounting for the fact that there are two "components" in the population - one made by the individuals who actually accrue some positive cost and the other by the subjects that have no cost.

The package implements the framework developed here (the published paper is freely available under Open Access agreement, while a working paper with a slightly different version of the model is available from here). Basically, there are three modules; the first one (the green square in the graph below) is a pattern mixture model (in the language of missing data) for the chance of each subject being associated with zero costs. The indicator dit takes value 1 if the i-th subject in treatment group t is observed to have 0 costs, and 0 otherwise. The probability \pi_{t}it is modelled as a function of an overall average value \beta_{0t}0t (and possibly some covariates). The second module (in the red rectangle) is a marginal model for the costs, whose parameters depend on the value taken by dit. When the indicator is 1, then we imply a degenerate distribution on the costs (which ensures that the average cost is estimated to be identically 0). When it is 0, then we imply a non-degenerate distribution (eg a Gamma or a log-Normal). In fact, the population average cost \mu_{ct}ct is obtained as a mixture of the two components \psi_{t1}t0 (coming from the non-degenerate distribution) and \psi_{t1}t1=0, with weights equal to the estimated probability associated with each of the two classes. Finally, the third module (in the blue square) is the conditional model for the measure of effectiveness given the costs. This is defined in terms of a generalised linear regression on the conditional mean \psi_{t1}t0 which can be re-scaled to obtain the population average for the measure of effectiveness \mu_{ct}et.


A discussion of the main changes from version 1.0 to 1.1 is here, in the blogThe package has a main function bces0 which takes as arguments
  • data: a named list with arguments 
    • e0, e1 (the individual values of the measure of effectiveness under either treatment)
    • c0, c1 (the individual values of the costs under either treatment)
    • H.psi (a vector including the upper limit for the default Uniform prior for the mean of the cost non-degenerate distribution. The first value is used for t=0, while the second is used for t=1)
    • H.zeta (a vector including the upper limit for the default Uniform prior for the standard deviation of the cost non-degenerate distribution. The first value is used for t=0, while the second is used for t=1)
    • X0 (an optional matrix including some individually measured covariates under treatment t=0 to be used in the pattern-mixture model - if available)
    • X1 (an optional matrix including some individually measured covariates under treatment t=1 to be used in the pattern-mixture model - if available)
  • dist.c: a string specifying the assumed distribution for the cost variable. Possible choices are
    • "gamma" (Gamma distribution - generally used to model costs)
    • "logn" (log-Normal distribution - also generally used to model costs)
    • "norm" (Normal distribution - not recommended usually, but could be useful if the original cost variable has been pre-processed and transformed in some suitable scale to induce at least approximate normality)
  • dist.e: a string specifying the assumed distribution for the effectiveness variable. Possible choices are
    • "beta" (Beta distribution - can be used to model effectiveness measures defined in [0;1], eg QALYs measured in a one-year horizon)
    • "gamma" (Gamma distribution - can be used to model effectiveness measures defined as positive quantities, eg QALYs over a long period of time)
    • "bern" (Bernoulli distribution - can be used to model effectiveness measures defined as binary variables, eg dead/alive)
    • "norm" (Normal distribution - again not recommended, usually, but could be useful if the original effectiveness variable has been pre-processed and transformed in some suitable scale to induce at least approximate normality)
  • w,W: The values for the parameters w and W which are used to induce a degenerate distribution for the component with null costs. The default choice is w=W=0.000001. These have no real impact on the model convergence and economic results (provided that they induce a suitable degenerate prior with mean and sd close enough to 0), but may have an impact on measures of model fit (eg DIC), which may be used for model averaging and structural probabilistic sensitivity analysis
  • n.iter: the number of MCMC iterations to be run (default value = 10000)
  • n.burnin: the number of MCMC iterations to be discarded in the burn-in period (default value = 5000)
  • n.chains: the number of Markov chains to be used in the process
  • robust: a logical value (default TRUE) to indicate whether a robust (Cauchy) specification should be used for the regression coefficients in the pattern model. If FALSE, then a minimally informative Normal distribution is applied
  • model.file: a string with the name of the .txt to which the JAGS code representing the assumptions specified by the user is written. The default choice is model.txt in the current working directory
bces0 will write a JAGS model encoding the distributional assumptions specified by the user for the costs and effectiveness measure and save it into a file model.txt. This can be then used as a "template" and can be modified to account for more complex models (eg including structured effects or different distributional assumptions). If no covariates are specified in data, then only the intercepts \beta_{0t}0t will be used to estimate the probability of zero cost, \pi_{t}it. If the covariates are given in the data list, bces0 will check if they are centered and if not will compute and use Z^t_{ij} = X^t_{ij}- E[X^t_{ij}] in the pattern mixture model. Then it will use the R library R2jags to run the MCMC model in background using JAGS (which of course needs to be installed - chapter 4 of BMHE describes in details how to make Bayesian analysis using R and JAGS). The results of the Bayesian model are then stored in an R object which is made available to the current workspace and can be then used to perform a full economic analysis, for example using BCEA.

The model file is saved in the current working directory and can then be edited to specify different models/assumptions (eg including individual structured effects or different prior distributions. A R style manual for the package, describing the main characteristics of the package, can be found here. A video of a presentation I gave at the University of Las Palmas (Gran Canaria, Spain) is here.

BCEs0 is now available from CRAN - to install type install.packages("BCEs0") in your R terminal. MORE DESCRIPTION, EXAMPLES AND INSTRUCTIONS TO COME! Version 1.1 is the current one.