Tutorials › Biostatistics › Bayesian Model Averaging in Clinical Research

Bayesian Statistics & Clinical Research

Bayesian Model Averaging in Clinical Research

A practical guide to handling model uncertainty with Bayesian Model Averaging, including posterior model probabilities, model-averaged estimates, variable selection, prediction, clinical applications, and a complete worked example.

Advanced 18 min read

What You'll Learn

  • Why model uncertainty matters in clinical research
  • How Bayesian Model Averaging combines multiple plausible models
  • How posterior model probabilities are calculated
  • How model-averaged parameter estimates differ from selecting one model
  • How BMA can be used for variable selection and prediction
  • How Bayesian Model Averaging can be applied in clinical development

Introduction

Clinical research frequently requires investigators to make decisions about which statistical model should be used to describe a dataset.

For example, suppose a clinical trial contains several baseline covariates that could potentially predict treatment response. A logistic regression model might include age, sex, disease severity, biomarker status, prior treatment, and baseline laboratory values.

But which variables actually belong in the model?

A conventional analysis often answers this question by selecting a single model. Variables may be chosen using clinical knowledge, a prespecified model, stepwise selection, information criteria, or another model-selection procedure.

The problem is that model selection itself is uncertain. Two models may both be reasonably compatible with the observed data. If the analysis simply chooses one of them and treats it as though it were known to be the correct model, the uncertainty associated with that selection is ignored.

Key idea: Bayesian Model Averaging does not require the analyst to pretend that one model is unquestionably correct. Instead, it assigns posterior probabilities to plausible models and averages inference across them.

What Is Model Uncertainty?

Suppose we are interested in predicting clinical response using three candidate covariates:

  • baseline disease severity;
  • biomarker status; and
  • age.

There are multiple plausible regression models. For example:

Model Predictors
\(M_1\) Disease severity
\(M_2\) Disease severity + biomarker
\(M_3\) Disease severity + age
\(M_4\) Disease severity + biomarker + age

A conventional model-selection procedure might determine that \(M_2\) is the "best" model.

But the data may not strongly distinguish \(M_2\) from \(M_4\).

If we select \(M_2\) and then proceed as though \(M_2\) were known to be the correct model, we have effectively ignored uncertainty about whether age should also be included.

Model uncertainty is different from parameter uncertainty. Parameter uncertainty asks: Given this model, what values of its parameters are plausible? Model uncertainty asks: Which model should we use in the first place? Bayesian Model Averaging addresses both.

The Bayesian Perspective

Let \(M_k\) denote candidate model \(k\). Bayesian inference assigns a prior probability to each model:

$$ P(M_k) $$

After observing the data \(D\), Bayes' theorem gives the posterior probability of the model:

$$ P(M_k\mid D) = \frac{P(D\mid M_k)P(M_k)} {\sum_{j=1}^{K}P(D\mid M_j)P(M_j)} $$

Here:

  • \(P(M_k)\) is the prior probability of model \(M_k\);
  • \(P(D\mid M_k)\) is the marginal likelihood of the data under model \(M_k\);
  • \(P(M_k\mid D)\) is the posterior probability of model \(M_k\); and
  • \(K\) is the total number of candidate models.

The denominator ensures that the posterior model probabilities sum to one.

$$ \sum_{k=1}^{K}P(M_k\mid D)=1 $$

What Is Bayesian Model Averaging?

Once posterior probabilities have been assigned to the candidate models, Bayesian Model Averaging combines the model-specific inferences using those posterior probabilities as weights.

Suppose the parameter of interest is \(\theta\). Under model \(M_k\), the posterior mean is:

$$ E(\theta\mid D,M_k) $$

The Bayesian Model Averaging estimate is then:

$$ E(\theta\mid D) = \sum_{k=1}^{K} E(\theta\mid D,M_k) P(M_k\mid D) $$

In words:

1
Specify candidate models. Define a set of clinically and statistically plausible models.
2
Assign prior model probabilities. Specify how plausible each model is before seeing the current data.
3
Calculate posterior model probabilities. Update model probabilities using the observed data.
4
Perform inference within each model. Estimate the parameter or predictive quantity under each candidate model.
5
Average across models. Weight each model-specific result by its posterior model probability.

Why Not Just Choose the Best Model?

Suppose two models have posterior probabilities of 0.55 and 0.45. A model-selection approach would choose the first model.

But that decision discards almost half of the posterior probability assigned to the second model.

Bayesian Model Averaging instead retains the uncertainty:

$$ \text{BMA estimate} = 0.55(\text{estimate under }M_1) + 0.45(\text{estimate under }M_2) $$

This can produce more realistic inference when several models remain plausible.

Important distinction: BMA is not simply "averaging regression coefficients." The averaging weights are determined by posterior model probabilities, and the interpretation of a parameter must account for the fact that the parameter may not even exist in every candidate model.

Posterior Inclusion Probability

One of the most useful quantities in Bayesian variable selection is the posterior inclusion probability.

Suppose \(X_j\) is a candidate predictor. Its posterior inclusion probability is:

$$ P(X_j\text{ included}\mid D) = \sum_{k:X_j\in M_k} P(M_k\mid D) $$

This quantity answers:

How much posterior probability is assigned to models containing this covariate?

For example, suppose biomarker status appears in models whose posterior probabilities sum to 0.82. Then:

$$ P(\text{biomarker included}\mid D)=0.82 $$

This means that, under the specified model space and priors, there is substantial posterior support for including the biomarker.

It is not the same statement as saying that there is an 82% probability that the biomarker has a clinically meaningful effect.

Posterior Model Odds and Bayes Factors

For two competing models, posterior odds can be written as:

$$ \frac{P(M_1\mid D)} {P(M_2\mid D)} = \frac{P(D\mid M_1)} {P(D\mid M_2)} \times \frac{P(M_1)} {P(M_2)} $$

The first term is the Bayes factor:

$$ BF_{12} = \frac{P(D\mid M_1)} {P(D\mid M_2)} $$

Thus:

$$ \text{Posterior Odds} = \text{Bayes Factor} \times \text{Prior Odds} $$

This provides an intuitive connection between Bayesian model comparison and Bayesian Model Averaging.

A Clinical Research Example

Consider a randomized clinical trial evaluating a new treatment for a chronic disease. The primary endpoint is a binary clinical response at Week 24. Investigators are interested in estimating the probability of response for a future patient and in understanding which baseline characteristics contribute to response.

Three candidate predictors are considered:

Variable Description
\(X_1\) Baseline disease severity
\(X_2\) Biomarker-positive status
\(X_3\) Age

Rather than assuming that all three variables must be included, the analyst considers all eight possible subsets of these predictors.

Because there are three candidate predictors:

$$ 2^3=8 $$

candidate models are possible.

The Eight Candidate Models

Model Severity Biomarker Age
\(M_1\) No No No
\(M_2\) Yes No No
\(M_3\) No Yes No
\(M_4\) No No Yes
\(M_5\) Yes Yes No
\(M_6\) Yes No Yes
\(M_7\) No Yes Yes
\(M_8\) Yes Yes Yes

Suppose the prior probability is distributed uniformly across the eight models:

$$ P(M_k)=\frac{1}{8} $$

This is one possible prior specification. Other prior structures can be used when there is stronger prior knowledge about which variables are likely to matter.

Posterior Model Probabilities

After fitting the eight models and calculating their marginal likelihoods, suppose the posterior probabilities are:

Model Predictors Posterior Probability
\(M_1\) None 0.03
\(M_2\) Severity 0.18
\(M_3\) Biomarker 0.04
\(M_4\) Age 0.02
\(M_5\) Severity + biomarker 0.39
\(M_6\) Severity + age 0.11
\(M_7\) Biomarker + age 0.05
\(M_8\) Severity + biomarker + age 0.18

The probabilities sum to:

$$ 0.03+0.18+0.04+0.02+0.39+0.11+0.05+0.18=1.00 $$

The single most probable model is \(M_5\), with posterior probability 0.39.

But \(M_5\) has only a 39% posterior probability. That means selecting \(M_5\) as though it were unquestionably correct would ignore 61% of the posterior probability assigned to other models.

This is exactly the situation in which BMA is useful. There is a clear leading model, but substantial posterior uncertainty remains about the appropriate model specification.

Calculating Posterior Inclusion Probabilities

Consider baseline disease severity. Severity appears in models:

  • \(M_2\): 0.18
  • \(M_5\): 0.39
  • \(M_6\): 0.11
  • \(M_8\): 0.18

Therefore:

$$ P(\text{severity included}\mid D) = 0.18+0.39+0.11+0.18 = 0.86 $$

The posterior inclusion probability for disease severity is therefore:

$$ \boxed{0.86} $$

Now consider biomarker status. It appears in \(M_3\), \(M_5\), \(M_7\), and \(M_8\):

$$ P(\text{biomarker included}\mid D) = 0.04+0.39+0.05+0.18 = 0.66 $$

Finally, age appears in \(M_4\), \(M_6\), \(M_7\), and \(M_8\):

$$ P(\text{age included}\mid D) = 0.02+0.11+0.05+0.18 = 0.36 $$
Predictor Posterior Inclusion Probability
Baseline severity 0.86
Biomarker 0.66
Age 0.36

The results suggest that disease severity has the strongest posterior support for inclusion, followed by biomarker status. Age has substantially less posterior support.

Model-Averaged Regression Coefficients

A subtle issue arises when averaging regression coefficients. Suppose the biomarker coefficient is estimated under each model containing the biomarker. A model-averaged coefficient can be constructed by assigning a value of zero to models that exclude the variable and weighting the coefficient by the posterior model probability.

For a predictor \(X_j\), this gives:

$$ E(\beta_j\mid D) = \sum_{k=1}^{K} \beta_{jk}P(M_k\mid D) $$

where:

$$ \beta_{jk}=0 $$

for models that do not contain \(X_j\).

This is sometimes called model averaging with zero coefficients. It naturally reflects uncertainty about whether the variable belongs in the model.

A Worked Coefficient Example

Suppose the biomarker coefficient is estimated as follows:

Model Posterior Probability Biomarker Coefficient
\(M_1\) 0.03 0
\(M_2\) 0.18 0
\(M_3\) 0.04 0.80
\(M_4\) 0.02 0
\(M_5\) 0.39 0.72
\(M_6\) 0.11 0
\(M_7\) 0.05 0.61
\(M_8\) 0.18 0.69

The model-averaged coefficient is:

$$ \begin{aligned} E(\beta_{\text{bio}}\mid D) &= (0.03)(0) +(0.18)(0) +(0.04)(0.80)\\ &\quad +(0.02)(0) +(0.39)(0.72) +(0.11)(0)\\ &\quad +(0.05)(0.61) +(0.18)(0.69) \end{aligned} $$

which gives approximately:

$$ \boxed{E(\beta_{\text{bio}}\mid D)\approx0.54} $$

Notice that the model-averaged coefficient is smaller than the coefficient in any individual model containing the biomarker.

That occurs because some posterior probability is assigned to models in which the biomarker is absent and its coefficient is therefore zero.

Conditional vs. Unconditional Effects

This distinction is particularly important when reporting BMA results. A coefficient conditional on inclusion answers:

Among models in which the variable is included, what is the posterior effect size?

An unconditional model-averaged coefficient answers a different question:

After accounting for uncertainty about whether the variable belongs in the model, what is the overall posterior average effect?

Both can be useful, but they should not be confused.

Bayesian Model Averaging for Prediction

Prediction is one of the most natural applications of BMA. Suppose we want to predict the probability of response for a future patient with covariate vector \(x\). Under model \(M_k\), the posterior predictive probability is:

$$ P(Y_{\text{new}}=1\mid x,D,M_k) $$

BMA averages the prediction over the posterior distribution of models:

$$ P(Y_{\text{new}}=1\mid x,D) = \sum_{k=1}^{K} P(Y_{\text{new}}=1\mid x,D,M_k) P(M_k\mid D) $$

This is an important advantage of BMA. Rather than making a prediction conditional on one selected model, the prediction accounts for uncertainty about which model generated the data.

Clinical Trial Applications

Bayesian Model Averaging can arise in several areas of clinical research.

1. Prognostic modeling

When numerous baseline characteristics could predict an outcome, BMA can incorporate uncertainty about which predictors are genuinely useful.

2. Treatment-effect heterogeneity

Suppose treatment effect may depend on disease severity, biomarker status, baseline risk, and previous treatment. Rather than committing prematurely to a single interaction structure, BMA can average across plausible models.

3. Survival analysis

Different covariate structures can be considered in proportional hazards, accelerated failure-time, or other survival models. BMA can account for uncertainty about the prognostic model while producing model-averaged inference or prediction.

4. Dose-response modeling

Dose-response analyses frequently involve uncertainty about the appropriate functional form. Potential models may include:

  • linear dose-response;
  • quadratic dose-response;
  • Emax models;
  • sigmoid Emax models; and
  • other nonlinear structures.

BMA provides a framework for averaging predictions or derived quantities across these candidate models.

5. Historical borrowing and prior-data models

When historical control data are available, analysts may consider multiple models for the degree of similarity between historical and current patients. BMA can be used when several borrowing structures are considered plausible.

6. Biomarker development

In exploratory biomarker analyses, many candidate predictors or interactions may be plausible. BMA can provide posterior inclusion probabilities rather than relying entirely on a single selected model.

BMA vs. Stepwise Selection

Feature Stepwise Selection Bayesian Model Averaging
Produces one selected model Yes No
Accounts for model uncertainty Generally no Yes
Uses model probabilities No Yes
Can calculate inclusion probabilities No Yes
Can average predictions Not inherently Yes
Requires prior distributions No Yes
Computational burden Usually lower Potentially higher

The important conceptual difference is that stepwise selection attempts to identify one model, whereas BMA treats the model itself as uncertain.

BMA vs. Bayesian Variable Selection

The terms Bayesian variable selection and Bayesian Model Averaging are closely related but are not identical.

Bayesian variable selection is the broader problem of determining which predictors should be included. BMA is a way of performing inference while averaging over the resulting model uncertainty.

For a small number of predictors, it may be possible to enumerate every possible model. With \(p\) candidate variables, the number of possible subsets is:

$$ 2^p $$

For example:

Candidate Variables Possible Models
5 32
10 1,024
20 1,048,576
30 1,073,741,824

This exponential growth quickly makes exhaustive enumeration impractical.

Computational implication: For larger model spaces, Bayesian Model Averaging often requires stochastic search methods such as Markov Chain Monte Carlo rather than evaluating every possible model explicitly.

Bayesian Model Averaging and MCMC

When the number of candidate models becomes very large, MCMC can be used to explore the model space. One approach is Markov Chain Monte Carlo Model Composition (MC³).

The algorithm moves between candidate models, proposing additions, removals, or changes to predictors. Models that have higher posterior probability are visited more frequently.

1
Start with a model. For example, begin with an intercept-only model.
2
Propose a neighboring model. Add, remove, or modify one predictor.
3
Calculate the acceptance probability. The proposed model is evaluated relative to the current model.
4
Move through model space. The chain preferentially visits models with greater posterior support.
5
Estimate posterior model quantities. Model frequencies can be used to estimate posterior model probabilities and posterior inclusion probabilities.

R Implementation

For a small model space, the conceptual workflow can be implemented by fitting the candidate models and combining their posterior probabilities. A simplified illustration is:

# Candidate models
models <- list(
  M1 = response ~ 1,
  M2 = response ~ severity,
  M3 = response ~ biomarker,
  M4 = response ~ age,
  M5 = response ~ severity + biomarker,
  M6 = response ~ severity + age,
  M7 = response ~ biomarker + age,
  M8 = response ~ severity + biomarker + age
)

# Each model would be fit under a Bayesian framework.
# Posterior model probabilities would then be obtained.

posterior_model_prob <- c(
  0.03, 0.18, 0.04, 0.02,
  0.39, 0.11, 0.05, 0.18
)

sum(posterior_model_prob)
# 1

# Posterior inclusion probability for severity
pip_severity <- sum(
  posterior_model_prob[c(2, 5, 6, 8)]
)

pip_severity
# 0.86

In practice, specialized Bayesian model-selection packages can perform the model fitting, posterior model exploration, and averaging. The exact implementation depends on the likelihood, prior distributions, model space, and whether the analysis concerns regression coefficients, prediction, survival outcomes, dose-response models, or another clinical endpoint.

A Simple BMA Calculation in R

Suppose model-specific posterior means for a parameter are available.

model_prob <- c(
  0.03, 0.18, 0.04, 0.02,
  0.39, 0.11, 0.05, 0.18
)

beta_biomarker <- c(
  0,
  0,
  0.80,
  0,
  0.72,
  0,
  0.61,
  0.69
)

bma_beta <- sum(
  model_prob * beta_biomarker
)

bma_beta
# approximately 0.54

The calculation is simply the weighted posterior average:

$$ \sum_k P(M_k\mid D)\, E(\beta\mid D,M_k) $$

The important point is not the arithmetic. The important point is that the inference explicitly carries forward uncertainty about the model.

Model Averaging for Treatment Effects

BMA can also be used when the quantity of interest is a treatment effect. Suppose the treatment effect may depend on baseline disease severity. We could consider models such as:

  • treatment only;
  • treatment + severity;
  • treatment + biomarker;
  • treatment + severity + biomarker;
  • treatment + severity × treatment; and
  • other prespecified clinically plausible structures.

Each model produces a posterior distribution for the treatment effect. BMA then produces a model-averaged posterior distribution:

$$ p(\theta\mid D) = \sum_{k=1}^{K} p(\theta\mid D,M_k)P(M_k\mid D) $$

This equation is particularly important. BMA does not merely average posterior means. It can average the entire posterior distribution.

As a result, the model-averaged posterior can incorporate both:

  • within-model parameter uncertainty; and
  • between-model uncertainty.
This is one of the strongest conceptual advantages of BMA. The final posterior distribution can be wider than the posterior obtained from a single selected model because it incorporates uncertainty about the model itself.

Posterior Predictive Distribution

For clinical prediction, the model-averaged posterior predictive distribution is often more relevant than a model-averaged regression coefficient. For a future outcome \(Y_{\text{new}}\):

$$ p(Y_{\text{new}}\mid D) = \sum_{k=1}^{K} p(Y_{\text{new}}\mid D,M_k) P(M_k\mid D) $$

This equation says:

A
Calculate the predictive distribution under each plausible model.
B
Weight each prediction according to posterior model probability.
C
Combine the predictions into a single model-averaged predictive distribution.

Advantages of Bayesian Model Averaging

  • Accounts for model uncertainty. Inference does not depend entirely on one selected model.
  • Provides posterior inclusion probabilities. These quantify the posterior support for individual predictors.
  • Improves predictive uncertainty assessment. Model uncertainty can be incorporated into predictions.
  • Provides a coherent Bayesian framework. Model uncertainty and parameter uncertainty can be propagated through the same probabilistic framework.
  • Can reduce dependence on arbitrary model-selection thresholds. There is no requirement to declare one model definitively "correct."

Limitations and Practical Considerations

BMA is powerful, but it is not automatically superior in every clinical analysis.

1. The model space matters

BMA averages over the models that you specify. If important models are excluded from the candidate set, BMA cannot average over them.

BMA does not eliminate modeling assumptions. It makes model uncertainty explicit within the chosen model space.

2. Prior model probabilities matter

Posterior model probabilities depend on both the data and the prior model probabilities. When data are weakly informative, prior assumptions can have a meaningful influence.

3. Computational complexity can be substantial

With \(p\) predictors, the number of possible subset models is \(2^p\). Large model spaces may require MCMC or other stochastic search strategies.

4. Interpretation can be more complicated

A model-averaged coefficient does not have exactly the same interpretation as a coefficient from a prespecified regression model. Clinical interpretation should distinguish conditional effects, unconditional effects, posterior inclusion probabilities, and predictive quantities.

5. Causal inference requires additional care

BMA is fundamentally a model-averaging framework. It does not automatically convert an observational regression analysis into a valid causal analysis. Variables should be selected and modeled according to the causal question, study design, and relevant assumptions.

When Should a Clinical Statistician Consider BMA?

BMA is particularly attractive when all of the following are true:

1
Multiple models are scientifically plausible.
2
The data do not clearly identify one model.
3
Model uncertainty could materially affect inference or prediction.
4
A defensible prior structure can be specified.
5
The model space can be computationally explored.

What BMA Does Not Mean

Several common interpretations of BMA are incorrect.

Misconception Correct Interpretation
BMA chooses the best model BMA averages inference over plausible models
BMA ignores model selection BMA explicitly models uncertainty about model selection
A 0.80 inclusion probability means an 80% chance of a clinically important effect It means 80% posterior probability is assigned to models containing the variable
BMA eliminates prior assumptions BMA requires prior assumptions about models and parameters
BMA averages only point estimates BMA can average entire posterior distributions and predictive distributions

A Practical Clinical Workflow

For a real clinical analysis, the workflow can be summarized as follows.

1
Define the clinical estimand. Decide whether the goal is prediction, prognostic modeling, treatment-effect estimation, biomarker selection, dose-response modeling, or another objective.
2
Define the candidate model space. Include scientifically defensible models rather than every mathematically possible model without consideration of clinical context.
3
Specify parameter and model priors. Document the assumptions before examining the results.
4
Fit or explore the candidate models. For small model spaces, exhaustive enumeration may be possible. Larger spaces may require MCMC or another search strategy.
5
Examine posterior model probabilities. Determine whether the data strongly support one model or leave substantial model uncertainty.
6
Calculate posterior inclusion probabilities. These provide a useful summary of support for individual predictors.
7
Perform model-averaged inference. Average parameters, predictions, or other quantities over the posterior model distribution.
8
Conduct sensitivity analyses. Evaluate whether conclusions are robust to reasonable changes in prior distributions and model-space specifications.

Key Takeaways

Bayesian Model Averaging provides a principled way to handle model uncertainty. Instead of selecting one model and treating it as known, BMA assigns posterior probabilities to competing models and averages inference across them.

The central equation is:

$$ p(\theta\mid D) = \sum_{k=1}^{K} p(\theta\mid D,M_k) P(M_k\mid D) $$

The most important practical concepts are:

  • Posterior model probability measures how much posterior support a candidate model receives.
  • Posterior inclusion probability measures how much posterior probability is assigned to models containing a particular predictor.
  • Model-averaged inference incorporates uncertainty about which model is appropriate.
  • Model-averaged prediction incorporates model uncertainty into predictions for future patients.
  • BMA does not remove modeling assumptions. The candidate model space and prior distributions remain important.

For clinical statisticians, the most important conceptual shift is simple:

$$ \boxed{ \text{Do not ask only "Which model is best?"} } $$ $$ \boxed{ \text{Ask "How uncertain am I about the model?"} } $$

Bayesian Model Averaging turns that second question into a formal statistical analysis.

References

Hoeting, J.A., Madigan, D., Raftery, A.E., & Volinsky, C.T. (1999). Bayesian model averaging: A tutorial. Statistical Science, 14(4), 382–417.

Madigan, D. & Raftery, A.E. (1994). Model selection and accounting for model uncertainty in graphical models using Occam's window. Journal of the American Statistical Association, 89, 1535–1546.

Raftery, A.E., Madigan, D., & Hoeting, J.A. (1997). Bayesian model averaging for linear regression models. Journal of the American Statistical Association, 92, 179–191.

Hinne, M., Gronau, Q.F., van den Bergh, D., & Wagenmakers, E.J. (2020). A conceptual introduction to Bayesian model averaging. Advances in Methods and Practices in Psychological Science.

George, E.I. & McCulloch, R.E. (1993). Variable selection via Gibbs sampling. Journal of the American Statistical Association, 88, 881–889.