Inputs
Results
Example data
Click a button to load inputs for a quick try.
| Method | Inputs | |
|---|---|---|
| Direct likelihood | mode=log, lnL1=−120.3, lnL0=−124.9, prior_odds=1 | |
| BIC approximation | BIC0=312.4, BIC1=307.1, prior_odds=1 | |
| Binomial + Beta(1,1) | y=13, n=20, p0=0.5, α=1, β=1, prior_odds=1 | |
| Normal mean + normal prior | x̄=1.2, n=30, σ=2.0, μ0=0, μ1=0, τ=1.0, prior_odds=1 | |
| JZS t-test | two-sample, t=2.1, n1=25, n2=27, r=0.707 | |
| Two proportions | y1=56/1000, y2=63/1000, a=b=0.5, a0=b0=0.5 |
Saved results log
| # | Timestamp | Method | BF10 | BF01 | ln BF10 | log10 BF10 | Prior odds | Posterior odds | P(H1|data) | Evidence | Inputs |
|---|---|---|---|---|---|---|---|---|---|---|---|
| JZS t-test | two-sample, t=2.1, n1=25, n2=27, r=0.707 | ||||||||||
| Two proportions | y1=56/1000, y2=63/1000, a=b=0.5, a0=b0=0.5 |
Formulas used
- JZS t-test (Rouder et al., 2009): For t, df, and effective N (n for one/paired; n₁n₂/(n₁+n₂) for two-sample) with Cauchy scale r, BF10 = ∫₀^∞ (1+Ngr²)−1/2(1 + t²/[df(1+Ngr²)])−(df+1)/2(2π)−1/2g−3/2e−1/(2g) dg ÷ (1 + t²/df)−(df+1)/2.
- Two proportions (Beta–Binomial): With y₁/n₁, y₂/n₂ and priors Beta(a,b) under H₁ and Beta(a₀,b₀) under H₀, BF10 = [B(y₁+a, n₁−y₁+b)·B(y₂+a, n₂−y₂+b)·B(a₀,b₀)] / [B(y₁+y₂+a₀, n₁+n₂−y₁−y₂+b₀)·B(a,b)²].
- Likelihood ratio: BF10 = L(data|H1) / L(data|H0). With logs: BF10 = exp(lnL1 − lnL0).
- BIC approximation: BF10 ≈ exp((BIC0 − BIC1)/2).
- Binomial with Beta(α,β) prior: BF10 = [B(y+α, n−y+β)/B(α,β)] / [p₀ʸ(1−p₀)ⁿ⁻ʸ], using the Beta function B(·,·).
- Normal mean with Normal(μ₁, τ²) prior, known σ: Let v = σ²/n. Then BF10 = √(v/(v+τ²)) · exp{ −½[ (x̄−μ₁)²/(v+τ²) − (x̄−μ₀)²/v ] }.
Posterior odds = prior odds × BF10. Posterior probability P(H1|data) = posterior odds / (1 + posterior odds).
How to use this calculator
- Select a method that matches your analysis setup.
- Fill the required inputs. Use logs where appropriate.
- Set optional prior odds if you have prior preferences.
- Click Compute Bayes factor to see BF10, BF01, logs, and posteriors.
- Click Add to log to store results, then export CSV or PDF.
Interpretation guide (Jeffreys): BF10 ∈ [1,3): anecdotal; [3,10): moderate; [10,30): strong; [30,100): very strong; ≥100: decisive. Values <1 favor H0 symmetrically.
FAQs
1) What is a Bayes factor?
A Bayes factor compares how well two hypotheses explain data. It is the likelihood of the data under H1 divided by that under H0. Bigger than one favors H1. Smaller favors H0.
2) How do I interpret BF10 values?
Use rough bands: 1–3 anecdotal, 3–10 moderate, 10–30 strong, 30–100 very strong, above 100 decisive. Values below one favor H0 with symmetric strength using the reciprocal BF01.
3) What priors are used in the binomial method?
A Beta(α,β) prior on the success probability. Beta(1,1) gives a uniform prior. Choose α and β to encode prior information about expected success rate before observing the data.
4) How does this differ from p-values?
P-values summarize incompatibility of data with H0, given H0. Bayes factors directly compare support for H1 versus H0. They combine with prior odds to yield posterior odds and posterior probabilities.
5) When should I use the BIC approximation?
Use BIC when you have maximum-likelihood fits with sample sizes that are not tiny and models are regular. It provides a fast, reasonable Bayes factor approximation without specifying detailed parameter priors.
6) How do prior odds affect results?
Posterior odds equal prior odds times BF10. If prior odds favor H0, stronger evidence is required to support H1. If prior odds favor H1, weaker evidence can tilt the posterior toward H1.
7) Any tips for numerical stability?
Prefer entering log-likelihoods for extreme values. For binomial computations, this tool uses log-Beta to avoid underflow or overflow. Check inputs carefully, especially probabilities and counts near boundaries.
Quick tips
- JZS t-test (Rouder et al., 2009): For t, df, and effective N (n for one/paired; n₁n₂/(n₁+n₂) for two-sample) with Cauchy scale r, BF10 = ∫₀^∞ (1+Ngr²)−1/2(1 + t²/[df(1+Ngr²)])−(df+1)/2(2π)−1/2g−3/2e−1/(2g) dg ÷ (1 + t²/df)−(df+1)/2.
- Two proportions (Beta–Binomial): With y₁/n₁, y₂/n₂ and priors Beta(a,b) under H₁ and Beta(a₀,b₀) under H₀, BF10 = [B(y₁+a, n₁−y₁+b)·B(y₂+a, n₂−y₂+b)·B(a₀,b₀)] / [B(y₁+y₂+a₀, n₁+n₂−y₁−y₂+b₀)·B(a,b)²].
- For large/small numbers, use the log‑likelihood mode.
- Uniform prior for binomial is α=1, β=1.
- Normal‑mean model uses known σ; unknown σ requires other formulas.
- Evidence labels are guidelines; context always matters.