Sensitivity, specificity, PPV and NPV calculator (2×2 table)

Enter your values. The answer and the full worked solution update as you type.

Result

Sensitivity90 %
Specificity96.67 %
PPV75 %
NPV98.86 %
LR+27
LR−0.1034
Prevalence10 %
Accuracy96 %
Disease presentDisease absentTotal
Test positive9030120
Test negative10870880
Total1009001000

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

sensitivity = a/(a + c) = 90/100 = 90%
specificity = d/(b + d) = 870/900 = 96.67%

Predictive values

PPV = a/(a + b) = 90/120 = 75%
NPV = d/(c + d) = 870/880 = 98.86%

Prevalence and accuracy

prevalence = (a + c)/N = 100/1000 = 10%
accuracy = (a + d)/N = 960/1000 = 96%

Likelihood ratios

LR+ = sensitivity/(1 − specificity) = 0.9/0.03333 = 27
LR− = (1 − sensitivity)/specificity = 0.1/0.9667 = 0.1034

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

  1. Set up the 2×2 table: a = true positives, b = false positives, c = false negatives, d = true negatives.
  2. 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.
  3. 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.
  4. LR+ = sensitivity/(1 − specificity) and LR− = (1 − sensitivity)/specificity.
  5. 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.

</> Embed

Free for teachers and schools: paste this code into your course page, LMS or website. Students can use the calculator and its worked solution without an account.

More calculators