Computing the Odds Ratio from sensitivity and specificity?

I’ve been trying to get better at everyday-Bayesianism, by which I mean holding my current probabilities of events in the back of my mind, and updating them when new evidence appears.

This is most easily done (for me) by using the odds ratio form of Bayes’ theorem. Basically this is:

  • Posterior odds = Prior odds × Likelihood ratio

For which you need the Likelihood ratio, which is the relative probability of B being observed if hypothesis A is true, versus B being observed if hypothesis ¬A is true.

I’ve possibly got some medical thing right now, for which I know the prior odds (1:9), and the sensitivity and specificity of a diagnostic test I can take (97% and 95%). How should I update if the test comes back positive?

Question: can you easily calculate the necessary likelihood ratio from the sensitivity and specificity? I can do it the “hard” way, by imagining a population of 1000 people, and using the sensitivity and specificity to calculate how many are true-positive (TP), false-positive (FP), true-negative (TN) and false negative (FN). But is there a simple formula?

For clarity:

  • Sensitivity = TP / (TP + FN)
  • Specificity = TN / (TN + FP)
  • We want Likelihood Ratio

Likelihood Ratio (Medicine): Basic Definition, Interpretation - Statistics How To says that positive LPR is sensitivity / (1 - specificity); I’m working on verifying that.


Let M = medical thing.

Sensitivity = P(P | M), Specificity = P(N | ~M) = (1 - P(P|~M))

The odds ratio for a positive test is P(P | M) / P(P | ~M).

So I believe the odds ratio is sensitivity / (1-specificity). It looks like this agrees with something rob (robert?) found while I was typing.


I had some math written here that didn’t pan out, but @poisson 's work looks right!

Ah, that is great! And @poisson’s explanation is perfect!

So this looks like I should update by 19x for a positive result, and 0.03x for a negative result, given the sensitivity and specificity of this test. Very good, and a great general tool, too!