Sensitivity and Specificity Calculator
Enter test results against the reference standard to get accuracy measures with 95% CIs.
Sensitivity is the share of people with the condition who test positive, TP / (TP + FN). Specificity is the share without the condition who test negative, TN / (TN + FP). PPV and NPV give the probability that a positive or negative result is correct and depend on prevalence. Likelihood ratios combine sensitivity and specificity: LR+ = sensitivity / (1 − specificity) and LR− = (1 − sensitivity) / specificity.
Free, runs in your browser. Nothing you enter is uploaded.
Formula
Sens = TP/(TP+FN), Spec = TN/(TN+FP), PPV = TP/(TP+FP), NPV = TN/(TN+FN), LR+ = Sens/(1 − Spec), LR− = (1 − Sens)/Spec, PPV at prevalence p = Sens·p / [Sens·p + (1 − Spec)(1 − p)]
Proportions get Wilson score intervals, which stay inside 0 to 100% and behave well near the extremes. Likelihood ratio intervals use the log method of Simel and colleagues; if a cell is 0, 0.5 is added to every cell for the ratios. PPV and NPV from the table assume the study prevalence. Entering a prevalence recomputes them with Bayes' theorem for your setting.
Questions
How do you calculate sensitivity and specificity?
Sensitivity = true positives / all with the condition. Specificity = true negatives / all without it. With 92 true positives and 8 false negatives, sensitivity is 92 / 100 = 92%.
What is the difference between sensitivity and PPV?
Sensitivity asks how often the test is positive in people who have the condition. PPV asks how often a positive result means the person has it. Sensitivity is a property of the test, while PPV also depends on how common the condition is.
Why does PPV fall when prevalence is low?
When few people have the condition, most positives come from the much larger group without it. A test with 92% sensitivity and 91% specificity has a PPV of about 35% at 5% prevalence.
What is a good likelihood ratio?
LR+ above 10 or LR− below 0.1 usually changes the probability of disease enough to rule it in or out. Values between 0.5 and 2 barely change it.
Which confidence interval is used?
Wilson score intervals for sensitivity, specificity, PPV, NPV and accuracy, and the log method for likelihood ratios and the diagnostic odds ratio.
References
- Altman DG, Bland JM (1994). Diagnostic tests 1: sensitivity and specificity. BMJ 308:1552.
- Simel DL, Samsa GP, Matchar DB (1991). Likelihood ratios with confidence: sample size estimation for diagnostic test studies. J Clin Epidemiol 44:763-770.
- Wilson EB (1927). Probable inference, the law of succession, and statistical inference. J Am Stat Assoc 22:209-212.
More Statistics
- Standard Deviation Calculator
- Mean, Median & Mode Calculator
- Variance Calculator
- Z-Score Calculator
- P-Value Calculator
- Confidence Interval Calculator
- T-Test Calculator
- Chi-Square Test Calculator
- Correlation Coefficient Calculator
- Linear Regression Calculator
- Normal Distribution Calculator
- Probability Calculator
All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.