Diagnostic Test Accuracy Calculator (Sensitivity, Specificity, PPV, NPV)
Type the true positives, false positives, false negatives and true negatives from a study and see every accuracy measure with its interval, the working, and how the predictive values change with prevalence.
Se ejecuta en tu navegador. Tus archivos nunca salen de tu dispositivo. Cómo comprobarlo
…
Cómo hacerlo
- 1Enter the table
Type the four counts, build them from rates or count them from a CSV.
- 2Name the test
Label the reference standard and the test so the report reads clearly.
- 3Choose the interval
Pick the confidence level and Wilson or exact intervals.
- 4Read the measures
Check every estimate with its interval and the working.
- 5Set your prevalence
Move the slider to see PPV, NPV and the 1,000-people grid for your setting.
- 6Export
Download the measures as CSV, print the report or copy a summary.
Sobre esta herramienta
When a new test is checked against a reference standard, the results fall into four cells. True positives have the condition and test positive, false positives test positive without it, false negatives are missed cases and true negatives are correctly cleared. Everything that describes how good the test is comes from those four counts. This calculator takes them directly, builds them from a known sensitivity, specificity and prevalence, or counts them from a CSV with one row per person, a truth column and a test column. It then reports sensitivity, specificity, positive and negative predictive value, accuracy and the sample prevalence, each with a Wilson score or Clopper-Pearson exact interval at 90, 95 or 99 percent. The positive and negative likelihood ratios and the diagnostic odds ratio get log-method intervals, with the 0.5 correction applied automatically when a cell is zero. The Youden index, balanced accuracy and F1 score are included for comparing tests. Because predictive values depend heavily on how common the condition is, a chart redraws PPV and NPV across every prevalence from 0 to 100 percent, a slider sets the prevalence in your own setting, a grid shows what happens to 1,000 people tested, and a Fagan-style table turns any pre-test probability into the probability after a positive or a negative result.
Which measures travel and which do not
Sensitivity, specificity and the likelihood ratios are properties of the test in a given population and do not change with prevalence, although they can vary with the spectrum of patients. Predictive values do change. A test with 90% sensitivity and 95% specificity has a PPV of 67% when one person in ten has the condition but only 27% when one in fifty does. That is why the tool asks for the prevalence where the test will be used and recalculates PPV and NPV with intervals carried over from the likelihood ratios.
Worked example
The screening sample has 1,000 people, 100 of whom have the condition. The test finds 90 of them (TP 90, FN 10) and wrongly flags 45 of the 900 others (FP 45, TN 855). Sensitivity is 90/100 = 90.0% (Wilson 95% CI 82.6% to 94.5%) and specificity 855/900 = 95.0% (93.4% to 96.2%). PPV is 90/135 = 66.7% and NPV 855/865 = 98.8%. LR+ is 0.90/0.05 = 18.0 (13.4 to 24.1) and LR− is 0.10/0.95 = 0.105 (0.059 to 0.190). The diagnostic odds ratio is (90 × 855)/(45 × 10) = 171 and accuracy is 94.5%. At a prevalence of 2% the PPV falls to 26.9% (21.5% to 33.0%) while the NPV rises to 99.8%.
Limits
The results are only as good as the study behind the table: a weak reference standard, a selected sample or verification of only some patients all bias the estimates. Intervals for small groups are wide. This is a statistics calculator for study data and teaching, not medical advice or a diagnosis; talk to a doctor, nurse or pharmacist about what a personal test result means.
Ejemplo práctico
TP 90, FP 45, FN 10, TN 855: sensitivity 90.0%, specificity 95.0%, LR+ 18.0, and PPV 26.9% at 2% prevalence.
Datos rápidos
- Categoría: Matemáticas y ciencia
- Funciona en tu navegador, sin registro y sin subir nada.
- Lo que introduces se queda en tu dispositivo.
- Disponible en inglés.
- Contenido revisado por última vez:
- Fuente oficial: Altman and Bland, Diagnostic tests 1-4, BMJ (1994); STARD 2015 reporting guideline
Preguntas frecuentes
What is the difference between sensitivity and PPV?
Sensitivity is the share of people with the condition who test positive. PPV is the share of people who test positive who actually have the condition. The first looks down a column of the table and the second along a row.
Why is my PPV so low when the test is accurate?
When the condition is rare, even a small false positive rate produces many false alarms compared with the few true cases. The PPV chart shows how quickly it falls as prevalence drops.
Which confidence interval should I use?
The Wilson score interval has good coverage and is the usual choice. The Clopper-Pearson exact interval never undercovers but is wider. Both are far better than the simple Wald interval for proportions near 0 or 1.
What do likelihood ratios mean in practice?
They say how much a result changes the odds of the condition. An LR+ above 10 or an LR− below 0.1 usually shifts the probability enough to change decisions; values near 1 change little.
What happens when a cell is zero?
Sensitivity, specificity and predictive values are still calculated directly. For the likelihood ratios and the diagnostic odds ratio, 0.5 is added to every cell so that they stay finite, and a note says so.
Can I start from published sensitivity and specificity instead of counts?
Yes. The From rates tab builds a table from sensitivity, specificity, prevalence and a number of people, rounding to whole people.
