Skip to content
Scintria
ToolsGrant writerFunding
HomeLiteratureClinical trialsEvidence LabProtocol packData analysisLearnProjectsLibraryReferencesApplications
Start free
ScintriaStart free

Learn / Biostatistics / Probability and distributions

Probability rules and why a positive test can mislead

14 minute read · 6-question quiz

Download this lesson as a colour Word or PDF study guide with the figures and answers. Included in paid plans; reading and quizzes stay free.Sign in

What you will learn

  • Use the addition, multiplication and conditional probability rules

  • Build a two-by-two table of expected counts for a screening test

  • Calculate and interpret sensitivity, specificity and predictive values with Bayes' theorem

Probability is a number between 0 (cannot happen) and 1 (certain) that describes how likely an event is. In health research it appears everywhere: the probability that a child with fever has malaria, that a patient survives five years, that a trial result is due to chance.

For an event A, P(A) is its probability. The probability that A does not happen is 1 - P(A), called the complement.

The three rules you need

  1. Addition rule. For two events that cannot happen together (mutually exclusive), P(A or B) = P(A) + P(B). If they can overlap, subtract the overlap: P(A or B) = P(A) + P(B) - P(A and B).
  2. Multiplication rule. For independent events (one tells you nothing about the other), P(A and B) = P(A) × P(B).
  3. Conditional probability. The probability of A given that B has happened is P(A | B) = (P(A and B))/(P(B)).

Independence and repeated chances

A rapid test has a 5% chance of a false alarm on a person without the disease. If 20 independent people without the disease are tested, the chance that nobody gets a false alarm is 0.95^20 = 0.358. So the chance of at least one false alarm is 1 - 0.358 = 0.642, about 64%. The same arithmetic explains why running many tests on one dataset almost guarantees a "significant" finding by chance (chapter 4).

Screening and diagnostic tests

A test is judged against a reference ("gold") standard. Four numbers describe it:

MeasureQuestion it answersFormula
SensitivityOf people with the disease, what share test positive?P(T^+ | D^+)
SpecificityOf people without the disease, what share test negative?P(T^- | D^-)
Positive predictive value (PPV)Of people who test positive, what share truly have the disease?P(D^+ | T^+)
Negative predictive value (NPV)Of people who test negative, what share truly do not?P(D^- | T^-)

Sensitivity and specificity are properties of the test. Predictive values depend also on prevalence, how common the disease is in the people tested. That is the point most often missed, even by clinicians.

Expected results in 1,000 peopleDiseaseNo diseaseTest positive4547.5Test negative5902.5Sensitivity = 45 / 50 = 90%Specificity = 902.5 / 950 = 95%PPV = 45 / 92.5 = 48.6%NPV = 902.5 / 907.5 = 99.4%
Expected counts make Bayes' theorem visible: more than half of the positives are false alarms.

Worked example: a good test, a surprising result

Imagine 1,000 people screened. Prevalence is 5%, so 50 have the disease and 950 do not.

  • Of the 50 with disease, 90% test positive: 45 true positives, 5 false negatives.
  • Of the 950 without disease, 5% test positive: 0.05 × 950 = 47.5 false positives, and 902.5 true negatives.
  • Everyone who tests positive: 45 + 47.5 = 92.5. Only 45 / 92.5 = 0.486 of them truly have the disease.

A positive result from a test that is 90% sensitive and 95% specific therefore means only a 49% chance of disease. If prevalence were 30%, the same test would give a PPV of 0.27 / (0.27 + 0.035) = 0.885, i.e. 89%.

Bayes' theorem for a test

PPV = (sens × prev)/(sens × prev + (1 - spec) × (1 - prev))

Plug in sens = 0.90, spec = 0.95, prev = 0.05: (0.045)/(0.045 + 0.0475) = 0.486.

The base-rate fallacy

Ignoring prevalence is called the base-rate fallacy. A screening programme in a low-prevalence population generates many false positives even with an excellent test. This is why mass screening for rare conditions needs a confirmatory test, and why the same HIV rapid-test algorithm performs differently in an antenatal clinic and in a low-risk blood-donor population.

Likelihood ratios

A likelihood ratio summarises how much a result changes the odds of disease and does not depend on prevalence.

LR^+ = (sensitivity)/(1 - specificity) LR^- = (1 - sensitivity)/(specificity)

For our test, LR^+ = 0.90 / 0.05 = 18 and LR^- = 0.10 / 0.95 = 0.105. Multiply the pre-test odds by the LR to get the post-test odds. Pre-test odds of disease are 0.05 / 0.95 = 0.0526; times 18 gives 0.947, which is a probability of 0.947 / 1.947 = 0.486. The same answer, by a different route.

A habit that prevents errors

Whenever a problem mentions a test and a prevalence, imagine 1,000 (or 10,000) people and fill in the two-by-two table with counts. It is slower than a formula and almost impossible to get wrong.

Summary

  • Probability runs from 0 to 1; complements sum to 1; independent events multiply; mutually exclusive events add.

  • Conditional probability P(A | B) is restricted to the people in whom B has happened.

  • Sensitivity and specificity describe the test; PPV and NPV also depend on prevalence.

  • At 5% prevalence, a test with 90% sensitivity and 95% specificity has a PPV of only 49%.

  • Likelihood ratios convert pre-test odds to post-test odds without needing prevalence in the test's own description.

Check your understanding

Question 1
1

Two independent tests each have a 10% chance of a false alarm. What is the chance of no false alarm in either?

Question 2
2

Sensitivity is best defined as:

Question 3
3

Prevalence falls from 30% to 3% and the test is unchanged. What happens to the PPV?

Question 4
4

A test has sensitivity 80% and specificity 90%. What is LR+?

Question 5
5

In 1,000 people with 10% prevalence, a test has 95% sensitivity and 90% specificity. How many false positives are expected?

Question 6
6

Which statement about specificity is correct?

Draft study guide. Spotted an error or something unclear? Tell us at hello@scintria.com. This is educational material, not clinical or regulatory advice.

Graphs that tell the truthThe binomial and Poisson distributions