The Central Idea
A medical test compares two kinds of states:
- the person's underlying condition;
- the observed test result.
These are not the same thing.
The central idea is:
\[ \boxed{ \text{test result} + \text{test accuracy} + \text{prevalence} \longrightarrow \text{updated probability} } \]Public-health inference extends the same logic from individuals to populations.
A Two-by-Two Testing Table
A binary test can be summarized using a contingency table.
| Condition Present | Condition Absent | |
|---|---|---|
| Test Positive | True Positive | False Positive |
| Test Negative | False Negative | True Negative |
This table organizes most introductory diagnostic-testing measures.
True Positives
A true positive occurs when:
- the condition is present;
- the test result is positive.
Symbolically,
\[ \boxed{D\cap T^+}. \]False Positives
A false positive occurs when:
- the condition is absent;
- the test result is positive.
Symbolically,
\[ \boxed{D^c\cap T^+}. \]False Negatives
A false negative occurs when:
- the condition is present;
- the test result is negative.
Symbolically,
\[ \boxed{D\cap T^-}. \]True Negatives
A true negative occurs when:
- the condition is absent;
- the test result is negative.
Symbolically,
\[ \boxed{D^c\cap T^-}. \]Sensitivity
Sensitivity is the probability that the test is positive given that the condition is present.
\[ \boxed{ \text{Sensitivity} = P(T^+\mid D) }. \]Using counts,
\[ \boxed{ \text{Sensitivity} = \frac{\text{TP}} {\text{TP}+\text{FN}} }. \]Specificity
Specificity is the probability that the test is negative given that the condition is absent.
\[ \boxed{ \text{Specificity} = P(T^-\mid D^c) }. \]Using counts,
\[ \boxed{ \text{Specificity} = \frac{\text{TN}} {\text{TN}+\text{FP}} }. \]False-Negative Rate
The false-negative rate is
\[ \boxed{ P(T^-\mid D) = 1-\text{Sensitivity} }. \]If sensitivity is \(0.92\), then
\[ 1-0.92=\boxed{0.08}. \]False-Positive Rate
The false-positive rate is
\[ \boxed{ P(T^+\mid D^c) = 1-\text{Specificity} }. \]If specificity is \(0.95\), then
\[ 1-0.95=\boxed{0.05}. \]Prevalence
Prevalence is the proportion of a population that has a condition at a particular time or during a specified period.
In probability notation,
\[ \boxed{P(D)}. \]Prevalence acts as a prior probability when interpreting a diagnostic test in a target population.
Positive Predictive Value
Positive predictive value, or PPV, is the probability that the condition is present given a positive test.
\[ \boxed{ \operatorname{PPV} = P(D\mid T^+) }. \]Using counts,
\[ \boxed{ \operatorname{PPV} = \frac{\text{TP}} {\text{TP}+\text{FP}} }. \]Negative Predictive Value
Negative predictive value, or NPV, is the probability that the condition is absent given a negative test.
\[ \boxed{ \operatorname{NPV} = P(D^c\mid T^-) }. \]Using counts,
\[ \boxed{ \operatorname{NPV} = \frac{\text{TN}} {\text{TN}+\text{FN}} }. \]Sensitivity Is Not PPV
Sensitivity asks:
\[ P(T^+\mid D). \]PPV asks:
\[ P(D\mid T^+). \]These conditional probabilities reverse the condition.
In general,
\[ \boxed{ P(T^+\mid D) \ne P(D\mid T^+) }. \]Bayes' Theorem for a Positive Test
Bayes' theorem gives
\[ \boxed{ P(D\mid T^+) = \frac{P(T^+\mid D)P(D)} {P(T^+)} }. \]The denominator can be expanded using total probability:
\[ P(T^+) = P(T^+\mid D)P(D) + P(T^+\mid D^c)P(D^c). \]PPV Formula from Test Characteristics
Let:
\[ s=\text{sensitivity}, \] \[ c=\text{specificity}, \]and
\[ p=\text{prevalence}. \]Then
\[ \boxed{ \operatorname{PPV} = \frac{sp} {sp+(1-c)(1-p)} }. \]NPV Formula
Using the same notation,
\[ \boxed{ \operatorname{NPV} = \frac{c(1-p)} {c(1-p)+(1-s)p} }. \]A First Bayes Example
Suppose:
\[ P(D)=0.01, \] \[ P(T^+\mid D)=0.95, \]and specificity is
\[ 0.95. \]Therefore,
\[ P(T^+\mid D^c)=0.05. \]Then
\[ P(D\mid T^+) = \frac{0.95(0.01)} {0.95(0.01)+0.05(0.99)}. \]The numerator is
\[ 0.0095. \]The denominator is
\[ 0.0095+0.0495=0.059. \]Therefore,
\[ \boxed{ P(D\mid T^+) \approx0.161 }. \]Why the Positive Predictive Value Can Be Low
In the previous example, the test has \(95\%\) sensitivity and \(95\%\) specificity, yet PPV is only about \(16.1\%\).
Why?
The condition is rare:
\[ P(D)=0.01. \]There are many more condition-negative people available to generate false positives than condition-positive people available to generate true positives.
Natural-Frequency Method
Many testing problems become easier when probabilities are converted into expected counts.
Suppose \(10{,}000\) people are tested.
With \(1\%\) prevalence:
\[ 100 \]have the condition and
\[ 9900 \]do not.
Natural-Frequency Example Continued
With \(95\%\) sensitivity:
\[ 0.95(100)=95 \]true positives.
With \(95\%\) specificity, the false-positive rate is \(5\%\):
\[ 0.05(9900)=495 \]false positives.
Therefore,
\[ \operatorname{PPV} = \frac{95}{95+495} = \frac{95}{590} \approx \boxed{0.161}. \]Base-Rate Effects
Predictive values depend on prevalence.
If sensitivity and specificity remain fixed while prevalence rises, PPV generally rises.
If prevalence falls, PPV generally falls.
This is a base-rate effect.
Screening and Diagnostic Contexts
A test used in a low-prevalence screening population can have different predictive values from the same test used in a high-prevalence clinical population.
The test characteristics may be the same while the prior probability is different.
Likelihood Ratios
A likelihood ratio compares how likely a test result is under two competing states.
The positive likelihood ratio is
\[ \boxed{ LR^+ = \frac{\text{Sensitivity}} {1-\text{Specificity}} }. \]Negative Likelihood Ratio
The negative likelihood ratio is
\[ \boxed{ LR^- = \frac{1-\text{Sensitivity}} {\text{Specificity}} }. \]Smaller values of \(LR^-\) indicate stronger evidence against the condition from a negative result, under the model.
Odds Form of Bayes' Theorem
Bayes' theorem can also be written using odds:
\[ \boxed{ \text{posterior odds} = \text{prior odds} \times \text{likelihood ratio} }. \]This form is especially convenient when several approximately independent pieces of evidence are incorporated sequentially under an appropriate model.
From Probability to Odds
If a probability is \(p\), the corresponding odds are
\[ \boxed{ \frac{p}{1-p} }. \]If
\[ p=0.20, \]then the odds are
\[ \frac{0.20}{0.80} = \boxed{0.25}. \]From Odds Back to Probability
If odds are \(o\), then probability is
\[ \boxed{ p=\frac{o}{1+o} }. \]If
\[ o=3, \]then
\[ p=\frac{3}{4}=\boxed{0.75}. \]Repeated Testing
Repeated tests can change the posterior probability, but simply multiplying likelihood ratios assumes a suitable conditional-independence structure.
Repeated measurements may be correlated because they share:
- the same specimen;
- the same instrument;
- the same biological process;
- the same systematic bias.
Dependence must be modeled rather than ignored.
Threshold Tests
Many tests begin with a continuous measurement and classify results using a threshold.
If the measurement exceeds a cutoff, the result may be labeled positive.
Changing the threshold changes the balance between sensitivity and specificity.
Sensitivity-Specificity Tradeoff
In many threshold-based tests:
- lowering the threshold increases sensitivity;
- but may decrease specificity.
Raising the threshold often has the opposite effect.
The best threshold depends on the consequences of false positives and false negatives.
ROC Curves
A receiver operating characteristic, or ROC, curve plots
\[ \text{sensitivity} \]against
\[ \text{false-positive rate} = 1-\text{specificity} \]across possible thresholds.
It summarizes how discrimination changes as the cutoff changes.
Prevalence Versus Incidence
Prevalence measures how much disease or condition exists in a population.
Incidence concerns new cases arising over time.
These are different epidemiological quantities.
Risk
In public-health studies, risk is often a probability of an event during a specified period.
If \(x\) of \(n\) initially event-free individuals experience the event, then a simple estimated risk is
\[ \boxed{ \hat p=\frac{x}{n} }. \]Risk Difference
Suppose an exposed group has risk
\[ p_E \]and an unexposed group has risk
\[ p_U. \]The risk difference is
\[ \boxed{ RD=p_E-p_U }. \]Relative Risk
Relative risk compares two risks by ratio:
\[ \boxed{ RR=\frac{p_E}{p_U} }. \]If
\[ p_E=0.12 \]and
\[ p_U=0.06, \]then
\[ RR=\frac{0.12}{0.06}=\boxed{2}. \]Risk Difference and Relative Risk Say Different Things
In the previous example,
\[ RD=0.12-0.06=\boxed{0.06}. \]Relative risk is
\[ \boxed{2}. \]The first is an absolute difference of \(6\) percentage points.
The second is a multiplicative comparison.
Odds
For event probability \(p\), odds are
\[ \frac{p}{1-p}. \]If \(p=0.20\), then odds are
\[ \frac{0.20}{0.80}=\boxed{0.25}. \]Odds and probability are related but not identical.
Odds Ratio
If one group has event odds \(o_E\) and another has event odds \(o_U\), the odds ratio is
\[ \boxed{ OR=\frac{o_E}{o_U} }. \]Odds ratios are common in case-control studies and logistic regression.
Relative Risk Is Not the Odds Ratio
For rare outcomes, the odds ratio and relative risk can be numerically similar.
For common outcomes, they can differ substantially.
They should not be treated as interchangeable.
Rates and Person-Time
When people are observed for different amounts of time, event frequency may be measured using person-time.
A simple incidence rate is
\[ \boxed{ \text{incidence rate} = \frac{\text{new events}} {\text{total person-time observed}} }. \]This is a rate rather than a probability.
Probability and Rate Are Different
A risk such as
\[ 0.10 \]is dimensionless.
An incidence rate such as
\[ 4\text{ cases per }1000\text{ person-years} \]has units involving time.
These quantities answer different questions.
Sampling
Public-health inference usually relies on a sample rather than observing an entire target population.
Sampling raises questions about:
- representativeness;
- selection bias;
- nonresponse;
- sample size;
- measurement quality.
Sampling Variability
If a sample proportion is
\[ \hat p=\frac{x}{n}, \]its approximate standard error under simple random-sampling assumptions is
\[ \boxed{ \operatorname{SE}(\hat p) = \sqrt{\frac{p(1-p)}{n}} }. \]In practice, \(p\) is often estimated by \(\hat p\).
Confidence Intervals
A confidence interval uses sample data to describe uncertainty about a population quantity.
A simple large-sample form for a proportion is
\[ \boxed{ \hat p \pm z^\ast \operatorname{SE}(\hat p) }. \]More specialized methods may be preferable when counts are small or proportions are near \(0\) or \(1\).
Confidence Does Not Mean Probability of the Fixed Parameter
Under the usual frequentist interpretation, a \(95\%\) confidence interval procedure is designed so that approximately \(95\%\) of intervals produced in repeated sampling contain the true fixed parameter.
The realized interval either contains the parameter or does not.
Surveillance
Public-health surveillance tracks events over time.
Data may include:
- case counts;
- hospitalizations;
- test positivity;
- mortality;
- syndromic indicators;
- laboratory results.
Trends can reflect both real changes and changes in measurement or reporting.
Test Positivity
A simple test-positivity proportion is
\[ \boxed{ \frac{\text{positive tests}} {\text{tests performed}} }. \]This quantity is not automatically equal to population prevalence because the tested group may not be representative and the test is imperfect.
Ascertainment
Ascertainment describes how cases or events are detected and recorded.
Changes in testing intensity, access, reporting, or case definitions can change observed counts even when underlying disease frequency changes less.
Selection Bias
Selection bias occurs when inclusion in the observed data depends on factors related to the outcome or exposure in a way that distorts the target comparison.
A very large sample can still be biased if it is not representative of the target population.
Measurement Error
Medical and public-health data can contain measurement error.
Sources include:
- imperfect tests;
- instrument error;
- self-report error;
- coding differences;
- classification rules.
Measurement quality affects the validity of inference.
Misclassification
A binary variable can be misclassified when some true positives are labeled negative or some true negatives are labeled positive.
Sensitivity and specificity are therefore not limited to laboratory tests. They also apply to classification systems more generally.
Confounding
A confounder is a variable associated with both the exposure and outcome that can distort a causal comparison when not properly addressed.
Observed association alone does not prove causation.
Stratification
One way to inspect potential confounding is to compare results within subgroups.
For example, a population-wide risk ratio may be decomposed by:
- age group;
- sex;
- region;
- baseline-risk group.
Stratification can reveal whether an aggregate association differs across important subpopulations.
Simpson's Paradox
An aggregate association can reverse or change substantially when data are separated into relevant subgroups.
This phenomenon is known as Simpson's paradox.
It illustrates why population structure matters when interpreting percentages and rates.
Standardization
Populations may have different age or risk structures.
Standardization adjusts comparisons to a common reference distribution so that structural differences do not dominate the comparison.
This is especially useful for rates that vary strongly by age or other strata.
Absolute and Relative Effects
Public-health communication should often report both absolute and relative measures.
Suppose risk falls from
\[ 2\% \]to
\[ 1\%. \]The absolute reduction is
\[ 2\%-1\%=\boxed{1\text{ percentage point}}. \]The relative reduction is
\[ \frac{2\%-1\%}{2\%}=\boxed{50\%}. \]Number Needed to Treat as a Reciprocal
In simplified settings with a meaningful causal risk difference, the number needed to treat is sometimes written
\[ \boxed{ NNT=\frac{1}{ARR} }. \]Here \(ARR\) is absolute risk reduction expressed as a proportion.
Interpretation requires a clearly defined population, intervention, outcome, and time horizon.
Number Needed to Treat Example
If
\[ ARR=0.05, \]then
\[ NNT=\frac{1}{0.05}=\boxed{20}. \]The number should be interpreted as a population-level summary under the study assumptions, not a guaranteed individual outcome.
Correlation Does Not Establish Causation
Public-health data often reveal associations.
Causal interpretation may require additional design or assumptions, such as:
- randomization;
- control of confounding;
- temporal ordering;
- measurement validity;
- causal-model assumptions.
Screening Is a Population Decision
Screening programs are not judged only by test sensitivity and specificity.
Population-level evaluation may also consider:
- prevalence;
- benefits of earlier detection;
- harms of false positives;
- harms of false negatives;
- follow-up burden;
- cost;
- access and feasibility.
Decision Thresholds
A test result may change a probability without automatically determining an action.
Decisions can depend on whether the updated probability crosses a threshold at which:
- additional testing;
- monitoring;
- treatment;
- no further action
becomes preferable under the decision model.
Common Error: Reversing Conditional Probability
The statement
\[ P(T^+\mid D)=0.95 \]does not mean
\[ P(D\mid T^+)=0.95. \]Bayes' theorem is needed to reverse the conditioning.
Common Error: Ignoring Prevalence
Predictive values depend on the base rate.
A test can perform well in terms of sensitivity and specificity yet have a low PPV in a very low-prevalence population.
Common Error: Confusing Specificity with NPV
Specificity is
\[ P(T^-\mid D^c). \]NPV is
\[ P(D^c\mid T^-). \]They condition on different events.
Common Error: Treating Test Positivity as Prevalence
Test positivity depends on:
- who gets tested;
- test sensitivity;
- test specificity;
- underlying prevalence.
Therefore,
\[ \boxed{\text{test positivity}\ne\text{prevalence}} \]in general.
Common Error: Confusing Relative and Absolute Risk
A \(50\%\) relative reduction can correspond to a small or large absolute difference depending on baseline risk.
Reporting both often gives a clearer picture.
Common Error: Treating Odds and Probability as the Same
If
\[ p=0.50, \]then odds are
\[ \frac{0.50}{0.50}=1. \]The probability is \(0.50\), while the odds are \(1\) to \(1\).
Common Error: Ignoring Dependence in Repeated Tests
Two tests performed on the same biological process may share errors.
Treating them as independent when they are not can exaggerate the amount of new information.
Common Error: Causal Claims from Unadjusted Association
A difference in disease rates between two groups may reflect:
- causal effects;
- confounding;
- selection bias;
- measurement error;
- random variation.
Study design matters.
A Reliable Procedure for Diagnostic-Test Problems
- Define the condition state and test-result state.
- Record sensitivity and specificity.
- Convert specificity into false-positive rate if needed.
- Record prevalence.
- Use a two-by-two table or natural-frequency model.
- Calculate true positives, false positives, false negatives, and true negatives.
- Compute PPV or NPV as requested.
- Check the direction of every conditional probability.
- Interpret the result as a probability under the stated model.
A Reliable Procedure for Bayes Testing Problems
- Write the prior probability \(P(D)\).
- Write the likelihood \(P(T\mid D)\).
- Write the corresponding probability under \(D^c\).
- Calculate the total probability of the observed result.
- Apply Bayes' theorem.
- Check that the posterior lies between \(0\) and \(1\).
- Compare prior and posterior to understand how much the test changed belief.
A Reliable Procedure for Public-Health Comparisons
- Define the target population.
- Define the exposure and outcome.
- Specify the time period.
- Calculate risks or rates with correct denominators.
- Report absolute and relative measures when useful.
- Check sampling and measurement quality.
- Consider confounding and stratification.
- Quantify uncertainty with intervals or other appropriate methods.
- Avoid causal claims beyond what the study design supports.
Example: Full Diagnostic-Test Workflow
Suppose a population has prevalence
\[ p=0.04. \]A test has:
\[ \text{sensitivity}=0.90 \]and
\[ \text{specificity}=0.96. \]Imagine testing \(10{,}000\) people.
Expected condition-positive count:
\[ 10000(0.04)=400. \]Expected condition-negative count:
\[ 10000-400=9600. \]True positives:
\[ 400(0.90)=360. \]False positives:
\[ 9600(0.04)=384. \]Therefore,
\[ \operatorname{PPV} = \frac{360}{360+384} = \frac{360}{744} \approx \boxed{0.484}. \]Example: Full Risk-Comparison Workflow
Suppose an exposed group contains \(1000\) people and \(120\) develop an outcome.
The unexposed group contains \(1000\) people and \(60\) develop the outcome.
Exposed risk:
\[ p_E=\frac{120}{1000}=0.12. \]Unexposed risk:
\[ p_U=\frac{60}{1000}=0.06. \]Risk difference:
\[ RD=0.12-0.06=\boxed{0.06}. \]Relative risk:
\[ RR=\frac{0.12}{0.06}=\boxed{2}. \]Example: Full Likelihood-Ratio Workflow
Suppose sensitivity is
\[ 0.90 \]and specificity is
\[ 0.95. \]Then
\[ LR^+ = \frac{0.90}{1-0.95} = \frac{0.90}{0.05} = \boxed{18}. \]The negative likelihood ratio is
\[ LR^- = \frac{1-0.90}{0.95} = \frac{0.10}{0.95} \approx \boxed{0.105}. \]Practice 1: Sensitivity
A study contains \(90\) true positives and \(10\) false negatives.
Find sensitivity.
Practice 2: Specificity
A study contains \(180\) true negatives and \(20\) false positives.
Find specificity.
Practice 3: False-Positive Rate
A test has specificity \(0.97\).
Find the false-positive rate.
Practice 4: PPV from Counts
There are \(80\) true positives and \(20\) false positives.
Find PPV.
Practice 5: NPV from Counts
There are \(190\) true negatives and \(10\) false negatives.
Find NPV.
Practice 6: Relative Risk
Risk is \(0.15\) in one group and \(0.05\) in another.
Find relative risk.
Practice 7: Risk Difference
Using the same risks from Practice 6, find the risk difference.
Practice 8: Positive Likelihood Ratio
Sensitivity is \(0.80\) and specificity is \(0.90\).
Find \(LR^+\).
Practice 9: Probability to Odds
Convert probability
\[ p=0.25 \]to odds.
Practice 10: Absolute Risk Reduction
Risk falls from \(0.12\) to \(0.08\).
Find the absolute risk reduction.
Practice Answers
Practice 1
\[ \text{Sensitivity} = \frac{90}{90+10} = \boxed{0.90}. \]Practice 2
\[ \text{Specificity} = \frac{180}{180+20} = \boxed{0.90}. \]Practice 3
\[ 1-0.97=\boxed{0.03}. \]Practice 4
\[ \operatorname{PPV} = \frac{80}{80+20} = \boxed{0.80}. \]Practice 5
\[ \operatorname{NPV} = \frac{190}{190+10} = \boxed{0.95}. \]Practice 6
\[ RR = \frac{0.15}{0.05} = \boxed{3}. \]Practice 7
\[ RD = 0.15-0.05 = \boxed{0.10}. \]Practice 8
\[ LR^+ = \frac{0.80}{1-0.90} = \frac{0.80}{0.10} = \boxed{8}. \]Practice 9
\[ \frac{0.25}{1-0.25} = \frac{0.25}{0.75} = \boxed{\frac13}. \]Practice 10
\[ ARR = 0.12-0.08 = \boxed{0.04}. \]The absolute reduction is \(4\) percentage points.
What to Remember
Medical testing and public-health inference rely on careful use of conditional probability, rates, sampling, and uncertainty.
- sensitivity is \(P(T^+\mid D)\);
- specificity is \(P(T^-\mid D^c)\);
- PPV is \(P(D\mid T^+)\);
- NPV is \(P(D^c\mid T^-)\);
- predictive values depend on prevalence;
- Bayes' theorem reverses conditional probability correctly;
- likelihood ratios update odds;
- risk, odds, rates, and prevalence are different quantities;
- absolute and relative effects provide different information;
- sampling and measurement quality affect population inference;
- association does not by itself establish causation;
- population structure can alter aggregate comparisons.
The central habit is: always identify what is being conditioned on, what population is being studied, and which denominator belongs to the quantity being calculated.
Where We Go Next
Medical testing and public-health inference show how probability and statistical reasoning translate measurements into evidence about individuals and populations. The next applied problem family broadens this idea to data collection and prediction more generally.
The next lesson, Surveys, Experiments, and Forecasting, develops sampling, experimental design, estimation, uncertainty, trend modeling, and prediction in applied decision settings.