Vésale

Probability and diagnostic tests

Rules of calculation, conditional probability, Bayes' theorem, sensitivity, specificity, predictive values, ROC curve.

The basic rules

A probability is a number between 0, the impossible event, and 1, the certain event. The probability of the complement of A is 1 minus that of A. For two mutually exclusive events, which cannot occur together, the probability that one or the other occurs is the sum of their probabilities. In general, the probability that they occur together must be subtracted, so as not to count it twice.

Two events are independent when the occurrence of one does not change the probability of the other. The probability that they occur together is then the product of their probabilities: for two successive children of a couple who carry a recessive disease, the probability that both are affected is 1/4 × 1/4 = 1/16.

To calculate the probability of "at least one", it is often simpler to go through the complement: the probability that at least one of three children is affected is 1 minus the probability that none is, 1 − (3/4)³, about 58%.

Conditional probability and Bayes' theorem

The probability of A given B is the probability that A occurs when we know B has occurred: it equals the probability of A and B together, divided by the probability of B. There is no reason for it to equal the probability of B given A: the probability of having a fever when one has flu is high, that of having flu when one has a fever much less so.

Bayes' theorem allows one to go from one to the other. It states that the probability of the disease given the sign equals the probability of the sign given the disease, multiplied by the probability of the disease, and divided by the probability of the sign. The probability of the disease before any test, often the prevalence, is an essential ingredient.

Confusing these two probabilities is a common reasoning error, including among health professionals and in courts: a result very unlikely in an innocent person does not make guilt very likely if guilt was itself very unlikely to begin with.

Sensitivity and specificity

The quality of a diagnostic test is described by comparing it with a reference examination. Sensitivity is the probability that the test is positive in a patient with the disease: the proportion of true positives among the diseased. Specificity is the probability that the test is negative in a person without the disease: the proportion of true negatives among the non-diseased.

A very sensitive test misses few patients: a negative result allows the disease to be ruled out. It is chosen for screening or when missing a diagnosis would be serious. A very specific test gives few false alarms: a positive result allows the disease to be confirmed. It is chosen to confirm a diagnosis before a heavy treatment.

Sensitivity and specificity are properties of the test, which in principle do not depend on how common the disease is in the population tested.

Predictive values depend on prevalence

The doctor, however, knows the test result and wonders whether the patient is ill. This is the positive predictive value, the probability of being ill when the test is positive, and the negative predictive value, the probability of not being ill when it is negative. Both depend strongly on prevalence.

Take 10,000 people, a prevalence of 1%, a test 90% sensitive and 95% specific. Of the 100 patients, 90 test positive. Of the 9,900 without the disease, 5%, or 495, test falsely positive. Of the 585 positive tests, only 90 correspond to patients: the positive predictive value is only about 15%. The negative predictive value exceeds 99.8%.

The same test, used in a department where prevalence reaches 30%, would have a much higher positive predictive value. This is why screening a population in which the disease is rare produces many false positives, which must be confirmed by a second, more specific examination.

Choosing a threshold: the ROC curve

Many tests give a continuous value, such as a blood concentration, and it is the choice of threshold that makes them positive or negative. Lowering the threshold increases sensitivity but lowers specificity; raising it does the opposite. One cannot win on both fronts at once.

The ROC curve plots, for all possible thresholds, sensitivity against one minus specificity. A perfect test would pass through the top left corner; a useless test, no better than chance, would follow the diagonal. The area under the curve summarises overall performance: 0.5 for a worthless test, 1 for a perfect one.

Likelihood ratios combine sensitivity and specificity. The positive likelihood ratio, sensitivity divided by one minus specificity, tells how many times more often a positive test occurs in a patient than in someone without the disease. The higher it is, the more a positive result raises the probability of disease.

56 answered questions go with this chapter in the practice section.

Sources and further reading

Reference textbooks

  • Daniel Schwartz, Méthodes statistiques à l'usage des médecins et des biologistes, Flammarion Médecine-Sciences.
  • Jean Bouyer et coll., Épidémiologie. Principes et méthodes quantitatives, Inserm.

Open access

Last revised : . Text licensed under CC BY-SA 4.0.

The 3D atlas, the questions and progress tracking require JavaScript.