Sensitivity and Specificity - Wikipedia
Sensitivity and Specificity - Wikipedia
In medicine and statistics, sensitivity and specificity mathematically describe the accuracy of a test that reports
the presence or absence of a medical condition. If individuals who have the condition are considered "positive" and
those who do not are considered "negative", then sensitivity is a measure of how well a test can identify true
positives and specificity is a measure of how well a test can identify true negatives:
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 1/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
If the true status of the condition cannot be known, sensitivity and specificity can be defined relative to a "gold
standard test" which is assumed correct. For all testing, both diagnoses and screening, there is usually a trade-off
between sensitivity and specificity, such that higher sensitivities will mean lower specificities and vice versa.
A test which reliably detects the presence of a condition, resulting in a high number of true positives and low
number of false negatives, will have a high sensitivity. This is especially important when the consequence of failing
to treat the condition is serious and/or the treatment is very effective and has minimal side effects.
A test which reliably excludes individuals who do not have the condition, resulting in a high number of true
negatives and low number of false positives, will have a high specificity. This is especially important when people
who are identified as having a condition may be subjected to more testing, expense, stigma, anxiety, etc.
The terms "sensitivity" and "specificity" were introduced by American biostatistician Jacob Yerushalmy in 1947.[1]
There are different definitions within laboratory quality control, wherein "analytical sensitivity" is defined as the
smallest amount of substance in a sample that can accurately be measured by an assay (synonymously to
detection limit), and "analytical specificity" is defined as the ability of an assay to measure one particular organism
or substance, rather than others.[2] However, this article deals with diagnostic sensitivity and specificity as defined
at top.
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 3/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
Definition
Sensitivity
Consider the example of a medical test for diagnosing a condition. Sensitivity (sometimes also named the
detection rate in a clinical setting) refers to the test's ability to correctly detect ill patients out of those who do have
the condition.[4] Mathematically, this can be expressed as:
A negative result in a test with high sensitivity can be useful for "ruling out" disease,[4] since it rarely misdiagnoses
those who do have the disease. A test with 100% sensitivity will recognize all patients with the disease by testing
positive. In this case, a negative test result would definitively rule out the presence of the disease in a patient.
However, a positive result in a test with high sensitivity is not necessarily useful for "ruling in" disease. Suppose a
'bogus' test kit is designed to always give a positive reading. When used on diseased patients, all patients test
positive, giving the test 100% sensitivity. However, sensitivity does not take into account false positives. The bogus
test also returns positive on all healthy patients, giving it a false positive rate of 100%, rendering it useless for
detecting or "ruling in" the disease.
The calculation of sensitivity does not take into account indeterminate test results. If a test cannot be repeated,
indeterminate samples either should be excluded from the analysis (the number of exclusions should be stated
when quoting sensitivity) or can be treated as false negatives (which gives the worst-case value for sensitivity and
may therefore underestimate it).
Specificity
Consider the example of a medical test for diagnosing a disease. Specificity refers to the test's ability to correctly
reject healthy patients without a condition. Mathematically, this can be written as:
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 4/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
A positive result in a test with high specificity can be useful for "ruling in" disease, since the test rarely gives
positive results in healthy patients.[5] A test with 100% specificity will recognize all patients without the disease by
testing negative, so a positive test result would definitively rule in the presence of the disease. However, a negative
result from a test with high specificity is not necessarily useful for "ruling out" disease. For example, a test that
always returns a negative test result will have a specificity of 100% because specificity does not consider false
negatives. A test like that would return negative for patients with the disease, making it useless for "ruling out" the
disease.
Graphical illustration
decreases. The sensitivity at line A is 100% because at that point there are zero false negatives, meaning that all the
negative test results are true negatives. When moving to the right, the opposite applies, the specificity increases
until it reaches the B line and becomes 100% and the sensitivity decreases. The specificity at line B is 100% because
the number of false positives is zero at that line, meaning all the positive test results are true positives.
For the figure that shows high sensitivity and low specificity, there are 3 FN and 8 FP. Using the fact that positive
results = true positives (TP) + FP, we get TP = positive results - FP, or TP = 40 - 8 = 32. The number of sick people
in the data set is equal to TP + FN, or 32 + 3 = 35. The sensitivity is therefore 32 / 35 = 91.4%. Using the same
method, we get TN = 40 - 3 = 37, and the number of healthy people 37 + 8 = 45, which results in a specificity of
37 / 45 = 82.2 %.
For the figure that shows low sensitivity and high specificity, there are 8 FN and 3 FP. Using the same method as
the previous figure, we get TP = 40 - 3 = 37. The number of sick people is 37 + 8 = 45, which gives a sensitivity of
37 / 45 = 82.2 %. There are 40 - 8 = 32 TN. The specificity therefore comes out to 32 / 35 = 91.4%.
Similar to the previously explained figure, the red dot indicates the patient with the medical condition. However, in
this case, the green background indicates that the test predicts that all patients are free of the medical condition.
The number of data point that is true negative is then 26, and the number of false positives is 0. This result in 100%
specificity (from 26 / (26 + 0)). Therefore, sensitivity or specificity alone cannot be used to measure the
performance of the test.
Medical usage
In medical diagnosis, test sensitivity is the ability of a test to correctly identify those with the disease (true positive
rate), whereas test specificity is the ability of the test to correctly identify those without the disease (true negative
rate). If 100 patients known to have a disease were tested, and 43 test positive, then the test has 43% sensitivity. If
100 with no disease are tested and 96 return a completely negative result, then the test has 96% specificity.
Sensitivity and specificity are prevalence-independent test characteristics, as their values are intrinsic to the test
and do not depend on the disease prevalence in the population of interest.[6] Positive and negative predictive
values, but not sensitivity or specificity, are values influenced by the prevalence of disease in the population that is
being tested. These concepts are illustrated graphically in this applet Bayesian clinical diagnostic model (https://ke
nnis-research.shinyapps.io/Bayes-App/) which show the positive and negative predictive values as a function of
the prevalence, sensitivity and specificity.
Misconceptions
It is often claimed that a highly specific test is effective at ruling in a disease when positive, while a highly sensitive
test is deemed effective at ruling out a disease when negative.[7][8] This has led to the widely used mnemonics
SPPIN and SNNOUT, according to which a highly specific test, when positive, rules in disease (SP-P-IN), and a
highly sensitive test, when negative, rules out disease (SN-N-OUT). Both rules of thumb are, however, inferentially
misleading, as the diagnostic power of any test is determined by the prevalence of the condition being tested, the
test's sensitivity and its specificity.[9][10][11] The SNNOUT mnemonic has some validity when the prevalence of the
condition in question is extremely low in the tested sample.
The tradeoff between specificity and sensitivity is explored in ROC analysis as a trade off between TPR and FPR
(that is, recall and fallout).[12] Giving them equal weight optimizes informedness = specificity + sensitivity − 1 =
TPR − FPR, the magnitude of which gives the probability of an informed decision between the two classes (> 0
represents appropriate use of information, 0 represents chance-level performance, < 0 represents perverse use of
information).[13]
Sensitivity index
The sensitivity index or d′ (pronounced "dee-prime") is a statistic used in signal detection theory. It provides the
separation between the means of the signal and the noise distributions, compared against the standard deviation
of the noise distribution. For normally distributed signal and noise with mean and standard deviations and ,
and and , respectively, d′ is defined as:
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 8/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
[14]
An estimate of d′ can be also found from measurements of the hit rate and false-alarm rate. It is calculated as:
d′ is a dimensionless statistic. A higher d′ indicates that the signal can be more readily detected.
Confusion matrix
The relationship between sensitivity, specificity, and similar terms can be understood using the following table.
Consider a group with P positive instances and N negative instances of some condition. The four outcomes can be
formulated in a 2×2 contingency table or confusion matrix, as well as derivations of several metrics using the four
outcomes, as follows:
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 9/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
Sources: [16][17][18][19][20][21][22][23]
Predicted condition
False omission
Positive predictive value (PPV), Positive likelihood ratio Negative likelihood
Prevalence rate (FOR)
P precision FN (LR+) ratio (LR−)
= P + N TP = PN TPR FNR
= PP = 1 − FDR = FPR = TNR
= 1 − NPV
Negative
Accuracy Markedness (MK), deltaP Diagnostic
False discovery rate (FDR) predictive
(ACC) FP (Δp) odds ratio (DOR)
TP + TN = PP = 1 − PPV value (NPV) LR+
= P+N TN = PPV + NPV − 1 = LR−
= PN = 1 − FOR
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 10/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
A worked example
A diagnostic test with sensitivity 67% and
specificity 91% is applied to 2030 people to look
for a disorder with a population prevalence of
1.48%
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 11/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
Accuracy (ACC)
Total population Test outcome Test outcome = (TP + TN) / pop.
=2×
(pop.) = 2030 positive negative = (20 + 1820) / 2030
≈ 90.64% ≈ 0.17
Positive predictive
False omission rate Positive likelihood ratio Negativ
Prevalence value (PPV),
(FOR) (LR+)
= AP / pop. precision TPR FNR
= FN / (FN + TN) = FPR = TNR
= 30 / 2030 = TP / (TP + FP)
= 10 / (10 + 1820) = (20 / 30) / (180 / 2000) = (10 /
≈ 1.48% = 20 / (20 + 180)
≈ 0.55% ≈ 7.41 ≈ 0.366
= 10%
Related calculations
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 12/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
0.2686 ≈ 26.9%
This hypothetical screening test (fecal occult blood test) correctly identified two-thirds (66.7%) of patients with
colorectal cancer.[a] Unfortunately, factoring in prevalence rates reveals that this hypothetical test has a high false
positive rate, and it does not reliably identify colorectal cancer in the overall population of asymptomatic people
(PPV = 10%).
On the other hand, this hypothetical test demonstrates very accurate detection of cancer-free individuals
(NPV ≈ 99.5%). Therefore, when used for routine colorectal cancer screening with asymptomatic adults, a negative
result supplies important data for the patient and doctor, such as ruling out cancer as the cause of gastrointestinal
symptoms or reassuring patients worried about developing colorectal cancer.
Confidence intervals for sensitivity and specificity can be calculated, giving the range of values within which the
correct value lies at a given confidence level (e.g., 95%).[26]
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 13/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
generally unknown and much larger than the actual numbers of relevant and retrieved documents. This
assumption of very large numbers of true negatives versus positives is rare in other applications.[13]
The F-score can be used as a single measure of performance of the test for the positive class. The F-score is the
harmonic mean of precision and recall:
In the traditional language of statistical hypothesis testing, the sensitivity of a test is called the statistical power of
the test, although the word power in that context has a more general usage that is not applicable in the present
context. A sensitive test will have fewer Type II errors.
See also
Science
portal
Biology
portal
Medicine
portal
Brier score
Cumulative accuracy profile
Discrimination (information)
False positive paradox
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 14/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
Notes
References
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 17/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 18/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 19/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 20/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 21/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 22/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 23/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 24/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 25/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 26/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 27/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 28/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
Further reading
External links
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 30/31
12/13/24, 6:45 PM Sensitivity and specificity - Wikipedia
https://en.m.wikipedia.org/wiki/Sensitivity_and_specificity# 31/31