Answer

Bayesian vs frequentist statistics in plain English

Inspired by a question on Cross Validated ·

bayesianhypothesis testingp-values

The short answer

The schools disagree about what probability is. A frequentist treats the unknown quantity as fixed and asks how the data would behave over many repeats of the study (p-values, confidence intervals). A Bayesian treats the unknown quantity as uncertain, starts from a prior belief, and updates it with the data into a posterior. With plenty of data they usually agree; with little data the prior can matter a lot.

The real disagreement: what a probability is

For a frequentist, a probability is a long-run frequency. Saying a coin lands heads with probability 0.5 means that over a huge number of tosses, about half come up heads. Under that definition, a fixed but unknown number, such as the true cure rate of a treatment, does not have a probability: it simply is what it is. Probability belongs to the data and to the procedure that produced them.

For a Bayesian, a probability measures how strongly you believe something, given what you know. That lets you put a probability on the unknown quantity itself: "I am 80% sure the cure rate is above one half" is a perfectly sensible Bayesian sentence. You state a prior belief before seeing the data, and Bayes' theorem turns prior plus data into a posterior belief.

Everything else, from the kind of interval each school reports to the arguments about which is better, follows from this single difference.

How each school answers the same research question

Suppose a new treatment helps 9 of 12 patients and you want to know whether it works better than a coin flip (a rate of 0.5).

Notice that the Bayesian answer is usually what people want to know ("how likely is it that the treatment works?"), while the frequentist answer is about the data under a hypothetical. The price the Bayesian pays is having to write down a prior, and two analysts with different priors can reach different conclusions from the same data.

Same data, both ways, in R and Python

The code below runs an exact binomial test (the frequentist route) and a Bayesian update with two different priors: a flat prior that treats every cure rate as equally plausible, and a sceptical prior centred on 0.5 that is worth about 40 earlier patients. It then repeats everything with ten times as much data at the same success rate. No random numbers are involved, so the Python tab prints exactly the same figures as R.

R

# Same data, two schools: 9 successes in 12 trials of a new treatment
k <- 9; n <- 12

# Frequentist: exact binomial test of H0: rate = 0.5, with a 95% confidence interval
ft <- binom.test(k, n, p = 0.5)
cat("Estimate:", round(k / n, 3), " p-value:", round(ft$p.value, 3), "\n")
cat("95% confidence interval:", round(ft$conf.int, 3), "\n")

# Bayesian: prior beliefs about the rate are updated with the data
bayes <- function(a, b, k, n) {
  a1 <- a + k; b1 <- b + n - k
  c(mean = a1 / (a1 + b1),
    lower = qbeta(0.025, a1, b1), upper = qbeta(0.975, a1, b1),
    p_above_half = 1 - pbeta(0.5, a1, b1))
}
cat("\nFlat prior, Beta(1, 1):\n")
print(round(bayes(1, 1, k, n), 3))
cat("Sceptical prior centred on 0.5, Beta(20, 20):\n")
print(round(bayes(20, 20, k, n), 3))

# Ten times as much data with the same success rate: 90 of 120
cat("\nWith 90 of 120 successes:\n")
ft10 <- binom.test(90, 120, p = 0.5)
cat("p-value:", signif(ft10$p.value, 2), " CI:", round(ft10$conf.int, 3), "\n")
print(round(rbind(flat = bayes(1, 1, 90, 120),
                  sceptical = bayes(20, 20, 90, 120)), 3))

Python

import numpy as np
from scipy import stats

# Same data, two schools: 9 successes in 12 trials of a new treatment
k, n = 9, 12

# Frequentist: exact binomial test of H0: rate = 0.5, with a 95% confidence interval
ft = stats.binomtest(k, n, p=0.5)
ci = ft.proportion_ci(confidence_level=0.95, method="exact")
print("Estimate:", round(k / n, 3), " p-value:", round(ft.pvalue, 3))
print("95% confidence interval:", round(ci.low, 3), round(ci.high, 3))

# Bayesian: prior beliefs about the rate are updated with the data
def bayes(a, b, k, n):
    a1, b1 = a + k, b + n - k
    post = stats.beta(a1, b1)
    return np.round([a1 / (a1 + b1), post.ppf(0.025), post.ppf(0.975), post.sf(0.5)], 3)

print("\nFlat prior, Beta(1, 1):  [mean, lower, upper, P(rate > 0.5)]")
print(bayes(1, 1, k, n))
print("Sceptical prior centred on 0.5, Beta(20, 20):")
print(bayes(20, 20, k, n))

# Ten times as much data with the same success rate: 90 of 120
print("\nWith 90 of 120 successes:")
ft10 = stats.binomtest(90, 120, p=0.5)
ci10 = ft10.proportion_ci(confidence_level=0.95, method="exact")
print("p-value:", f"{ft10.pvalue:.2g}", " CI:", round(ci10.low, 3), round(ci10.high, 3))
print("flat:     ", bayes(1, 1, 90, 120))
print("sceptical:", bayes(20, 20, 90, 120))
Estimate: 0.75  p-value: 0.146 
95% confidence interval: 0.428 0.945 

Flat prior, Beta(1, 1):
        mean        lower        upper p_above_half 
       0.714        0.462        0.909        0.954 
Sceptical prior centred on 0.5, Beta(20, 20):
        mean        lower        upper p_above_half 
       0.558        0.422        0.689        0.799 

With 90 of 120 successes:
p-value: 3.8e-08  CI: 0.663 0.825 
           mean lower upper p_above_half
flat      0.746 0.665 0.819            1
sceptical 0.688 0.614 0.757            1

With 12 patients, the frequentist test gives p = 0.146: a result this lopsided would turn up about 15% of the time even if the treatment were a coin flip, so the study is inconclusive. The 95% confidence interval for the cure rate runs from 0.428 to 0.945.

The Bayesian with a flat prior ends up with a posterior mean of 0.714, a 95% credible interval of 0.462 to 0.909, and a 0.954 probability that the rate is above one half. The sceptical Bayesian, who expected rates near 0.5, is pulled toward that belief: posterior mean 0.558, interval 0.422 to 0.689, and only a 0.799 probability that the treatment beats a coin flip.

With more data, the schools converge

With 90 successes in 120 patients, everything lines up. The p-value drops to 3.8e-08, the confidence interval is 0.663 to 0.825, the flat-prior credible interval is 0.665 to 0.819, and both Bayesians now put the probability that the rate exceeds 0.5 above .999 (it rounds to 1 at three decimals). The sceptic's estimate (0.688) is still a little lower, because a prior worth 40 patients still carries weight against 120, but the practical conclusion is the same.

This is the usual pattern: the prior acts like extra data, so it matters most when real data are scarce and fades as the sample grows. Disagreements between the schools are sharpest in small studies, rare events and problems with many parameters, which is also where a sensible prior can help the most.

Which approach should you use?

Whichever you choose, decide the analysis before seeing the data and report enough detail for others to redo it. If you are unsure which test fits your design, the test chooser is a good starting point, and the DASS blog covers planning and reporting analyses.

How to report a Bayesian credible interval in APA style (7th edition)

Report the prior, the posterior estimate, the credible interval and, if useful, a posterior probability. Proportions and probabilities cannot exceed 1, so drop the leading zero. Using the example above: "Nine of 12 patients (75%) improved. With a uniform Beta(1, 1) prior on the improvement rate, the posterior mean was .71, 95% CrI [.46, .91], and the posterior probability that the rate exceeded .50 was .95."

If you also give the frequentist result, keep the two clearly labelled: "An exact binomial test against a rate of .50 was not significant, p = .146, 95% CI [.43, .95]." In the method section, name the prior and justify it, and if you tried more than one prior (such as the sceptical Beta(20, 20) here), report how much the conclusions changed.

Related tools and guides

More answered questions

Working with your own data?

General answers only go so far. Send us your situation and we'll reply by email within two business days.

Ask your question

Written by AskStats with AI assistance. This is general information, not advice for your specific data or study. When the results matter, check your approach with a qualified statistician.