A p-value says how surprising your data are if nothing is going on, but it does not say how strongly the data support a real effect. The Bayes factor calculator takes the successes, the trials and the null chance, and gives the Bayes factor for the alternative, the Bayes factor for the null, the posterior chance of the alternative, the log₁₀ of the factor and the exact two-sided p-value for comparison.
How the calculation works
- Enter the number of successes and the number of trials, for example 62 heads in 100 coin tosses.
- Enter the success chance under the null hypothesis, such as 0.5 for a fair coin.
- The alternative says that the chance is unknown, with every value from 0 to 1 equally likely beforehand. The Bayes factor BF₁₀ is the probability of the data under the alternative divided by its probability under the null.
- With a uniform prior, the data probability under the alternative is 1 ÷ (n + 1), so BF₁₀ = (1 ÷ (n + 1)) ÷ (C(n, k) × p₀ᵏ × (1 − p₀)ⁿ⁻ᵏ). A value of 3 to 10 is moderate evidence, and over 10 is strong.
Example
In 100 coin tosses, you see 62 heads. Under a fair coin the exact binomial test gives a two-sided p-value of 0.0210, which is below 0.05. The Bayes factor, with a uniform prior on the chance of heads, is BF₁₀ = 2.21. That is only anecdotal to moderate evidence for a biased coin, with a 68.9 % chance that the coin is biased if you started with equal odds. A p-value near 0.02 does not mean strong evidence, which is why many statisticians prefer Bayes factors.
Why it matters
Putting the Bayes factor next to the p-value reveals how often a result that looks significant is only weak evidence. It also lets you quantify support for the null, which is useful when you want to show that something has no effect. The comparison helps in reading studies with more care.
Good to know
The calculation is for a binomial test with a uniform prior on the success chance under the alternative and a point null. Other models and priors give other values. The posterior chance assumes equal prior odds between the two hypotheses. The exact p-value doubles the smaller tail, a common convention for a two-sided test.
Related tools
The Bayes theorem calculator updates a probability with new evidence, the p-value calculator converts statistics to p-values, the binomial calculator gives the chance of a number of successes, and the normal approximation calculator estimates binomial chances for large samples.