Rr‑statistics.co

Bayes Factor Calculator

A Bayes factor measures how much your data favor one hypothesis over another, like saying the evidence is 5 times stronger for an effect than for no effect. Enter a test statistic or summary stats to get the BF, an evidence label (anecdotal to decisive), and the equivalent frequentist p-value side by side.

i New to Bayes factors? Read the 4-min primer

What a Bayes factor is. The Bayes factor BF₁₀ is the ratio of the data’s marginal likelihood under the alternative H₁ to its marginal likelihood under the null H₀. Read it as “the data are BF₁₀ times more likely under H₁ than under H₀.” A BF of 10 says the evidence favours H₁ ten-to-one; a BF of 0.1 says the evidence favours H₀ ten-to-one. There is no “significance” threshold: the BF is the evidence, full stop.

How to read the number. Jeffreys and Wagenmakers give a rough ladder: above 100 is extreme, 30 to 100 very strong, 10 to 30 strong, 3 to 10 moderate, 1 to 3 anecdotal. Below 1, mirror the labels for evidence in favour of the null. The big swing happens between 3 and 10; below 3, treat the evidence as weak no matter which side it leans.

Picking a prior. The Bayes factor needs a prior on the effect under H₁. The JZS Cauchy is the standard default with scale 0.707 (medium). A wider scale of 1.0 or 1.414 expects bigger effects and so penalises small ones more harshly under H₁; a narrower 0.5 expects smaller effects and rewards them. Always check sensitivity by varying the scale; the plot below does this for you.

BF versus p-value. A p-value asks “how surprised would H₀ be by data this extreme or more?”. A Bayes factor asks “which hypothesis predicted the data better?”. P-values reject; Bayes factors quantify. They can disagree, especially at large n: a tiny effect may be highly significant yet have a Bayes factor near 1, because both H₀ and H₁ predict it about equally well.

6 modes · summary stats or t-statistic · JZS Cauchy · stretched-beta · Beta-Binomial · Runs in your browser

Try a real-world example to load.

📝 Scenario

BF₁₀
·
Recap
R code RUNNABLE
R Reproduce in R

        
Sensitivity to prior INTERACTIVE
Bayes factor vs Cauchy scale r (log-y)
Inference

Read more The Bayes factor math, end to end
BF₁₀ = ∫ p(t | g, ν) π(g) dg / p(t | g=0, ν) π(g) = inverse-gamma(0.5, r²/2)
JZS for the t-test (Rouder 2009). Effect size δ sits on a Cauchy(0, r) prior, equivalently δ | g ~ N(0, g) with g ~ inverse-gamma. The numerator marginalises the noncentral t density over g; the denominator is the central t density at the observed t. We integrate on a log-g grid by Simpson’s rule with a wide range; for the t test the integrand is unimodal and the rule is accurate to many digits.
nᵉ = n (one-sample), n₁ n₂ / (n₁+n₂) (two-sample) ν = n−1 (one-sample), n₁+n₂−2 (two-sample)
Effective n and df. The marginal likelihood depends on n through nᵉ (effective sample size) and on the t distribution’s df ν. Welch is approximated by using the pooled df and effective n; for moderate-to-large n the BF is robust to the unequal-variance correction. For the paired design, treat it as a one-sample t on the differences with n equal to the number of pairs.
P(H₁ | data) = BF₁₀ / (1 + BF₁₀) with 50/50 priors
Posterior probability. If you start out 50/50 between H₀ and H₁, the posterior probability of H₁ is BF₁₀ / (1 + BF₁₀). A BF of 10 puts you at 91% on H₁; a BF of 3 only 75%. With unequal priors, multiply BF by the prior odds to get posterior odds, then convert to a probability.
Correlation: stretched-beta on r BF₁₀ = ∫ p(r | ρ) π(ρ; κ) dρ / p(r | ρ=0)
Correlation BF (Wagenmakers 2016). The stretched-beta prior on the population correlation ρ assigns mass on (−1, 1) controlled by κ (mapped from the Cauchy scale: a wider scale gives a flatter prior). The correlation likelihood uses the exact density via incomplete beta. We integrate on ρ with adaptive Simpson’s rule.
Two-proportion: independent Beta(1,1) priors on p₁, p₂ BF₁₀ = m₁(x₁,n₁) m₁(x₂,n₂) / m₀(x₁+x₂, n₁+n₂)
Two-proportion BF. Under H₁ each group has its own beta-binomial marginal likelihood; under H₀ they share a common rate, integrated against a single Beta(1,1) prior. The closed form uses log-Beta functions, so it is fast and exact. A flat prior is a defensible default; tighter priors can be motivated by domain knowledge.
ANOVA / regression (Liang 2008): R² = F · df1 / (F · df1 + df2) BF₁₀ = ∫ (1+g)^((N−p−1)/2) (1 + g(1−R²))^(−(N−1)/2) π(g) dg π(g) = inverse-gamma(1/2, N r² / 2)
ANOVA and linear regression BF. The same JZS / Zellner-Siow g-prior covers both fixed-effects ANOVA and linear regression; the only difference is bookkeeping for p (number of model parameters). The Bayes factor compares the full model against the intercept-only null. We integrate the unimodal integrand on log(g) by Simpson’s rule, exactly as for the t-test. With the medium prior r = 0.5 the result tracks BayesFactor::anovaBF and regressionBF closely.
Caveats When this is the wrong tool
If you have…
Use instead
A complex hierarchical or mixed model
The JZS prior is built for fixed-effect designs. For mixed effects, the BayesFactor::lmBF() family handles random terms with explicit variance priors; for anything bespoke, fit in Stan or brms and compute BFs by bridge sampling.
Tiny n (under 5 per group)
Numerical integration is fine but the prior is doing most of the work. Report the prior, run the sensitivity plot, and treat the BF as descriptive rather than decisive.
One-sided hypotheses
This tool uses two-sided priors. For directional H₁ (effect > 0), truncate the Cauchy at zero and double-up the integral; we plan to ship this as a v2 toggle.
A planning question (sample size)
BFs are post-hoc evidence summaries. For prospective design, compute the Bayes factor design analysis (BFDA) by simulation, or fall back on classical power. The Power analysis tool handles the latter.
Strong informative priors from the literature
JZS is a default, not a substitute for the right prior. If you know the field-level effect-size distribution, encode it directly with a normal or t prior on δ and integrate accordingly.
Categorical / count outcomes beyond 2x2
Use a Bayesian contingency-table model or a Poisson Bayes factor; the JZS construction does not generalise to counts without extra structure.
Further reading

Math: JZS Cauchy prior with adaptive Simpson on log-g; central-t CDF via regularised incomplete beta; correlation BF via stretched-beta on rho; two-proportion BF via beta-binomial marginal likelihoods; sensitivity plot rebuilds across r in [0.1, 2].