Statistical
Diagnostic Sensitivity, Specificity, Youden's J & Likelihood Ratios (LR+/LR-)
Calculate sensitivity, specificity, Youden’s J and likelihood ratios from a fictional binary-classification table, with explicit checks for undefined ratios.
Describe a binary classifier at a fixed threshold
Sensitivity is TP/(TP+FN), and specificity is TN/(TN+FP). These are conditional rates within the reference-positive and reference-negative groups, not the probability that a person has a condition after a test result. This fictional worksheet is a statistics exercise, not a diagnostic or treatment tool.
Youden’s J = sensitivity + specificity - 1 has an algebraic range from -1 to 1; negative values are possible for a reversed or worse-than-chance classifier. Maximizing J across thresholds is one criterion, not a universal optimal cutoff: consequences of errors and the intended setting matter. This sheet evaluates one threshold only.
Likelihood ratios update odds, not probabilities. Although prevalence is not directly in these formulas, estimates may vary with the population spectrum and study design. A high sensitivity or specificity alone does not guarantee ruling a condition in or out. No predictive probabilities or uncertainty intervals are estimated here.
Enter nonnegative whole-number counts. Not estimable means the relevant denominator is zero, including empty reference groups or a likelihood-ratio zero denominator. We do not substitute a finite value for an infinite or undefined ratio, nor interpret an observed zero count as proof of perfect accuracy.
| Biostatistical Test Metric | Formula | Assay Data (TP=85, FN=15, TN=360, FP=40) | Random Coin Flip (50%/50%) |
|---|---|---|---|
| Sensitivity (True Pos Rate) | B2 / (B2 + B3) | 85 / 100 = 85.0% (0.8500) | 50.0% (0.5000) |
| Specificity (True Neg Rate) | B4 / (B4 + B5) | 360 / 400 = 90.0% (0.9000) | 50.0% (0.5000) |
| Youden's J Index (ROC Cutoff) | Sens + Spec - 1 | 0.85 + 0.90 - 1 = 0.7500 | 0.0000 (Zero diagnostic power) |
| Likelihood Ratios LR+ / LR- | Sens/(1-Spec) & (1-Sens)/Spec | LR+ = 8.50 | LR- = 0.1667 | LR+ = 1.00 | LR- = 1.00 |
Youden's J Index = (TP / (TP + FN)) + (TN / (TN + FP)) - 1
Summarizes vertical ROC curve height above the random-chance diagonal.
=IF(COUNT(B2:B5)<>4,"Invalid inputs",IF(OR(MIN(B2:B5)<0,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5)),"Invalid inputs",IF(OR(B2+B3=0,B4+B5=0),"Not estimable",ROUND(B2/(B2+B3)+B4/(B4+B5)-1,4))))Positive Likelihood Ratio LR+ = Sensitivity / (1 - Specificity)
Quantifies how many times more likely a positive test occurs in someone with the condition than without it.
=IF(COUNT(B2:B5)<>4,"Invalid inputs",IF(OR(MIN(B2:B5)<0,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5)),"Invalid inputs",IF(OR(B2+B3=0,B4+B5=0,B5=0),"Not estimable",ROUND((B2/(B2+B3))/(B5/(B4+B5)),4))))Sensitivity
Proportion classified positive among reference-positive records.
=IF(COUNT(B2:B5)<>4,"Invalid inputs",IF(OR(MIN(B2:B5)<0,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5)),"Invalid inputs",IF(B2+B3=0,"Not estimable",B2/(B2+B3))))Specificity
Proportion classified negative among reference-negative records.
=IF(COUNT(B2:B5)<>4,"Invalid inputs",IF(OR(MIN(B2:B5)<0,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5)),"Invalid inputs",IF(B4+B5=0,"Not estimable",B4/(B4+B5))))Negative likelihood ratio
Compare the negative-test rate in the reference-positive group with that in the reference-negative group.
=IF(COUNT(B2:B5)<>4,"Invalid inputs",IF(OR(MIN(B2:B5)<0,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5)),"Invalid inputs",IF(OR(B2+B3=0,B4+B5=0,B4=0),"Not estimable",ROUND((B3/(B2+B3))/(B4/(B4+B5)),4))))Try the example
Use the original values or change them to test your understanding.