Sensitivity, specificity, PPV and NPV from a 2×2 table
Enter the four counts and this returns every diagnostic accuracy measure with confidence intervals — and shows why PPV changes when prevalence does.
Enter counts from your study. Rows are the test result, columns are the reference standard.
| Disease present | Disease absent | |
|---|---|---|
| Test positive | ||
| Test negative |
Why PPV is not a property of the test
Sensitivity and specificity describe the test. Move the same assay to another hospital and they stay roughly the same. Predictive values describe the test in a particular population, and they move sharply with prevalence.
Work the default numbers. In that sample, prevalence is 10%, and a positive result is right two thirds of the time. Put the identical test into a screening programme where prevalence is 2%, and the positive predictive value collapses — most positives become false positives, because there are so many more well people to draw them from. Nothing about the test changed. Only the population did.
This is why likelihood ratios are worth learning. They combine sensitivity and specificity into one number per result, and they can be applied to whatever pre-test probability your patient actually has. As a rough guide, a positive likelihood ratio above 10 meaningfully rules a diagnosis in, and a negative likelihood ratio below 0.1 meaningfully rules it out. Between 0.5 and 2, the test has barely changed what you believed before you ordered it.
Accuracy — the proportion of all results that were correct — is the number most often quoted and least often useful. In a rare disease, a test that calls everyone negative achieves high accuracy and finds nobody.
Frequently asked questions
Which confidence interval does this use?
The Wilson score interval for proportions, and the log method for likelihood ratios. Wilson is used deliberately: the normal approximation taught in most courses produces impossible bounds below 0 or above 100% when a proportion is near either extreme, which is exactly where diagnostic studies often sit.
My specificity is 100% and the likelihood ratio shows a dash. Why?
A positive likelihood ratio is sensitivity divided by the false positive rate. If specificity is exactly 100%, that denominator is zero and the ratio is infinite rather than undefined in a useful sense. It usually means your sample of well patients was too small to observe a false positive, not that the test never produces one.
Can I use this for a screening programme?
Yes, and you should use the prevalence box when you do. A test validated in a specialist clinic will look far worse in a screening population, and modelling that before you roll out is the whole point.
What sample size do I need for a diagnostic accuracy study?
It is driven by the number of patients with the disease, not the total. Precision on sensitivity depends on the diseased column alone, so a large study with few cases still gives a wide interval for sensitivity.

The book behind this tool
Clinical Research Design Simplified
A step-by-step guide for nurses, physicians and allied-health researchers.