# This defines a vector and computes the mean
x=c(1,2,3,4,5)
paste0("Standard deviation = ",round(sd(x),2))Bayesian Models in Health Technology Assessment
Preface
Plan of the book (read carefully!)
In many ways, this is a book of two halves: on the one hand, we focus on the philosophy and practice of Bayesian modelling from a very statistical point of view and, to some extent, the content could be used by readers who do not really have a direct interest in healthcare applications. On the other hand, we are concerned with the general topic of “health technology assessment” (HTA – see below and in 4 Introduction to health technology assessment for more details about our framing and definition of this term) as underpinned by Bayesian modelling. Consequently, it is difficult to clearly separate the two components (Bayesian modelling for statistical analysis vs HTA) and in reality we tend to mix them, throughout.
This book is also framed into the concerted effort of bringing the use of R front-and-centre in the HTA community (Baio et al., 2025). In particular, we are staunch proponents of a workflow in which suitable statistical tools are used to perform the basic components of the economic evaluation, in HTA. The focus on Bayesian modelling ties up nicely and directly with this and leverages the ability of R to interact with suitable Bayesian software – we return to this point later.
We start with Part I, which presents the “preliminaries”. Here, we focus heavily on the statistical side of things: 1 Introduction to Bayesian reasoning first introduces the main philosophical ideas that serve as cornerstone for the Bayesian approach to statistical inference. We present fundamental concepts such as the likelihood function, the probabilistic quantification of current uncertainty through a model for the sampling variability (associated with observable or observed data) and a prior distribution for the unobservable parameters. Then, we start exploring the ways in which information can be encoded in the model and computation can be made for Bayesian analysis and in order to propagate uncertainty in model parameters.
In 2 Learning from data: Bayesian computation, we concentrate on the more “proper” Bayesian learning from observed data, in which we combine the two sources of uncertainty/variation into a suitable posterior distribution. We first look into historical and convenient ways to define the existing contextual information (from “vague” and conjugate, to more modern forms of priors, which can regularise the inference, while not exerting undue impact) and we describe how Bayesian computation can be performed for these simpler (and often overly-simplistic!) models. Then, we move towards more general modelling structures, which require more advanced computational tools. Here, we focus on Markov chain Monte Carlo and, specifically, the Gibbs sampling algorithm.
Of course, this is but one of the possible tools that can be used for Bayesian modelling – and others are potentially more modern (notably, Hamiltonian Monte Carlo). We make a conscious choice of concentrating on Gibbs sampling because of the wider context in which we firmly place our book: firstly, most typical problems in HTA are, generally speaking, dealt very efficiently by Gibbs sampling and do not need the use of more advanced (and potentially even more efficient) computation tools. Secondly (but closely related), while HTA has generally become much more technically-minded and skilled over the last decade, it still represents a very heterogeneous field, in which researchers from many different backgrounds operate. With this book, we aim at attracting statisticians, or to train non-statisticians to the practice of Bayesian modelling – but crucially, we try to establish a clear workflow, based on the most established and “safe” tools. For this reason, we think that it is particularly important to provide a substantive and relatively technical introduction to the practice of Bayesian modelling.
This idea propagates to 3 Bayesian software, in which we present a somewhat selective summary of the most important existing tools for the actual performance of Bayesian modelling. Again, while many pieces of software exist, we concentrate on JAGS, which much as its close relative OpenBUGS is specifically designed to run models using Gibbs sampling.
We acknowledge here and in Other Bayesian software that other choices are possible – to some extent, our view is that software is often a proxy for the level of the technical sophistication of the modeller and thus it is really not important whether you decide to use the material described in this book and JAGS to learn about how you could run your (HTA) models, or whether you are confident and comfortable enough to map all the modelling assumptions and code to, say, Stan… The ambition we have with this book is to draw the attention of those who are statistically-numerate and to up-skill those who are not just yet, so that they can then make their own informed decision – as long as they do Bayesian modelling, we are happy!…
4 Introduction to health technology assessment is where we, finally, introduce our core application area for Bayesian modelling. Arguably, the reader has to wait for quite a number of pages before being drawn more specifically into the healthcare economic evaluation context. Even then, we acknowledge that we do so using a very statistical perspective and that, perhaps, readers who come from a more “health economics” background may find our presentation of the basics of HTA lacking of more general context. Again, this is a conscious choice because the main objective is for us to ground the application area within a full Bayesian approach. A broader understanding of the intricacies of HTA is certainly required for modellers wanting to enter (and becoming experts of) this field and we do point the reader to well-known and very worthy textbooks and references, mainly from the non-statistical literature.
We then move to Part II, in which we present a number of modelling frameworks that apply to very many specific cases that constitute, in our view, a large majority of those of interest to a typical HTA modeller. We should hasten to say that we do not claim to be able to describe and consider all the possible problems that a researcher may encounter in HTA – especially because the very definition of this field is quite broad and may have slightly different meanings, depending on the actual context and background. Nonetheless, it is our view that the modelling presented in Chapters 5 Cost-effectiveness analysis with individual-level data–9 Markov models constitute what a modeller aiming to work in the field of “cost-effectiveness analysis for healthcare interventions” should absolutely be familiar with.
5 Cost-effectiveness analysis with individual-level data gives a very lengthy account of how Bayesian modelling can be used for the specific purpose of economic evaluation, when individual-level data (ILD) are available. Historically, this has been associated with “cost-effectiveness analysis alongside clinical trials” in the wider HTA literature and this has served to create a potential distinction between what was often labelled cost-effectiveness or cost-utility analysis and more general decision-analytic models (which we discuss in Chapters 6 Aggregated level data and evidence synthesis, 7 Indirect treatment comparisons and 9 Markov models).
We agree that the general cost-effectiveness analysis using ILD and, possibly, in conjunction with a randomised trial is often a very different enterprise than a fully fledged structure used to represent the benefits and the underlying costs of applying a new healthcare intervention, whose consequences are evaluated over the long run and typically way beyond the inevitably limited duration of an experimental trial.
However, we also believe that there is perhaps a wider statistical context (as opposed to the pure HTA interpretation), in which the separation of the two is maybe less helpful – the modelling is different, depending on the availability of data and the purpose of the analysis; but many of the statistical features can be linked up and used in a wider aim of “decision-making under uncertainty”.
More in details, in 5 Cost-effectiveness analysis with individual-level data we describe the general Bayesian framework to model jointly suitable individual measures of benefits and costs; we start by using a simplified (and, again, overly-simplistic!) version based on Normality and independence and then incrementally move to more complex (and realistic) structures in which these assumptions are relaxed. We also introduce the important topic of model selection in Model selection – this is not fundamentally linked to the use of ILD and we return to it in later chapters.
6 Aggregated level data and evidence synthesis introduces Bayesian modelling for aggregated level data (ALD) and the wider topic of evidence synthesis. This is very prevalent in the decision-analytic context of HTA and one of the most important component of the modellers’ work. In this chapter, we concentrate on the background assumptions in terms of exchangeability – or in other words, the level of similarity and the amount by which we are comfortable pooling information together from different sources. Again, we describe this through examples and worked/annotated computer code to run the analysis, with specific modelling drawn from the HTA context.
Following naturally from this framework, we move in 7 Indirect treatment comparisons to consider indirect treatment comparisons, another ubiquitous topic in cost-effectiveness modelling and one of the cornerstones of HTA. Again, we run through a motivating example, detailing the code and the results of the analysis based on several model specifications and the ability of assessing the validity of several diverse underpinning assumptions (e.g. “fixed” vs “random” effects). 7 Indirect treatment comparisons has fundamental connections with 11 Population adjustment, which expands on the main idea of rebalancing the underlying populations with a view of producing unbiased indirect comparisons.
In 8 Survival analysis in HTA, we give a detailed introduction to the complexity associated with time-to-event modelling, obviously with a specific Bayesian perspective. This chapter is rather long and does include links with other parts of the book (e.g. 9 Markov models or 7 Indirect treatment comparisons) – survival analysis typically underpins cancer studies, which in turn are arguably one of the most important areas of HTA, which makes this topic highly prevalent and another “must-know” for the typical modeller.
This is also one of the few places in the book where we deviate from the “standard” Gibbs sampling analysis and focus on R packages that perform Bayesian modelling using Hamiltonian Monte Carlo (HMC). Because of the inevitable idiosyncrasy of survival data, including censoring and the need for extrapolation beyond the observed time-horizon, computation (and particularly within a Bayesian context) can be complex and thus this is one of the few application areas in which HCM proves to be a much more cost-effective tool, in HTA.
The last topic in Part II is Markov models, described in 9 Markov models. We divide this chapter in two broad components: first we present the basic structure underlying the definition of multistate (Markov) models, typically, but not exclusively, used in discrete times, in the context of HTA. We use a running example to show a reasonably complex and comprehensive Bayesian analysis, based on a number of data sources (and thus linking back to the topics of 6 Aggregated level data and evidence synthesis) and then present in much detail the code used to produce the full results, feeding the wider economic analysis.
Then, we consider another very prevalent case-use, based on a combination of survival modelling and a specific Markov model structure (the “three-state cancer model” of Three-state Markov model). In practice, in either case, running the Markov model effectively amounts to applying some sort of matrix algebra, but we distinguish the process of Bayesian modelling necessary to obtain the “engine” that allows the algebra to work.
Part III of the book has a rather distinct feel to it: while for the first two parts, we have used a consistent alternation between theoretical exposition and practical worked out examples, in Part III we target three specific advanced topics, but focus more on the description of the underlying methodologies and less on giving code and examples. The reason for this choice is two-fold: on the one hand, missing data (which we consider in 10 Missing data and “structural values” in HTA), population adjustment (11 Population adjustment) and the analysis of the value of information (12 Value of information) all embed fundamental complexity from the methodological and computational point of view. On the other hand, as they are very topical themes, we are fully aware of the existence of very recent high quality literature, often with a very strong Bayesian nature.
We saw little value in completely re-inventing the wheel, when there are either excellent specific chapters or even entire textbooks dealing exactly with these topics – notably Gabrio et al. (2025), Phillippo et al. (2025) and Heath et al. (2024). Nonetheless, all of these are, in our view, fundamental tools for HTA modellers and thus we decided to treat them as “further modelling”, for which we provide a description of the basic problems and methodologies and point to the external references for more details (including on the practice of doing them). We also note that all three are fundamental Bayesian tools, which makes them naturally feature in this book.
Finally, we must acknowledge that our intention was never to produce an encyclopaedic account of “all of HTA” (if such thing were even possible…). Therefore, we have made editorial choices not to include chapters on important tools, such as decision trees or discrete event simulations – but also refer interested readers to other very good literature, such as, for example, Green et al. (2025) or Degeling et al. (2025), to remain within the R ecosystem.
How to use this book
We use “callouts” to format specific parts of the text in blocks. The icon next to the block title differentiates the type of blocks. For example, a “note” block is formatted as the following and it typically contains some general or historical comment.
Some text
When we want to highlight something related to computer code, we use the following notation
while blocks containing advanced or technical comments are formatted as the following.
Some text
Finally, blocks in which we present notation or information that the reader should be aware of are formatted as the following.
Some text
When we use computer code, we format it in listing blocks, where comments are prefixed by a “hash” symbol “#”, e.g.
while output or results are shown as in the following.
[1] "Standard deviation = 1.58"
Throughout the book, we switch between “theoretical exposition” of the main concepts and “practical examples”, in which we run through a specific topic or method using data analysis and R code. Examples are clearly signposted using a different font:
Some text here…
and are concluded by a line spanning three quarters of the page, as the following.
Computer configuration
Throughout the book, we use a number of running examples (all detailed in the Preface, immediately after this Preface). The vast majority is based on “real” healthcare economic evaluation and showcase the use of Bayesian modelling. The datasets and annotated code are available at the GitHub repository at https://github.com/giabaio/bmhta-examples. In the spirit of open access and reproducibility, users can also take advantage of GitHub functionalities and “fork” the repository to further annotate, modify and expand the examples, as well as create a “pull request”, so that their changes may be included in the main repository and be helpful for others.
In order to be able to replicate the analyses and run the code, we assume the following computer specification. Firstly and obviously, we need a recent installation of R (full details on installation are available from https://cran.r-project.org/).
In the vast majority of the chapters, we perform the Bayesian analysis using JAGS (full details on the installation are available at the software website: https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/ – see also 3 Bayesian software). In alternative to JAGS, the user may decide to use OpenBUGS (see this webpage https://www.mrc-bsu.cam.ac.uk/software for more information). By and large, there will not be important differences, although we highlight the main ones in Differences between BUGS and JAGS.
For R, we make extensive use of a number of packages. In particular, much of the data “wrangling” and plotting happens using the tidyverse facilities (Wickham et al., 2019), including dplyr (Wickham et al., 2023), tibble (Müller and Wickham, 2025) and ggplot2 (Wickham, 2016). Thus, it is probably a good idea to install the whole tidyverse environment, which we can do by typing into a R terminal the following command:
install.packages("tidyverse")(this can be a lengthy process, as tidyverse is a collection of several packages).
Another necessary package is the interface between R and JAGS – there are several options, but we use throughout the book the package R2jags (Su and Yajima, 2010), which again can be installed using the basic install.packages("R2jags") command. BCEA is used to perform the post-processing of the modelling output, for health economic evaluation and thus useful and used in several examples.
Similarly, a bespoke package bmhe (which is not available in the main R package repositories – see Example 1.4 for specific installation instructions) is often used to post-process the output of the Bayesian modelling. For survival analysis, in 8 Survival analysis in HTA, we use the package survHE and specifically its “add on” survHEhmc (see Using the R package survHE for detailed installation instructions), as well as survextrap, both of which are R front-ends for the rstan package, used to run Hamiltonian Monte Carlo (see Hamiltonian Monte Carlo).
When necessary, other packages are clearly signposted in the relevant part of this book.
Acknowledgements
Special thanks go to Anna Heath, Mark Strong, Chris Jackson, Nicky Welton, Howard Thom, Nathan Green, Natalia Kunst and Antonio Remiro Azocar, who have all been involved in various versions (and might be again, in future ones…) of the summer school “Bayesian methods in health economics” (more details can be found at https://gianluca.statistica.it/teaching/summer-school/).
This book draws heavily on the summer school, both in terms of content and examples, as well as the module I have taught at University College London, for the past few years (STAT0019 – Bayesian methods in health economics), although the material is consolidated, streamlined and updated in here. These friends and colleagues have been instrumental in helping me create some of the material presented here. The students in my module have acted as a focus-group and have guided the narrative, as well as the selection and ordering of the topics I decided to include in the final version.
This is my fourth book with CRC and the brilliant team led by the equally brilliant Rob Calver – I briefly considered pitching it to one of their competitors, who had approached me to see if I had anything I was working on, but the experience had been so great the first three times that I simply had to go back “home” and continue working with CRC. And it was a pleasure to do so!