Likelihood ratios and probability of infection in a tested individual

Input Values


Use this to calculate positive and negative likelihood ratios for a test of given sensitivity and specificity and to calculate the post-test probability of infection, given the pre-test probability and test performance. For these calculations, the pre-test probability of infection is the estimated of probability of infection based on clinical signs and any other (such as previous test results) available information. If no other information is available the estimated prevalence of infection in the population of origin should be used. The post-test probability of infection is the same as the positive (or negative) predictive value for the test for the specified pre-test probability of infection.

Inputs required

  • Test unit sensitivity;
  • Test unit specificity; and
  • Prior (pre-test) probability of infection.


  • Table of pre-test odds of infection, likelihood ratio, post-test odds of infection and post-test probability of infection for positive and negative test results, respectively; and
  • Plots of positive and negative likelihood ratios for varying sensitivity and specificity values and varying prior probability of infection.


LRpos = Se / (1 - Sp)
LRneg = (1 - Se) / Sp
PreTestOdds = p / (1 - p)
PostTestOddsPos = PreTestOdds x LRpos
PostTestOddsNeg = PreTestOdds x LRneg
PInfPos = PostTestOddsPos / (1 + PostTestOddsPos)
PInfNeg = PostTestOddsNeg / (1 + PostTestOddsNeg)

  • p = Prior probability of infection;
  • Se = Test unit sensitivity;
  • Sp = Test unit specificity;
  • LRPos = Likelihood ratio for a positive result; and
  • LRNeg = Likelihood ratio for a negative result.
  • PreTestOdds = Pre-test odds of infection;
  • PostTestOddsPos = Post-test odds of infection for a positive result;
  • PostTestOddsNeg = Post-test odds of infection for a negative result;
  • PInfPos = Probability of infection for a positive result; and
  • PInfNeg = Probability of infection for a negative result.


Likelihood ratios
Likelihood ratios: pre and post test probability


Excel example
R function
Likelihood ratio calculator
Pre-test probability of infection (prevalence):
Test Sensitivity:
Test Specificity:


  Home  |   About this site  |   Glossary   |   References   |   Links  

This site was created by Ausvet with funding from a range of sources.
It provides a range of epidemiological tools for the use of researchers and epidemiologists, particularly in animal health.
Please send any comments, questions or suggestions to Evan Sergeant
© 2019 Ausvet