PUBH-311 · Lesson 3 of 12 · 25 min
Probability and distributions
▶ Video coming soon A video version of this lesson is on the way.
A new rapid screening test for a sexually transmitted infection was being promoted to Kestrel Valley’s youth clinics. The manufacturer’s leaflet said the test correctly identified 90 percent of infected people and 95 percent of uninfected people. A clinic manager assumed that a positive result therefore meant a 90 percent chance of infection. Dr. Osei asked Jonah to work out what a positive result would really mean in a clinic where about 2 in every 100 clients were infected. His answer surprised the manager: barely more than one positive result in four would be a true infection. The difference lay in a few rules of probability.
Probability is the language of uncertainty, and every inferential method in this course rests on it. This lesson covers the basic rules of probability, conditional probability and its application to screening tests, and three probability distributions that recur throughout biostatistics: the binomial, the Poisson and the normal. The arithmetic is modest; the ideas are what matter.
What probability means
A probability is a number between 0 and 1 that describes how likely an event is. A probability of 0 means the event cannot happen; 1 means it is certain. In public health the most useful interpretation is the relative frequency view: the probability of an event is the proportion of times it would occur in a very large number of repetitions under the same conditions. If the probability that a newborn in a region is a boy is 0.512, then over many thousands of births about 512 in every 1,000 are boys. Probabilities can also be estimated from data: if 312 of 1,200 randomly selected adults have hypertension, our estimate of the probability that a randomly chosen adult has hypertension is 312/1,200 = 0.26.
The complement of an event A, written "not A," is everything that is not A. Its probability is \(P(\text{not } A) = 1 - P(A)\). If the probability that a person has had a flu shot is 0.42, the probability that they have not is 0.58.
The addition and multiplication rules
Two events are mutually exclusive if they cannot both happen: a person cannot be both 25 and 60 years old. For mutually exclusive events the probability that one or the other occurs is the sum of their probabilities. More generally, for any two events,
We subtract the overlap so that people in both groups are not counted twice. If 20 percent of adults smoke, 25 percent drink heavily and 8 percent do both, then the proportion who smoke or drink heavily is 0.20 + 0.25 − 0.08 = 0.37.
Two events are independent if knowing that one occurred does not change the probability of the other. For independent events,
If each of two unrelated people has a probability of 0.1 of carrying a particular gene variant, the probability that both carry it is 0.1 × 0.1 = 0.01. Many health events are not independent: smoking and heavy drinking cluster, infections spread within households and family members share genes and environments. Assuming independence when it does not hold is a common source of error, and it is one reason statistical methods for clustered data exist.
Conditional probability
A conditional probability is the probability of one event given that another has occurred, written \(P(A \mid B)\) and read "the probability of A given B." It is calculated as
Conditional probabilities are everywhere in epidemiology. The risk of lung cancer among smokers is a conditional probability, and the risk ratio compares two of them. Note that \(P(A \mid B)\) is usually not equal to \(P(B \mid A)\). The probability that a person with lung cancer smoked is high; the probability that a smoker develops lung cancer, while far higher than for a non-smoker, is much lower. Confusing the two directions, sometimes called the transposed conditional or prosecutor’s fallacy, is one of the most common errors in reasoning about evidence.
Probability and screening tests
Screening and diagnostic tests are the clearest application of conditional probability in health. Four quantities describe a test.
- Sensitivity is the probability that the test is positive given that the person has the condition, \(P(T+ \mid D+)\).
- Specificity is the probability that the test is negative given that the person does not have the condition, \(P(T- \mid D-)\).
- Positive predictive value (PPV) is the probability that the person has the condition given a positive test, \(P(D+ \mid T+)\).
- Negative predictive value (NPV) is the probability that the person does not have the condition given a negative test, \(P(D- \mid T-)\).
Sensitivity and specificity describe the test itself and are fairly stable across settings. Predictive values, which are what patients and clinicians actually want to know, depend heavily on the prevalence of the condition in the people being tested. The easiest way to calculate them is with natural frequencies in a two-by-two table, which is the approach Jonah used.
Worked problem
Predictive values of the clinic screening test
A test has sensitivity 0.90 and specificity 0.95. In a clinic population the prevalence of infection is 0.02. What proportion of positive results are true infections, and what proportion of negative results are truly uninfected?
Show solution
- Imagine 10,000 clients. With prevalence 0.02, 200 are infected and 9,800 are not.
- Of the 200 infected, the test detects 0.90 × 200 = 180 (true positives) and misses 20 (false negatives).
- Of the 9,800 uninfected, the test correctly clears 0.95 × 9,800 = 9,310 (true negatives) and wrongly flags 490 (false positives).
- Total positives = 180 + 490 = 670. PPV = 180/670 = 0.269.
- Total negatives = 20 + 9,310 = 9,330. NPV = 9,310/9,330 = 0.998.
Answer: Only about 27 in 100 positive results are true infections, because false positives from the large uninfected group outnumber true positives. A negative result is very reassuring (NPV 0.998). Positive screens therefore need confirmatory testing.
| Infected | Not infected | Total | |
|---|---|---|---|
| Test positive | 180 (true positive) | 490 (false positive) | 670 |
| Test negative | 20 (false negative) | 9,310 (true negative) | 9,330 |
| Total | 200 | 9,800 | 10,000 |
If the same test were used where prevalence was 0.20, the PPV would rise to about 0.82. This is why screening programs target groups at higher risk and why a positive screening result is a reason for a diagnostic test, not a diagnosis. The general formula linking these quantities is Bayes’ theorem, named after the 18th-century minister Thomas Bayes; the two-by-two table is simply Bayes’ theorem done with counts.
Random variables and probability distributions
A random variable is a numerical quantity whose value depends on chance, such as the number of smokers in a random sample of 10 adults or the blood pressure of a randomly selected person. A probability distribution lists the possible values and their probabilities (for discrete variables) or describes probabilities through a smooth curve called a density (for continuous variables). Distributions let us calculate how likely particular results are, which is the foundation of hypothesis testing.
The binomial distribution
The binomial distribution describes the number of "successes" in a fixed number of independent trials, each with the same probability of success. In health, a success simply means the outcome of interest: a smoker, a vaccinated child, a positive test. Four conditions apply: a fixed number of trials \(n\); two possible outcomes per trial; the same probability \(p\) on each trial; and independent trials.
The probability of exactly \(k\) successes is
where \(\binom{n}{k}\), read "n choose k," is the number of ways to choose which \(k\) of the \(n\) trials are successes. The mean of a binomial variable is \(np\) and its standard deviation is \(\sqrt{np(1-p)}\).
Worked problem
Smokers in a small sample
Suppose 12 in every 100 adults in a region smoke daily (p = 0.12). If 10 adults are chosen at random, what is the probability that none smoke? Exactly two? At least one?
Show solution
- None: \(P(X=0) = 0.88^{10} = 0.279\).
- Exactly two: \(\binom{10}{2} = 45\), so \(P(X=2) = 45 \times 0.12^2 \times 0.88^8 = 45 \times 0.0144 \times 0.360 = 0.233\).
- At least one: use the complement, \(1 - P(X=0) = 1 - 0.279 = 0.721\).
- The expected number of smokers is \(np = 10 \times 0.12 = 1.2\).
Answer: P(none) = 0.28, P(exactly two) = 0.23 and P(at least one) = 0.72. Even when 12 in 100 adults smoke, more than a quarter of samples of 10 contain no smokers at all, a reminder of how variable small samples are.
The Poisson distribution
The Poisson distribution, named after the French mathematician Siméon Denis Poisson, describes the number of events occurring in a fixed interval of time or space when events happen independently at a constant average rate. It suits counts of rare events in large populations: weekly cases of a notifiable disease, deaths from a particular cause in a year, or injuries at an intersection. It has a single parameter, the mean count \(\lambda\) (lambda), and its variance also equals \(\lambda\). The probability of exactly \(k\) events is
Public health surveillance uses the Poisson distribution to judge whether a cluster of cases is unusual. If a county normally records 3 cases of a rare infection per year, the probability of 7 or more in a year is about 0.034 under a Poisson model with \(\lambda = 3\). Such a count would prompt a closer look, though not alarm on its own; with many diseases and many counties being monitored, some unusual counts are expected by chance. When counts vary more than the Poisson model predicts, a situation called overdispersion, analysts use alternatives such as the negative binomial distribution.
The normal distribution
The normal distribution, also called the Gaussian distribution after the mathematician Carl Friedrich Gauss, is the familiar bell-shaped curve. It is symmetric about its mean \(\mu\), and its spread is set by its standard deviation \(\sigma\). Many biological measurements, such as height and blood pressure in adults, are approximately normal, and, more importantly, sample means are approximately normal in large samples whatever the shape of the original data (the central limit theorem, Lesson 4). This is why the normal distribution underlies so many statistical methods.
For any normal distribution, about 68 percent of values lie within one standard deviation of the mean, about 95 percent within two (more precisely 1.96) and about 99.7 percent within three (Figure 1). This is the 68-95-99.7 rule, or empirical rule.
Standardizing with z-scores
A z-score tells us how many standard deviations a value lies above or below the mean:
Any normal variable can be converted to the standard normal distribution, which has mean 0 and standard deviation 1. Probabilities for the standard normal are found in tables or software. A few values are worth knowing: the area above z = 1.645 is 0.05, above z = 1.96 is 0.025, and above z = 2.576 is 0.005. These critical values reappear in confidence intervals and tests.
Worked problem
Using z-scores for blood pressure
Suppose systolic blood pressure among adults aged 40 to 49 in a region is approximately normal with mean 122 mmHg and standard deviation 15 mmHg. What proportion have systolic pressure of 140 mmHg or higher? What proportion are below 100 mmHg?
Show solution
- For 140 mmHg: z = (140 − 122)/15 = 1.20.
- From a standard normal table, the area below z = 1.20 is 0.885, so the area above is 1 − 0.885 = 0.115.
- For 100 mmHg: z = (100 − 122)/15 = −1.47.
- The area below z = −1.47 is about 0.071.
Answer: About 11.5 percent of adults in this group would have systolic pressure of 140 mmHg or higher and about 7 percent below 100 mmHg, provided the normal model fits.
Z-scores are also used directly in practice. Child growth is assessed with z-scores of weight-for-age and height-for-age against WHO growth standards, and bone mineral density is reported as T-scores and Z-scores relative to reference populations. In each case the idea is the same: express a measurement as a distance from a reference mean in standard deviation units.
When the normal model does not fit
Not every variable is normal. Skewed variables such as costs, counts of rare events and many biomarkers can be badly described by a normal curve, and applying the 68-95-99.7 rule to them gives wrong answers. Analysts check normality with histograms and normal quantile plots (Q-Q plots), in which normal data fall close to a straight line. Fortunately, as the next lesson shows, methods based on sample means are fairly robust to non-normal data when samples are reasonably large.
| Distribution | Type of variable | Parameters | Public health example |
|---|---|---|---|
| Binomial | Count of successes in n independent trials | n and p | Number vaccinated among 50 sampled children |
| Poisson | Count of events in a time or space interval | λ (mean = variance) | Weekly cases of a rare infection |
| Normal | Continuous, symmetric | μ and σ | Adult height; distribution of sample means |
Back to the clinic
The clinic manager decided to keep the rapid test, because it found most infections quickly and a negative result was highly reliable. But the clinic changed its counselling: clients with a positive rapid result were told they needed a confirmatory laboratory test before any diagnosis, and staff explained why using the natural frequency table. Jonah’s two-by-two table became a laminated card in every counselling room.
Common mistakes
MistakeTreating sensitivity as the probability of disease after a positive test.
InsteadSensitivity is P(positive | disease); the PPV, P(disease | positive), depends on prevalence.
MistakeMultiplying probabilities of events that are not independent.
InsteadUse the multiplication rule P(A) × P(B) only when events are independent; otherwise use conditional probabilities.
MistakeAdding probabilities of overlapping events without subtracting the overlap.
InsteadP(A or B) = P(A) + P(B) − P(A and B).
MistakeApplying the 68-95-99.7 rule to a strongly skewed variable.
InsteadCheck the shape first; the rule applies only to approximately normal distributions.
Summary and key terms
- Probabilities range from 0 to 1 and can be interpreted as long-run relative frequencies.
- The addition rule subtracts overlaps; the multiplication rule P(A) × P(B) holds only for independent events.
- Conditional probability P(A | B) differs from P(B | A); confusing them is the transposed conditional fallacy.
- Sensitivity and specificity describe a test; predictive values depend strongly on prevalence and are easiest to find with a natural frequency table.
- The binomial distribution counts successes in n independent trials; the Poisson distribution counts events at a constant rate.
- The normal distribution is symmetric; about 68, 95 and 99.7 percent of values lie within 1, 2 and 3 SDs of the mean.
- A z-score expresses a value as a number of standard deviations from the mean.
- Probability
- A number from 0 to 1 describing how likely an event is.
- Independent events
- Events where the occurrence of one does not change the probability of the other.
- Conditional probability
- The probability of an event given that another event has occurred.
- Sensitivity
- The probability that a test is positive in a person who has the condition.
- Specificity
- The probability that a test is negative in a person who does not have the condition.
- Positive predictive value
- The probability that a person with a positive test has the condition.
- Binomial distribution
- The distribution of the number of successes in a fixed number of independent trials with constant probability.
- Poisson distribution
- The distribution of the number of events in an interval when events occur independently at a constant rate.
- Normal distribution
- A symmetric, bell-shaped continuous distribution defined by its mean and standard deviation.
- Z-score
- The number of standard deviations a value lies from the mean.
Practice problems
Work each problem on paper first, then reveal the answer to check.
A test with sensitivity 0.80 and specificity 0.90 is used where prevalence is 0.10. Using 1,000 people, find the PPV.
Show answer
100 have the condition: 80 true positives. 900 do not: 90 false positives. PPV = 80/170 = 0.47.
If 30 percent of adults are obese and 10 percent have diabetes, and 6 percent have both, are obesity and diabetes independent?
Show answer
No. Under independence P(both) would be 0.30 × 0.10 = 0.03, but it is 0.06, twice as large.
Adult heights in a population are normal with mean 170 cm and SD 10 cm. Roughly what proportion are taller than 190 cm?
Show answer
z = 2, so about 2.5 percent (half of the 5 percent outside ±2 SD; more precisely 2.3 percent).
A hospital averages 2 cases of a rare infection per month. Which distribution would you use to judge whether 6 cases in one month is unusual, and why?
Show answer
The Poisson distribution, because it models counts of rare, independent events in a fixed time interval at a constant average rate.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.