Sensitivity and Specificity Calculator (Diagnostic Test Accuracy, PPV, NPV)
Sensitivity, specificity, predictive values, accuracy and likelihood ratios from the four counts of a test result table, and the predictive values at any other prevalence.
Results
The dashed line marks the value you entered.
What this tool does
Sensitivity is the share of people who really have the condition that the test catches; specificity is the share of people without it that the test clears. Neither tells you what a positive result means for one person: that depends on how common the condition is. A test that is 90 % sensitive and 95 % specific gives a positive that is right only about 15 % of the time when 1 % of people have the condition, because the many healthy people produce more false alarms than the few sick ones produce true ones. Enter the prevalence of your own population to see the predictive values change. Counts from a study table carry its own prevalence, which may not match real life.
Formula
sensitivity = TP ÷ (TP + FN) · specificity = TN ÷ (TN + FP) · PPV = TP ÷ (TP + FP) · NPV = TN ÷ (TN + FN) · PPV at prevalence π = Se·π ÷ (Se·π + (1 − Sp)(1 − π))
Variables
| Symbol | Meaning | Unit |
|---|---|---|
tp | True positives (sick, test positive) | — |
fp | False positives (healthy, test positive) | — |
fn | False negatives (sick, test negative) | — |
tn | True negatives (healthy, test negative) | — |
pv | Prevalence to apply (optional) | % |
SE | Sensitivity (sick people the test catches) | % |
SP | Specificity (healthy people it clears) | % |
PPV | Positive predictive value (positive is right) | % |
NPV | Negative predictive value (negative is right) | % |
AC | Accuracy (all results right) | % |
PR | Prevalence in this table | % |
LP | Positive likelihood ratio (0 if undefined) | — |
LN | Negative likelihood ratio (0 if undefined) | — |
YJ | Youden's J (sensitivity + specificity − 1) | — |
PP | Positive predictive value at that prevalence | % |
NP | Negative predictive value at that prevalence | % |
Worked example
- True positives (sick, test positive)90
- False positives (healthy, test positive)40
- False negatives (sick, test negative)10
- True negatives (healthy, test negative)860
- Prevalence to apply (optional)1 %
- Sensitivity (sick people the test catches)90.00 %
- Specificity (healthy people it clears)95.56 %
- Positive predictive value (positive is right)69.23 %
- Negative predictive value (negative is right)98.85 %
- Accuracy (all results right)95.00 %
- Prevalence in this table10.00 %
- Positive likelihood ratio (0 if undefined)20.25
- Negative likelihood ratio (0 if undefined)0.105
- Youden's J (sensitivity + specificity − 1)0.856
- Positive predictive value at that prevalence16.98 %
- Negative predictive value at that prevalence99.89 %
Limitations
- This tool is informational only. It does not diagnose, treat or replace a qualified health professional. Speak to a doctor before making decisions about your health.
- The calculation runs at full precision and only the display is rounded. If you copy an intermediate value and retype it, small differences can appear.