Editverse Free Calculator

Diagnostic Accuracy Calculator

Turn a 2×2 test-versus-truth table into sensitivity, specificity, predictive values and likelihood ratios, then recalculate PPV and NPV at the prevalence of your target population. Read a full interpretation guide below. Validated against R 4.3.3.

In Simple Words

Diagnostic accuracy describes how well a test distinguishes people who have a condition from those who do not. Sensitivity is the proportion of truly diseased people the test correctly flags; specificity is the proportion of truly healthy people it correctly clears. Both are properties of the test itself and do not change with how common the disease is.

What a clinician usually wants, though, is the reverse: given a positive result, how likely is disease? That is the positive predictive value, and unlike sensitivity it depends heavily on prevalence. The same test looks far less convincing when the condition is rare. Likelihood ratios combine sensitivity and specificity into a single prevalence-independent measure of how much a result shifts the odds of disease.

When to Use Diagnostic Accuracy Measures

Use these measures whenever you evaluate a test with a binary result against a reference (“gold”) standard. Report sensitivity and specificity to characterise the test, predictive values to describe performance in a population with a stated prevalence, and likelihood ratios when you want a measure that travels across settings.

If the test produces a continuous score rather than a yes/no result, summarise its discrimination with an ROC curve and AUC instead, and choose a threshold deliberately. Always give a 95% confidence interval for each proportion, and state the prevalence used for predictive values so readers can re-interpret them for their own setting. Not sure which measure to report? Our interactive Test Selector can help.

Sensitivity & Specificity Diagnostic test performance metrics · validated vs R 4.3.3
User guide

When to use. Evaluate diagnostic test performance from a 2×2 of test result vs true disease status.

Assumptions. A valid reference (gold) standard classifies true disease status.

Common mistakes. PPV and NPV depend heavily on disease prevalence: report it.

Worked example

Click Load example data above, then Run Analysis to see a fully worked result with figure, formula and interpretation for this test.

References
  1. Altman DG, Bland JM. Diagnostic tests 1: sensitivity and specificity. BMJ. 1994;308:1552.

PPV and NPV at your target-population prevalence

The PPV and NPV in the output above use the prevalence inside your 2×2 table, (TP + FN) / N. To see how the test performs where the condition is more or less common, enter that population’s prevalence. Bayes’ theorem gives PPV = Se·P / [Se·P + (1 − Sp)(1 − P)] and NPV = Sp(1 − P) / [Sp(1 − P) + (1 − Se)P].

Enter values and press Calculate.

Worked Examples

Example 1 — Reading a 2×2 table

With 90 true positives, 10 false negatives, 80 true negatives and 20 false positives, sensitivity is 90/100 = 90% and specificity is 80/100 = 80%. Positive predictive value, however, depends on prevalence: in this balanced sample it is 90/110 = 82%, but in a low-prevalence screening population it would be far lower.

Example 2 — Why likelihood ratios help

A positive likelihood ratio of 4.5 (sensitivity 0.90 / [1 − specificity 0.80]) means a positive result is 4.5 times more likely in a diseased than a non-diseased person. Multiplying the pre-test odds by this ratio gives the post-test odds, regardless of the setting’s prevalence.

Assumptions to Check

A trustworthy reference standard. Sensitivity and specificity are only as good as the gold standard used to classify true disease status. An imperfect reference biases every measure.

Representative spectrum of patients. Test performance measured in clearly diseased versus clearly healthy people overstates accuracy compared with the ambiguous cases seen in practice (spectrum bias).

Prevalence stated for predictive values. PPV and NPV are not properties of the test; they shift with prevalence. Always report the prevalence they were calculated at.

Common Mistakes

Confusing predictive value with sensitivity

Sensitivity answers “given disease, will the test be positive?” Predictive value answers the reverse, “given a positive test, is there disease?” They are not interchangeable.

Ignoring prevalence

A highly sensitive, specific test can still produce mostly false positives when the condition is rare. Always interpret predictive values in light of the prevalence.

Omitting confidence intervals

Each proportion is an estimate. Report a 95% confidence interval, especially when cell counts are small.

Forcing a continuous test into one cutoff

If the test gives a continuous score, a single 2×2 table hides its full performance. Use an ROC analysis and justify the chosen threshold.

Frequently Asked Questions

What is the difference between sensitivity and specificity?

Sensitivity is the true-positive rate among diseased people; specificity is the true-negative rate among healthy people. A test can be strong on one and weak on the other.

Why does predictive value change with prevalence?

Because predictive value depends on how many true cases exist in the tested population. The rarer the disease, the more positives are false, lowering the positive predictive value.

What is a likelihood ratio?

It is the factor by which a test result changes the odds of disease. A positive likelihood ratio above 10 is strong evidence for disease; a negative ratio below 0.1 is strong evidence against.

Does the result match SPSS, R, and Stata?

Yes. The calculator uses the standard 2×2 formulas for each measure and shows the exact R command so you can reproduce it.

References

  1. Buderer NM. Statistical methodology: incorporating the prevalence of disease into the sample size calculation for sensitivity and specificity. Acad Emerg Med. 1996;3(9):895–900. PMID 8870764.
  2. Thomas R, Mengersen K, Parikh RS, et al. Enter the reverend: introduction to and application of Bayes’ theorem in clinical ophthalmology. Clin Exp Ophthalmol. 2011;39(9):865–870. PMID 21575118.
  3. Altman DG, Bland JM. Diagnostic tests 1: sensitivity and specificity. BMJ. 1994;308(6943):1552.

Need This Analysis Done for Your Manuscript?

Our PhD biostatisticians compute your sensitivity, specificity, predictive values, and likelihood ratios with confidence intervals, and deliver publication-ready tables with reproducible R output.

Get Expert Statistical Help