- Introduced by
- Rouder, Speckman, Sun, Morey & Iverson
- Year
- 2009
- Type
- Bayesian mean-vs-constant comparison
- Family
- Classical statistics
What does it do?
The Bayesian one-sample t-test compares a single group's mean against a fixed reference value using a Bayes factor rather than a p-value.
It quantifies the evidence the data provide for the null hypothesis (mean equals the reference) versus the alternative, and yields a full posterior distribution over the effect size — enabling statements about practical magnitude, not just a binary reject-or-retain decision.
The intuition behind the method
Imagine you measure a sample and want to know whether its average differs from some theoretically meaningful value (e.g. zero, or a population norm). The classical t-test answers with a yes/no at a fixed alpha. The Bayesian version instead asks: after seeing these data, how much more (or less) plausible is the hypothesis that the mean equals the reference, compared with the hypothesis that it does not? This ratio — the Bayes factor — can favor either hypothesis, and its magnitude tells you how strong the evidence actually is, including evidence in support of the null.
History
The Bayesian t-test framework was formalized by Rouder, Speckman, Sun, Morey, and Iverson in a 2009 Psychonomic Bulletin & Review paper, which derived an analytic Bayes factor for the one- and two-sample t-test using the Jeffreys-Zellner-Siow (JZS) Cauchy prior. The approach was later implemented in the R package BayesFactor by Morey and Rouder, and it became more widely used through the JASP software.
When to use it
Use the Bayesian one-sample t-test when you measure a single continuous variable and want to compare the group mean to a known or theoretically meaningful reference value, and when you want to quantify evidence for both the null and alternative hypotheses rather than simply reject or retain the null. It is especially useful when sample sizes are small and you want to incorporate prior information, or when you need to state the strength of evidence for a null effect. Avoid it when you have no theoretical justification for any prior on effect size and stakeholders require a strict frequentist error-rate guarantee; in that case, the classical one-sample t-test is more appropriate. Also avoid it when your outcome is clearly non-continuous or heavily skewed without transformation.
Limitations and considerations
- The Bayes factor depends on the prior scale r, so different choices give different BF values. Sensitivity to r should always be examined.
- The null is a point hypothesis (mean exactly equal to the reference). The Bayes factor therefore depends on how much prior mass the alternative places near zero effect, which the Cauchy scale controls.
- The test assumes that the sampling distribution of the mean follows a t-distribution, which holds approximately for normal data or a sufficiently large n. Check normality with a Q-Q plot. Skewed data or outliers, which can strongly affect the mean and the standard deviation, may require transformation or a different test.
- The thresholds used to label a Bayes factor as moderate or strong are conventions and are not universally agreed.
- Observations must be independent of one another. Clustered or repeated measurements violate this assumption and call for a different model.
- The reference value must be fixed before data collection. Choosing it after inspecting the data, or estimating it from the same sample, makes the comparison circular.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Quantifies evidence for the null hypothesis, which a p-value cannot do: a BF10 below 1 expresses support for the mean being equal to the reference value.
- Provides a full posterior distribution over delta, so statements can be made about the plausible size of the shift and not only whether it is nonzero.
- The Bayes factor is graded: larger values indicate stronger evidence, which avoids a forced binary reject-or-retain decision.
- The default Cauchy scale gives a standard starting prior, so no subjective elicitation is needed to run the test. Its conclusions must still be checked with a sensitivity analysis over r.
- Because the prior is fixed before analysis, the Bayes factor can be recomputed as data accumulate, provided the prior is not changed between looks.
Applications
- Testing whether a sample mean differs from a population norm or theoretical benchmark in psychology and education research.
- Evaluating whether an intervention shifts a biomarker away from a clinically meaningful reference value.
- Quantifying evidence for a null effect, where a BF10 below 1 favours the reference value. This is not a formal equivalence test.
- Checking whether a process mean matches a specification value in quality-control settings, where evidence for conformance is needed.
- Replication studies in which the main goal is to quantify evidence for or against the original effect.
How it works
How it works
The null hypothesis fixes the population mean at a reference constant (often zero). The alternative hypothesis asserts that the mean is shifted away from that constant by an unknown effect size delta.
Formula
H_0:\ \mu = \mu_0 \quad H_1:\ \mu \neq \mu_0
Under the alternative, a Cauchy prior scaled by r is placed on the standardized effect size delta. The default is r = sqrt(2)/2 (about 0.707). The prior is symmetric around zero, so positive and negative shifts are treated alike. Its heavy tails give meaningful probability to large effects without requiring the analyst to specify expected values in advance. The Cauchy prior with JZS-type scaling was developed by Rouder et al. (2009). The default value is a convention, so check which scale your software uses and report the scale you chose.
Formula
\delta \sim \text{Cauchy}(0,\, r),\quad r = \tfrac{\sqrt{2}}{2}\ (\text{default})The Bayes factor BF10 is the ratio of the marginal likelihood of the data under the alternative to the marginal likelihood under the null. A BF10 greater than 1 favours the alternative and a value less than 1 favours the null. Values between 1/3 and 3 are weak (anecdotal) evidence in either direction. Values above 3, or below 1/3, are read as moderate evidence, and the strength of evidence grows as the value moves further from 1. These boundaries are conventions and are not universally agreed.
Formula
BF_{10} = \frac{p(\mathbf{x} \mid H_1)}{p(\mathbf{x} \mid H_0)}Given the observed t statistic, t = (x̄ − μ0)/(s/√n), and the sample size n, the posterior distribution over delta can be obtained analytically or by numerical integration, which is what statistical software typically does. It summarizes the plausible effect sizes and their relative credibility, given the data and the chosen prior.
Reports typically give the Bayes factor as the main inferential summary, together with the posterior median and a 95% credible interval for delta. Because a Bayes factor can favour the null, it can support a conclusion that the mean does not differ from the reference value. This conclusion is only as firm as the prior, so the prior scale should be reported and checked.
Common pitfalls
- Using the default prior without checking sensitivity: if conclusions change when r is varied between 0.5 and 1.0, they should be stated cautiously.
- Confusing a Bayes factor with a posterior probability: BF10 = 3 does not mean the alternative has a 75% probability unless prior odds are also taken into account. The 75% figure corresponds only to equal prior odds.
- Reporting the Bayes factor alone, without the posterior credible interval for delta, which omits information about the size of the effect.
- Applying the test to paired or two-group data. Use the Bayesian paired-samples or independent-samples t-test instead.
- Treating weak evidence (a BF10 between 1/3 and 3) as conclusive in either direction.
Frequently asked questions
What does BF10 = 0.2 mean?
A BF10 below 1 means the data are more consistent with the null hypothesis than with the alternative. BF10 = 0.2 (equivalently BF01 = 5) means the data are 5 times more likely under H0 than under H1. Under the conventional thresholds this is moderate evidence for the null. A classical t-test does not provide this kind of graded statement about the null.
How do I choose the prior scale r?
The default scale r = sqrt(2)/2 ≈ 0.707 is the usual starting point. For expected small effects, a narrower scale such as r = 0.5 may be more suitable. Report the chosen r and run a sensitivity analysis, for example by repeating the test with r = 0.5 and r = 1.0 and checking whether the conclusion changes.
Is this the same as the classical one-sample t-test with a Bayesian label?
No. Both use the t statistic, but the inferential output differs. The classical test computes a p-value, the probability of a result at least this extreme if H0 is true. The Bayesian test computes a Bayes factor, the relative likelihood of the data under H1 versus H0, and a posterior credible interval for the effect size.
Can I use it with very small samples?
Yes. The Bayes factor and posterior are computed from the prior and the model rather than from large-sample approximations, so the test can be run on small samples. With small samples the Bayes factor often stays close to 1 when the data are uninformative, and the credible interval for delta will be wide. Check both before drawing conclusions.
What software runs this test?
The BayesFactor R package (Morey & Rouder) and the JASP graphical interface both run Bayesian t-tests. Python users can use the pingouin library, which includes Bayesian t-test functionality with Cauchy priors.
Related methods
Sources
Rouder, J. N., Speckman, P. L., Sun, D., Morey, R. D., & Iverson, G. (2009). Bayesian t tests for accepting and rejecting the null hypothesis. Psychonomic Bulletin & Review, 16(2), 225–237.
Open DOI referenceKruschke, J. K. (2014). Doing Bayesian Data Analysis: A Tutorial with R, JAGS, and Stan (2nd ed.). Academic Press.
ISBN: 978-0124058880