Bayesian One-Way ANOVA

Statistics
Introduced by
Harold Jeffreys (foundations); Jeffrey Rouder et al. (default priors for ANOVA)
Year
1961 (foundations); 2012 (ANOVA Bayes factors)
Type
Bayesian hypothesis test
Family
Classical statistics

What does it do?

Bayesian one-way ANOVA tests whether the means of three or more independent groups differ by computing a Bayes factor: the ratio of how likely the data are under a model that allows group differences to how likely they are under the null model of equal means.

Unlike the classical F-test, which indicates only whether the data are unlikely under the null, the Bayes factor can express support for either model, including the null. The default prior settings used here follow Rouder et al. (2012).

The intuition behind the method

Suppose you compare reading scores across three teaching methods. A classical one-way ANOVA returns a p-value: a small value leads to rejecting the null of equal means, but a large value does not show that the groups are equal. Bayesian one-way ANOVA sets the two models against each other, 'all group means are equal' versus 'the means can differ', and reports their relative support as one number, the Bayes factor. A Bayes factor of 10 means the data are ten times more likely under the model with group differences than under the null. Values near 1 mean the data are not informative about which model is correct, which is a different conclusion from support for the null.

History

The foundations of Bayes factors for comparing hypotheses go back to Harold Jeffreys's Theory of Probability. The default Bayes factors for ANOVA designs, using Cauchy priors on standardised effects, were developed by Rouder, Morey, Speckman, and Province (2012) in the Journal of Mathematical Psychology, which made the approach practical for behavioural and social science research. Software such as JASP and the BayesFactor R package later made Bayesian ANOVA available to applied users.

When to use it

Choose Bayesian one-way ANOVA when the outcome is continuous, there are three or more independent groups, and the question concerns the strength of evidence rather than a reject-or-retain decision. It is a suitable option when you need to state evidence for equal group means, or when you want to bring prior information from earlier studies into the analysis. The assumptions are the same as in classical one-way ANOVA: independent observations, approximately normal values within groups, and equal variances across groups. Do not use it when observations are repeated or paired within subjects (use Bayesian repeated-measures ANOVA instead), when the outcome is ordinal or strongly non-normal, or when you have no defensible basis for the prior scale, because the Bayes factor depends on that choice.

Limitations and considerations

  • Results depend on the prior scale r. With small samples this dependence can be large, so a sensitivity analysis across plausible r values is needed.
  • The default prior is a convention and is not calibrated to the effect sizes typical of any particular field.
  • The threshold labels (moderate, strong, decisive) are heuristic conventions, not hard boundaries.
  • The standard model assumes equal within-group variances. Allowing unequal variances requires custom modelling rather than the default procedure.
  • Pairwise comparisons are less standardised than the post-hoc procedures used with classical ANOVA, so reviewers may ask for an explanation of the chosen approach.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • It can give evidence for the null hypothesis as well as against it, whereas a non-significant F-test does not by itself show that the group means are equal.
  • The Bayes factor is a single continuous measure of relative support for the two models, which can be compared across studies.
  • Prior information is stated explicitly through the prior scale r and updated with the observed data.
  • Evidence can be recalculated as observations are added. The Bayes factor depends on the data and the prior rather than on a fixed sample-size plan, although the prior still shapes the result.
  • It can be run in JASP, a free graphical package, without writing Bayesian code.

Applications

  • Experimental psychology and neuroscience: comparing cognitive or neural outcomes across multiple treatment conditions.
  • Clinical trials: evaluating whether a new drug outperforms two or more comparators on a continuous biomarker.
  • Educational research: testing whether three or more teaching interventions produce different mean achievement scores.
  • Marketing and A/B/n testing: comparing user engagement metrics across multiple interface variants with evidence quantification.
  • Replication studies: assessing whether a new dataset supports, is ambiguous about, or contradicts a previously reported group difference.
  • Ecology and biology: comparing mean trait values across multiple species groups or habitat types with informative priors.

How it works

How it works

1

Two competing models are specified: the null model M0 states that all group population means are equal, and the alternative model M1 states that at least one group mean differs. The goal is to quantify the relative support the data provide for each model.

Formula
M_0: \mu_1 = \mu_2 = \dots = \mu_k \quad M_1: \text{at least one } \mu_j \text{ differs}
2

Under M1, the group effects receive a Cauchy prior centred at zero. In the default approach of Rouder et al. (2012) the effects are standardised, that is, expressed relative to the error standard deviation, and the Cauchy scale is called r. The scale determines how large the effects are expected to be: the Cauchy distribution is concentrated near zero, so small effects are treated as most plausible, while its heavy tails keep large effects possible. The prior does not specify the direction of any group difference. Because the Bayes factor depends on r, the value should be chosen with the research context in mind and checked in a sensitivity analysis.

Formula
\alpha_j \sim \text{Cauchy}(0, r) \text{ (effect-size prior on group effects)}
3

The Bayes factor BF10 is the ratio of the marginal likelihoods of the data under M1 and M0, where each marginal likelihood averages the likelihood over the prior on the model parameters. Values above 1 favour M1 and values below 1 favour M0. In general these averages have no closed form and are evaluated numerically or by Markov chain Monte Carlo sampling, depending on the software; JASP and the R package BayesFactor are examples.

Formula
BF_{10} = \frac{p(\text{data} \mid M_1)}{p(\text{data} \mid M_0)}
4

The labels below are a commonly used convention in the Bayes factor literature, adapted from Jeffreys's evidence categories; they are not Jeffreys's exact cut-offs. BF10 > 3 = moderate evidence for group differences; > 10 = strong; > 100 = decisive. BF10 < 1/3 = moderate evidence for the null; < 1/10 = strong evidence for the null. Values between 1/3 and 3 indicate ambiguous data that do not strongly favour either model. These labels are heuristic conventions, not decision boundaries.

Formula
BF_{10} > 3: \text{ moderate evidence for } M_1;\quad BF_{10} < 1/3: \text{ evidence for } M_0
5

Eta-squared (or partial eta-squared) is the proportion of total variance explained by group membership. It is upwardly biased in small samples, so interpret it cautiously there. For comparing effect sizes across studies, a standardised measure such as Cohen's f can also be reported. Report these alongside the Bayes factor, together with posterior estimates of the group means. Credible intervals for pairwise mean differences describe how large those differences are. They do not by themselves establish which pairs differ, so a separate pairwise procedure is still needed (see the FAQ).

Formula
\eta^2 = \frac{SS_{\text{between}}}{SS_{\text{total}}} \text{ (reported alongside BF)}

Common pitfalls

  • Adopting the default prior without checking whether a scale of r = 0.5 suits the effect sizes plausible in your field.
  • Treating a Bayes factor between 1/3 and 3 as confirmation of the null. Such values mean the data are ambiguous between the two models.
  • Reading BF10 as the posterior probability of M1. BF10 is a ratio of likelihoods; it equals the posterior odds only when the prior odds of M1 to M0 are equal, so the posterior probability also depends on the prior odds.
  • Skipping the checks for normality and equal variances. These matter for the Bayes factor just as they do in classical ANOVA.
  • Running the Bayesian test only after a non-significant classical test and presenting it as confirmation. The analysis should be specified before the data are examined.

Frequently asked questions

How do I choose the prior scale r?

Rouder et al. (2012) propose default scales for standardised effects, and the default in common software is a reasonable starting point when you have no strong prior information. Use a smaller scale if effects in your domain are consistently modest, or a larger one if large effects are plausible. Conduct a sensitivity analysis: if conclusions change substantially across reasonable r values, report this and interpret the result cautiously.

What software runs Bayesian one-way ANOVA easily?

JASP (free, GUI-based) provides Bayesian ANOVA with default priors, Bayes factor tables, and posterior plots. In R, the BayesFactor package (anovaBF function) and brms (for fuller Bayesian modelling) are the main options. Check the documentation of other packages for current support.

Can I use this when variances are unequal across groups?

The standard formulation assumes homogeneity of variance. If Levene's test is significant, the classical approach switches to Welch's ANOVA. In Bayesian terms, the model can be extended to allow group-specific variance parameters, but this is not available in the default procedure and requires custom brms or Stan code.

How is Bayesian ANOVA different from classical one-way ANOVA?

Classical ANOVA gives an F statistic and p-value indicating whether the data are unlikely under the null. Bayesian ANOVA gives a Bayes factor indicating how much more (or less) likely the data are under the alternative than under the null. The Bayesian approach can give positive support for the null and avoids the binary threshold logic of significance testing.

Do I still need post-hoc tests?

Yes, if you need to identify which groups differ. A pairwise Bayes factor compares the two groups concerned, with a prior placed on their difference, so each comparison is a separate test. Multiplicity is generally not corrected automatically, so many pairwise Bayes factors will tend to produce some misleading results; consider the number of comparisons when interpreting them and check how your software handles this.

Related methods

Sources

  1. Rouder, J. N., Morey, R. D., Speckman, P. L., & Province, J. M. (2012). Default Bayes factors for ANOVA designs. Journal of Mathematical Psychology, 56(5), 356–374.

    Open DOI reference
  2. Jeffreys, H. (1961). Theory of Probability (3rd ed.). Oxford University Press.

    ISBN: 978-0198503682