Sensitivity, specificity, PPV and NPV calculator (2×2 table)
Enter your values. The answer and the full worked solution update as you type.
Result
| Disease present | Disease absent | Total | |
|---|---|---|---|
| Test positive | 90 | 30 | 120 |
| Test negative | 10 | 870 | 880 |
| Total | 100 | 900 | 1000 |
For exam practice only. This is a study aid, never a clinical decision: always follow the prescription, local protocols and the product information.
Evaluate a diagnostic or screening test. Enter the four counts of a 2×2 table (true and false positives and negatives) to get the sensitivity, specificity, positive and negative predictive values, likelihood ratios, prevalence and accuracy. Or start from the sensitivity, specificity and prevalence to see how the predictive values change in a population, worked out for 1000 people.
Step-by-step solution
Sensitivity and specificity
Predictive values
Prevalence and accuracy
Likelihood ratios
Key formulas
- Sensitivity and specificity
- Se = a/(a + c), Sp = d/(b + d)
- Predictive values
- PPV = a/(a + b), NPV = d/(c + d)
- Accuracy
- (a + d)/n
- Likelihood ratios
- LR+ = Se/(1 − Sp), LR− = (1 − Se)/Sp
- PPV at prevalence p
- Se·p / (Se·p + (1 − Sp)(1 − p))
How to calculate sensitivity, specificity, PPV and NPV
- Set up the 2×2 table: a = true positives, b = false positives, c = false negatives, d = true negatives.
- Sensitivity = a/(a + c): the share of people with the disease who test positive. Specificity = d/(b + d): the share without it who test negative.
- PPV = a/(a + b): the chance that a positive result is a true positive. NPV = d/(c + d): the chance that a negative result is a true negative.
- LR+ = sensitivity/(1 − specificity) and LR− = (1 − sensitivity)/specificity.
- With only sensitivity, specificity and prevalence, fill the table for 1000 people and read the predictive values from it.
Questions and answers
Why do PPV and NPV depend on prevalence?
Sensitivity and specificity are properties of the test, but predictive values also depend on how common the disease is. In a low-prevalence population even a good test produces many false positives, so the PPV falls.
What do SnNout and SpPin mean?
A highly Sensitive test, when Negative, rules a disease out (SnNout). A highly Specific test, when Positive, rules it in (SpPin).
What does a likelihood ratio tell me?
How much a result changes the odds of disease. An LR+ above 10 or an LR− below 0.1 changes them a lot; values near 1 hardly change anything.
Why is a value shown as not defined?
When a denominator is zero, for example when there are no positive results at all, the PPV cannot be calculated.
Practise it yourself
Practise Evidence-based practice statistics
A calculator gives the answer. In the exam you need the method: practise it with new problems, hints and worked solutions.