Bayesian t test and Bayes factor calculator
Paste two columns (two independent groups, or the same subjects measured twice) and the calculator gives the Bayes factor BF₁₀ of a Bayesian t test with the default JZS prior (a Cauchy prior on the effect size δ with width r = √2/2, as in JASP and the BayesFactor R package), says how strong the evidence is (anecdotal, moderate, strong, very strong, extreme), and shows the posterior of δ with its 95% credible interval and a robustness plot of BF₁₀ against the prior width. BF₁₀ = 17 means the data are 17 times more likely if there is a difference than if there is none.
- What it does
- Computes the JZS Bayes factor BF₁₀ for two independent groups, paired data or one group against a value, with the posterior of the effect size δ and a robustness check across prior widths.
- Formula
- Example
- Student’s sleep data (10 patients, two drugs, paired): t(9) = 4.06, BF₁₀ = 17.26, strong evidence for a difference; posterior median δ = 1.08 (95% credible interval 0.28 to 1.98).
Last updated
Loading Bayesian t test calculator…
At a glance
| Input | Two columns (paired or independent groups) or one column and a test value |
|---|---|
| Prior | Cauchy on δ, width r = √2/2 (medium), 1 (wide), √2 (ultrawide) or your own |
| Output | BF₁₀, BF₀₁, evidence category, posterior median and 95% credible interval of δ, robustness plot |
| Accuracy | Matches BayesFactor’s published sleep example (17.25888) and pingouin to < 10⁻⁶ |
| Export | PNG plots at 300 or 600 dpi, CSV of results, methods sentence; the Graph app with the same analysis |
| Runs in | Your web browser; nothing is uploaded |
| Price | Free, no account needed |
What it does
How to use the bayesian t test calculator
- Paste your valuesOne column per group with the names in the first row; for paired data, one row per subject in the same order in both columns.
- Choose the designPaired (the same subjects twice), two independent groups, or one group against a test value. The prior and a one-sided test are under More options.
- Read the Bayes factorBF₁₀ above 1 favours a difference, below 1 favours no difference; the wording gives the strength, the plots show the effect size and how much the prior matters.
How it works
The test. The Bayesian t test compares two hypotheses about the standardised effect size ttestBF in the BayesFactor R package. The Bayes factor is the ratio of how well each hypothesis predicted the data:
It depends on the data only through the t statistic, the effective sample size
The integral is computed numerically; the posterior of
The prior width.
Evidence categories. Jeffreys’ categories as adapted by Lee and Wagenmakers (2013), used by JASP: BF₁₀ 1–3 anecdotal, 3–10 moderate, 10–30 strong, 30–100 very strong, above 100 extreme evidence for H₁; the same bands of BF₀₁ = 1/BF₁₀ for H₀.
Accuracy. The calculation is the LabCanvas Graph app’s own Bayesian t test, run in your browser. On Student’s sleep data it gives BF₁₀ = 17.25888, the value BayesFactor publishes for ttestBF(sleep, paired), and it matches pingouin’s bayesfactor_ttest for paired and independent designs and all three prior widths to a relative error below 10⁻⁶ (scripts/bayesian-t-test-calculator-check.ts).
Sources: Rouder JN, Speckman PL, Sun D, Morey RD, Iverson G. Bayesian t tests for accepting and rejecting the null hypothesis. Psychon Bull Rev 2009;16:225–237, doi:10.3758/PBR.16.2.225. van Doorn J, van den Bergh D, Böhm U, et al. The JASP guidelines for conducting and reporting a Bayesian analysis. Psychon Bull Rev 2021;28:813–826, doi:10.3758/s13423-020-01798-5. Cushny AR, Peebles AR. The action of optical isomers: II. Hyoscines. J Physiol 1905;32:501–510, doi:10.1113/jphysiol.1905.sp001093 (the sleep data). Lee MD, Wagenmakers EJ. Bayesian Cognitive Modeling: A Practical Course. Cambridge University Press; 2013.
Worked example: two sleeping drugs in the same 10 patients
The built-in data are Student’s sleep data (Cushny and Peebles 1905): the extra hours of sleep of 10 patients on drug 1 and on drug 2, the example BayesFactor uses. Each patient took both drugs, so the test is paired.
| Quantity | Value |
|---|---|
| Mean of the differences (drug 2 − drug 1) | 1.58 h |
| Classical paired t test | t(9) = 4.062, P = 0.0028 |
| BF₁₀ | 17.26 (strong evidence for a difference) |
| BF₀₁ | 0.058 |
| Posterior median δ (95% credible interval) | 1.08 (0.28 to 1.98) |
| BF₁₀ with a wide (r = 1) and ultrawide (r = √2) prior | 18.42 and 18.02 |
How to read it. The data are 17.3 times more likely if the drugs differ than if they do not: strong evidence (10–30). The robustness check gives 17 to 18.5 for every reasonable prior width, so the conclusion does not hang on the prior. The effect is large: the posterior puts δ (the mean difference in SD units) between 0.28 and 1.98.
The same data as independent groups. Switch the design to two independent groups and BF₁₀ drops to 1.27 (anecdotal): ignoring the pairing throws away the fact that each patient is compared with themselves. Choose the design that matches how the data were collected.
| BF₁₀ | Evidence |
|---|---|
| above 100 | Extreme evidence for H₁ |
| 30 to 100 | Very strong for H₁ |
| 10 to 30 | Strong for H₁ |
| 3 to 10 | Moderate for H₁ |
| 1 to 3 | Anecdotal for H₁ |
| 1/3 to 1 | Anecdotal for H₀ |
| 1/10 to 1/3 | Moderate for H₀ |
| below 1/10 | Strong or more for H₀ |
Frequently asked questions
What is a Bayes factor?
The ratio of how likely the data are under two hypotheses. BF₁₀ = 5 means the data are five times more likely if there is an effect than if there is none; BF₁₀ = 0.2 (BF₀₁ = 5) means five times more likely if there is none. Unlike a P value, it can show evidence for no effect.
How do I report a Bayesian t test?
Give the design, the prior and the Bayes factor, for example: “A Bayesian paired t test with a Cauchy prior (r = 0.707) gave BF₁₀ = 17.3, strong evidence for a difference; posterior median δ = 1.08, 95% credible interval 0.28 to 1.98.” Copy methods writes this sentence for your data, and the robustness plot shows the prior did not drive it.
Which prior width should I use?
The default r = √2/2 (medium) unless you have a reason to expect larger or smaller effects. Report the robustness check, which shows BF₁₀ for every width; if the conclusion holds across them, the choice does not matter.
Is BF₁₀ = 3 significant?
Bayes factors have no significance threshold. Between 3 and 10 is moderate evidence; many authors want 10 or more before calling evidence strong. Report the number and its category rather than a yes or no.
Does this give the same answer as JASP?
Yes for the default settings: it uses the same JZS prior and Cauchy width as JASP and the BayesFactor package. On Student’s sleep data it gives BF₁₀ = 17.26, as BayesFactor does.
Can I use summary statistics instead of raw data?
This page takes the raw values. If you only have t and the sample sizes, the Bayes factor can be computed from those alone; the LabCanvas Graph app takes means, SDs and Ns in a summary table.
Link to this tool
Using it in a protocol, lab wiki or course page? Copy a link or citation.
<a href="https://www.labcanvas.com/tools/bayesian-t-test-calculator">Bayesian t test calculator</a> (LabCanvas)LabCanvas. Bayesian t test calculator [online tool]. https://www.labcanvas.com/tools/bayesian-t-test-calculatorRun Bayesian tests next to your other graphs
The LabCanvas Graph app has Bayesian t tests, correlation and one-way ANOVA with prior and posterior plots, styled for journals, in the same project as your figures. Your data from this page opens in it.
Open the Graph app