statable Statistics for study and research

How do prior knowledge and new data combine? (prior, posterior, beta distribution for a proportion)

In brief

Bayesian statistics combines knowledge beforehand (prior) with the data and obtains knowledge afterwards (posterior). For a proportion this works by counting: a beta distribution Beta(a, b) describes the prior like a earlier successes and b earlier failures. New data are simply counted along.

An example by hand

A training is meant to help with back pain. Earlier small reports suggest that it helps about 3 in 10: prior Beta(3, 7) with the mean 3 : (3 + 7) = 0.30. Now 20 new people try the training, 14 report an improvement, 6 do not.

  1. a′ = a + successes = 3 + 14 = 17.
  2. b′ = b + failures = 7 + 6 = 13.
  3. Posterior: Beta(17, 13) with the mean 17 : 30 = 0.57.

The share of the sample alone would be 14 : 20 = 0.70. The prior (0.30) pulls the value down to 0.57 because it counts like 10 earlier observations, the new data like 20. With weak prior knowledge Beta(1, 1) the mean would be 15 : 22 = 0.68.

The building blocks

How it works in Statable

  1. Under "Learning" open the unit "Bayes with prior knowledge": first "Work it out yourself" with the numbers above, then "Try it out".
  2. Statable calculates Bayes factors for group comparisons; they, too, weigh a model with prior knowledge against the data. The tree diagram in the learning lab shows the same principle with probabilities.

What is often misunderstood

For specialists

The beta distribution is the conjugate prior to the binomial distribution: Beta(a, b) and s successes in n trials give Beta(a + s, b + n − s). The posterior mean (a + s) : (a + b + n) is a weighted mean of prior mean a : (a + b) and share s : n, with the weights a + b and n. Beta(1, 1) is the uniform distribution. The choice of the prior, too, is a decision that belongs fixed beforehand and reported openly (sensitivity analysis with a second prior). The inference to the probability of a hypothesis after the data is available only through Bayes' theorem with a prior probability; in diagnostics the prior corresponds to the prevalence and the posterior to the predictive value.

Sources

Cohen, J. (1994). The earth is round (p < .05). American Psychologist, 49, 997-1003. Altman, D. G. & Bland, J. M. (1994). Diagnostic tests 2: predictive values. BMJ, 309, 102. Wasserstein, R. L. & Lazar, N. A. (2016). The ASA statement on p-values: context, process, and purpose. The American Statistician, 70, 129-133.

Take away

  • Prior plus data gives posterior; for a proportion that means: count successes to a, failures to b.
  • The posterior mean lies between the prior knowledge and the share of the sample.
  • The stronger the prior knowledge (a + b), the more data it takes to shift it.
  • State the prior openly and check it against a weaker prior.

Related

Open in Statable