STATISTICSProbability TheoryStatistics Calculator
๐Ÿ“Š

Sensitivity and Specificity Calculator

Sensitivity and specificity calculator. TPR, TNR, PPV, NPV, LR+, LRโˆ’, Youden Index, confusion matrix

Run CalculatorExplore data analysis and statistical calculations

Why This Statistical Analysis Matters

Why: Statistical calculator for analysis.

How: Enter inputs and compute results.

๐Ÿฉบ
DIAGNOSTIC ACCURACYTPR, TNR, PPV, NPV, LR+, LRโˆ’, Youden

Sensitivity & Specificity โ€” TPR, TNR, PPV, NPV, LR+, LRโˆ’, Youden Index

From confusion matrix: Sensitivity, Specificity, PPV, NPV, LR+, LRโˆ’, Youden, F1. Screening vs confirmatory.

Real-World Scenarios โ€” Click to Load

sens_spec_results.sh
CALCULATED
$ sens_spec --tp=90 --fp=5 --tn=895 --fn=10
TPR (Sensitivity)
90.00%
TNR (Specificity)
99.44%
PPV
94.74%
NPV
98.90%
LR+
162.00
LRโˆ’
0.10
Youden
0.894
Accuracy
98.50%
Share:
Sensitivity & Specificity
TPR 90.0% ยท TNR 99.4%
Youden = 0.894
PPV: 94.7%NPV: 98.9%LR+: 162.00LRโˆ’: 0.10
numbervibe.com/calculators/statistics/sensitivity-specificity-calculator

Confusion Matrix

Predicted +
Predicted โˆ’
Actual +
90
10
Actual โˆ’
5
895

TPR, TNR, PPV, NPV

Likelihood Ratios (LR+, LRโˆ’)

ROC Space (Single Point)

1 - Specificity (FPR)
Sensitivity (TPR)

Point: (1-Spec, Sens) = (0.6%, 90.0%)

Calculation Breakdown

PRIMARY METRICS
Sensitivity (TPR)
90.00%
TP/(TP+FN) = 90/(90+10)
Specificity (TNR)
99.44%
TN/(TN+FP) = 895/(895+5)
PPV (Precision)
94.74%
TP/(TP+FP) = 90/(90+5)
NPV
98.90%
TN/(TN+FN) = 895/(895+10)
LIKELIHOOD RATIOS
LR+
162.00
Sens/(1-Spec) = 0.9000/(1-0.9944)
LRโˆ’
0.10
(1-Sens)/Spec = (1-0.9000)/0.9944
SUMMARY
Youden's Index
0.894
Sens + Spec - 1 = 0.9000 + 0.9944 - 1
Accuracy
98.50%
(TP+TN)/N = (90+895)/1000

For educational and informational purposes only. Verify with a qualified professional.

Key Takeaways

  • โ€ข Sensitivity (TPR) = TP/(TP+FN) โ€” how well the test detects disease when present (rule out)
  • โ€ข Specificity (TNR) = TN/(TN+FP) โ€” how well the test identifies healthy when absent (rule in)
  • โ€ข There is a trade-off: increasing sensitivity often decreases specificity (and vice versa)
  • โ€ข PPV and NPV depend on prevalence; sensitivity and specificity do not
  • โ€ข Screening tests prioritize sensitivity; confirmatory tests prioritize specificity
  • โ€ข LR+ > 10: strong rule-in. LRโˆ’ < 0.1: strong rule-out

Did You Know?

๐ŸฉบSensitivity and specificity are intrinsic to the test โ€” they do not change with prevalenceSource: JAMA Users' Guides
๐Ÿ“ŠPPV drops dramatically for rare diseases โ€” a 99% specific test can have low PPV when prevalence is 0.1%Source: BMJ Statistics Notes
๐ŸŽฏYouden's Index (J = Sens + Spec - 1) finds the optimal cutoff on the ROC curveSource: Youden, 1950
๐Ÿ”ฌLR+ > 10 is strong evidence to rule in; LRโˆ’ < 0.1 is strong evidence to rule outSource: McGee, 2002
โš–๏ธScreening tests (e.g., mammography) favor high sensitivity to avoid missing casesSource: WHO Guidelines
๐Ÿ“‹Confirmatory tests (e.g., biopsy) favor high specificity to avoid false positivesSource: Cochrane Handbook

Expert Tips

Screening vs confirmatory

Screening: high sensitivity. Confirmatory: high specificity.

Prevalence matters for PPV

Low prevalence โ†’ many false positives โ†’ low PPV

Use Youden for cutoff

Maximize J = Sens + Spec - 1 for optimal threshold

LR for probability update

Post-test odds = Pre-test odds ร— LR

Confusion Matrix Layout

Predicted +Predicted โˆ’
Actual +TPFN
Actual โˆ’FPTN

Screening vs Confirmatory Tests

AspectScreeningConfirmatory
GoalCast wide net, miss few casesAvoid false positives
PrioritizeHigh sensitivityHigh specificity
ExampleMammography, Pap smearBiopsy, culture
False negativesAcceptable (follow-up)Unacceptable
False positivesAcceptable (further testing)Minimize

Frequently Asked Questions

What is the difference between sensitivity and PPV?

Sensitivity = P(positive test | disease). PPV = P(disease | positive test). Sensitivity is fixed; PPV depends on prevalence.

Why does a 99% specific test have low PPV for rare diseases?

When prevalence is very low, the number of false positives (1% of many healthy people) can exceed true positives.

What is Youden's Index?

J = Sensitivity + Specificity - 1. Maximizing J finds the optimal cutoff on the ROC curve, balancing sens and spec.

When to use screening vs confirmatory tests?

Screening: cast a wide net, high sensitivity. Confirmatory: avoid false positives, high specificity.

What do LR+ and LRโˆ’ mean?

LR+ > 10: strong rule-in. LRโˆ’ < 0.1: strong rule-out. Multiply pre-test odds by LR to get post-test odds.

How does prevalence affect PPV?

Higher prevalence โ†’ higher PPV. Lower prevalence โ†’ lower PPV (more false positives relative to true positives).

When is accuracy misleading?

With severe class imbalance (e.g., 99% negative), a test that always predicts negative has 99% accuracy but zero sensitivity. Use F1 or AUC-ROC instead.

What is the relationship between LR+ and LRโˆ’?

DOR = LR+ / LRโˆ’. A good test has high LR+ and low LRโˆ’. They are derived from the same sensitivity and specificity.

By the Numbers

TP/(TP+FN)
Sensitivity (TPR)
TN/(TN+FP)
Specificity (TNR)
LR+ > 10
Rule in
LRโˆ’ < 0.1
Rule out

Medical Disclaimer: This calculator is for educational purposes. It is not a substitute for clinical judgment or professional medical advice. Test performance varies by population and setting. Consult qualified healthcare providers for medical decisions.

๐Ÿ‘ˆ START HERE
โฌ…๏ธJump in and explore the concept!
AI

Related Calculators