HOME    ABOUT    NEWS    JOB BANK     EVENTS    CONTACT

 

A Graphical Representation of How Sensitivity and Specificity Can Be Related to Prevalence
 

Author: Lawrence H. Moulton
             Professor Emeritus
             Johns Hopkins Bloomberg School of Public Health


Abstract
In introductory epidemiology classes and textbooks, the concepts of sensitivity, specificity, prevalence, and predictive values are introduced. It is common to see it stated that sensitivity and specificity are functions of the diagnostic test which is employed, and are not related to the prevalence of disease. Using plots of bivariate normal distributions, we  provide a straightforward demonstration of the general incorrectness of this statement, and how easily a departure from this phenomenon can arise.

Introduction
In the textbook Gordis Epidemiology1, we find: “Unlike the sensitivity and specificity of the test, which can be considered characteristic of the test being used, the PPV is affected by two factors: the prevalence of the disease in the population…” ChatGPT tells us “In epidemiology, sensitivity and specificity are generally considered to be independent of prevalence…” (accessed 4 November 2024). While these expositions are fine for a first course, students pursuing more advanced training soon discover there is a literature devoted to the situations where this is not the case. Perhaps the first publication was by Ransohoff & Feinstein2, which noted sensitivity and specificity can depend on the severity of disease and on comorbid conditions. Subsequently, the phenomenon sometimes has been referred to as “spectrum bias.” Early statistical treatments were given by Brenner & Gefeller3 and Choi4, followed by Hilden5, and publications explaining the nature of the problem continue to appear6. However, an easily apprehended description of how sensitivity and specificity can be related to prevalence has been lacking.

Demonstration of how sensitivity and specificity can be related to prevalence

Consider a population with a distribution of “true” systolic blood pressures (SBP) with mean 115 mm Hg and standard deviation (SD) 6 (Figure 1A). Suppose their blood pressures are then measured with some specified instrument, adding variability so that the SD of the observed measures is 10, but with the same mean of 115, and that the correlation of their true and observed SBP is 0.7. If SBP is defined as being above 130 mm Hg, we can delineate the familiar four areas of Figure 1A as those comprised of A:False Negatives, B:True Positives, C:True Negatives, and D:False Positives. Thus, sensitivity here is given by B/(B+D), and specificity by C/(A+C), where the letters designate the proportion of all the people in each designated area, with A+B+C+D=1. Sensitivity and specificity can be calculated exactly using the bivariate normal function (or approximately using simulation) as 73.8% and 93.7%, respectively.

Now suppose we come across a second population (Figure 1B), configured like the first population except now their true mean SBP is 140. We can see that the population is shifted from Figure 1a to 1b by moving the point cloud up and to the right. This results in sensitivity and specificity of 87.0% and 72.5%, respectively. Of particular interest is that this change in the parameters has been effected by changing the true prevalence, B+D, of high blood pressure in the first population from 0.6% to 97.7% in the second population.

In the days of transparencies and overhead projectors, this was easily demonstrated by moving two transparencies around on top of each other, one having the point cloud, the other the cutoff axes. Table 1 effectively does this, giving the values of sensitivity and specificity according to different prevalences and standard deviations. As might be expected, the positive and negative predictive values are more strongly associated with prevalence than are sensitivity and specificity.

A student might, at this point, ask “When are sensitivity and specificity not related to prevalence?” This can occur when the underlying condition is purely dichotomous, e.g. when a person either carries a gene or does not. Readers are invited to construct a corresponding graph, where individuals have only one of two values on an X-axis; changing the proportions with one or the other values will not affect the sensitivity and specificity of a specified test, even if the test results have a continuous distribution.

Data were generated and graphed with Stata 17 (College Station, TX).

Figure 1. Simulated systolic blood pressures (SBP), 10,000 in each panel. Red lines indicate the cutoff of 130 mm Hg as designating high blood pressure. A) True mean of 115, B) true mean of 140.

 

Table 1. Test Characteristics Associated with Varying True Mean Systolic Blood Pressures (SBP) and Standard Deviations (SD).
 

True SBP

True SD

Observed SD

Prevalence (%)

Sensitivity (%)

Specificity (%)

Positive Predictive Value (%)

Negative Predictive Value (%)

115

6

10

0.6

73.8

93.7

93.1

0.2

120

6

10

4.8

72.5

87.0

78.2

1.6

125

6

10

20.2

72.5

79.7

52.4

8.0

130

6

10

50.0

74.7

74.7

25.3

25.3

135

6

10

79.8

79.7

72.5

8.0

52.4

140

6

10

95.2

87.0

72.5

1.6

78.2

115

5

12

0.1

92.3

89.5

98.8

0.0

120

5

12

2.3

86.5

81.3

90.3

0.4

125

5

12

15.9

79.8

74.8

62.6

4.8

130

5

12

50.0

74.7

74.7

25.3

25.3

135

5

12

84.1

74.8

79.8

4.8

62.6

140

5

12

97.7

81.3

86.5

0.4

90.3

References

1.     Celentano D, Szklo M, Farag MK. Gordis Epidemiology. 7th ed. Philadelphia, PA: Elsevier; 2024.

2.     Ransohoff DF, Feinstein AR. Problems of spectrum and bias in evaluating the efficacy of diagnostic tests. N Engl J Med. 1978;299:926-930.

3.     Brenner H, Gefeller O. Variation of sensitivity, specificity, likelihood ratios and predictive values with disease prevalence. Stat Med. 1997;16:981-991.

4.     Choi BC. Causal modeling to estimate sensitivity and specificity of a test when prevalence changes. Epidemiology. 1997;8:80-86.

5.     Hilden J. Prevalence-free utility-respecting summary indices of diagnostic power do not exist. Stat Med. 2000;19:431-440.

6.     Fierz W. Diagnostic sensitivity, specificity, and likelihood ratio dependent on prevalence of disease-underlying cause. Arch Microbio Immuno 2023;7:96-110.

 

 

 

 

HOME    ABOUT    NEWS    JOB BANK     EVENTS    CONTACT