- Introduced by
- Building on Jeffreys (1961) and developed formally for regression/ANCOVA by Rouder & Morey (2012)
- Year
- 2012 (formalized; Bayesian general linear models since 1960s)
- Type
- Bayesian parametric covariate-adjusted group comparison
- Family
- Classical statistics
What does it do?
Bayesian Analysis of Covariance (Bayesian ANCOVA) places prior distributions on group effects and covariate slopes, then updates them with the observed data to obtain posterior distributions and Bayes factors.
It quantifies evidence for a group difference on a continuous outcome after adjusting for one or more continuous covariates, without relying on p-value thresholds. The default Bayes factors on which it is commonly based were developed for multiple regression (Rouder & Morey, 2012).
The intuition behind the method
Classical ANCOVA asks 'Is the group difference statistically significant after partialling out the covariate?' and gives a binary yes/no via a p-value. Bayesian ANCOVA instead asks 'How strongly does the data support a group difference versus no difference?' and returns a Bayes factor alongside a full posterior distribution over effect sizes. This lets you express evidence on a continuum — including evidence for the null — and naturally incorporate prior knowledge about plausible effect magnitudes.
History
Analysis of covariance as a classical technique is usually traced to R. A. Fisher's experimental design work in the 1930s. The Bayesian treatment of linear models draws on Jeffreys' 1961 book on prior distributions and on Zellner's g-prior (1986). Liang et al. (2008) developed computationally attractive default Bayes factors based on mixtures of g-priors for regression, and Rouder and Morey (2012) provided guidance, context and a web applet for using them. Software implementations of these defaults, such as JASP and the BayesFactor R package, have made the approach available to applied researchers.
When to use it
Choose Bayesian ANCOVA when you compare two or more groups on a continuous outcome while adjusting for one or more continuous covariates, and you want evidence for or against a group effect rather than only a significance decision. It is most useful when samples are small or moderate and a p-value gives limited information, when you need to state positive evidence for no group difference, or when you want to combine prior knowledge with new data. Do not use it when the covariates are categorical; a Bayesian factorial ANOVA, which treats the covariate as a categorical factor, is the appropriate model in that case. Do not use it without deciding on priors, because results depend on that choice and a sensitivity analysis should be planned. The model assumes independent observations, normal residuals with equal variance across groups, a linear covariate effect, and homogeneity of regression slopes (the same slope in every group). Check these with residual plots, Q-Q plots, group-wise residual spread, and a Bayes factor comparing models with and without the group-by-covariate interaction before interpreting adjusted group means.
Limitations and considerations
- Results depend on prior specification; default priors may be inappropriate for some research contexts.
- More computationally intensive than classical ANCOVA, especially with MCMC-based estimation.
- Bayes factors can be sensitive to prior scale choices, requiring sensitivity analyses.
- Requires familiarity with Bayesian concepts (posterior, prior, Bayes factor) for correct interpretation.
- Software implementations (JASP, BayesFactor R package) vary in prior defaults, complicating direct comparison across studies.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Provides a Bayes factor that can quantify evidence for the null hypothesis as well as the alternative, which conventional significance testing cannot do (Rouder & Morey, 2012).
- Returns full posterior distributions, enabling richer inference including credible intervals and probability statements about effect sizes.
- Can incorporate prior knowledge from previous studies, improving estimation in small samples.
- The posterior from one dataset can serve as the prior for later data, so evidence can be accumulated across sequential analyses.
- Transparently separates the contribution of the group factor from the covariate adjustment.
Applications
- Comparing educational intervention groups on post-test scores after adjusting for pre-test scores.
- Assessing drug treatment effects on a clinical endpoint after controlling for baseline severity.
- Evaluating marketing campaign conditions on customer spending after removing income effects.
- Reanalyzing published ANCOVA results with Bayesian methods to assess the strength of original evidence.
- Accumulating evidence across multiple small experiments through sequential Bayesian updating.
- Comparing cognitive task performance across groups after adjusting for age or IQ.
How it works
How it works
The linear model expresses each observation as the sum of an overall mean, a group effect, a covariate slope times the covariate value, and Gaussian error. This is the same structural equation as classical ANCOVA. Its assumptions are: independent observations, normally distributed residuals with equal variance across groups, a linear relationship between covariate and outcome, and a common covariate slope across groups. Check them with residual-versus-fitted plots, Q-Q plots of residuals, a comparison of residual spread by group, and a model that adds a group-by-covariate interaction.
Formula
y_{ij} = \mu + \tau_j + \beta x_{ij} + \varepsilon_{ij},\quad \varepsilon \sim \mathcal{N}(0,\sigma^2)Prior distributions are placed on all unknown parameters. The default Bayes factors for regression-type designs use Cauchy-type priors on standardized effects (group effects and covariate slopes), embedded in mixtures of g-priors as developed by Liang et al. (2008) and explained for applied use by Rouder & Morey (2012), together with a Jeffreys-type prior on the error variance. The prior scale determines how large an effect is expected under the alternative. If genuine domain knowledge exists, informative priors can replace the defaults and should be documented alongside results.
The Bayes factor BF10 compares the marginal likelihood of the model including the group factor (M1) to the model without it (M0, covariate only). A common convention (after Jeffreys) reads BF10 of 1 to 3 as anecdotal evidence for M1, 3 to 10 as moderate, 10 to 30 as strong, and above 30 as very strong. For evidence for M0, mirror these values: BF10 between 1/3 and 1 is anecdotal, 1/10 to 1/3 moderate, 1/30 to 1/10 strong, and below 1/30 very strong. These labels are conventions, not hard thresholds, and anecdotal values should be reported as inconclusive. The same logic applies to testing the covariate slope.
Formula
BF_{10} = \frac{p(\mathbf{y} \mid M_1)}{p(\mathbf{y} \mid M_0)}For the default priors, the Bayes factor reduces to a one-dimensional numerical integral, so it can be computed quickly. Posterior summaries for the group effects and covariate slope are typically obtained by MCMC sampling or analytic approximation. Summaries include posterior means, medians, and 95% highest-density intervals (HDI) for each parameter. The HDI is the Bayesian analogue of a confidence interval but carries a direct probability interpretation given the model and prior.
Formula
p(\tau_j, \beta \mid \mathbf{y}) \propto \int p(\mathbf{y} \mid \tau_j, \beta,\sigma^2)\, p(\tau_j)\, p(\beta)\, p(\sigma^2)\, d\sigma^2Report the Bayes factor, posterior mean group difference adjusted for the covariate, its 95% HDI, and the standardized effect size delta (analogous to Cohen's d) with its posterior distribution. Sensitivity analyses varying the prior scale should accompany any strong conclusions.
Common pitfalls
- Interpreting BF10 as a p-value — a BF10 of 3 does not mean 97% confidence in the alternative; it means the data are 3 times more likely under M1 than M0.
- Omitting sensitivity analyses for prior scale — a result that changes substantially with modest prior changes should be reported as inconclusive.
- Ignoring the homogeneity-of-regression-slopes assumption, which is as critical here as in classical ANCOVA.
- Treating the Bayesian ANCOVA as assumption-free — normality of residuals and linearity of the covariate relationship are still required.
- Using covariates that are not reliably measured, since measurement error in the covariate biases group-effect estimates in both classical and Bayesian ANCOVA.
Frequently asked questions
How do I choose the prior for Bayesian ANCOVA?
The most common default is a Cauchy-type prior on standardized effect sizes within a mixture of g-priors (Liang et al., 2008; Rouder & Morey, 2012), available in JASP and the BayesFactor R package. Check the default prior scale in the software you use, state it when reporting, and vary it in a sensitivity analysis. If domain knowledge suggests a specific effect magnitude, you can change the scale parameter, but report which prior you used.
What counts as strong evidence in the Bayes factor?
A common convention after Jeffreys: BF10 between 1 and 3 is anecdotal, 3 to 10 moderate, 10 to 30 strong, above 30 very strong evidence for M1. The scale mirrors for M0: BF10 between 1/3 and 1 is anecdotal, 1/10 to 1/3 moderate, 1/30 to 1/10 strong, below 1/30 very strong evidence for no group difference. These are conventions, not hard thresholds.
Can I use Bayesian ANCOVA with more than two groups?
Yes. The model extends directly to k groups. The Bayes factor tests the overall group factor (omnibus test). For pairwise comparisons, you can compute separate Bayes factors for each pair, but account for the number of comparisons, for example through the prior on the model space, rather than relying on unadjusted pairwise results.
Does Bayesian ANCOVA still require the homogeneity-of-slopes assumption?
Yes. The standard Bayesian ANCOVA model assumes the covariate slope is the same across groups. You should test this by comparing a model with group-by-covariate interaction to one without it, using a Bayes factor. A large BF in favour of the interaction model means the assumption is violated and the interpretation of adjusted group means is problematic.
How is this different from Bayesian linear regression?
Bayesian ANCOVA is a special case of Bayesian linear regression where at least one predictor is a categorical group factor. The distinction is conceptual: ANCOVA frames the question as group comparison adjusted for covariates, while general regression frames everything as continuous predictors. In software they use the same underlying model; ANCOVA simply emphasizes the group-factor Bayes factor and adjusted means.
Related methods
Sources
Rouder, J. N., & Morey, R. D. (2012). Default Bayes factors for model selection in regression. Multivariate Behavioral Research, 47(6), 877–903.
Open DOI referenceGelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2014). Bayesian Data Analysis (3rd ed.). CRC Press.
ISBN: 978-1439840955