Example Data Table
This example uses 86 true positives, 14 false negatives, 12 false positives, and 188 true negatives.
| Reference status |
Test positive |
Test negative |
Total |
| Condition present |
86 |
14 |
100 |
| Condition absent |
12 |
188 |
200 |
| Total |
98 |
202 |
300 |
Formula Used
Sensitivity: TP / (TP + FN)
Specificity: TN / (TN + FP)
Positive predictive value: TP / (TP + FP)
Negative predictive value: TN / (TN + FN)
Accuracy: (TP + TN) / (TP + FP + TN + FN)
False positive rate: FP / (FP + TN)
False negative rate: FN / (FN + TP)
F1 score: 2TP / (2TP + FP + FN)
R style formulas: sensitivity <- TP / (TP + FN), specificity <- TN / (TN + FP)
How to Use This Calculator
Enter the four confusion matrix values. Use true positives, false positives, true negatives, and false negatives.
Add a test name if you want it in the export file.
Enter a prevalence percent only when you want prevalence-adjusted predictive values.
Select a confidence level for Wilson intervals.
Press calculate. The result appears above the form and below the header.
Use the CSV or PDF button to save the result summary.
Practical Sensitivity and Specificity Analysis
Why these metrics matter
Sensitivity and specificity describe how well a test separates two states. The states may be disease and no disease. They may also be pass and fail, fraud and valid, or signal and noise. Sensitivity focuses on cases that truly have the condition. It tells how many were found by the test. Specificity focuses on cases that truly do not have the condition. It tells how many were correctly rejected.
A high sensitivity is useful when missed positives are costly. Screening tests often need this behavior. A low false negative rate gives more confidence that few true cases were ignored. A high specificity is useful when false alarms are costly. Confirmatory tests often need this behavior. A low false positive rate protects people, budgets, and follow up resources.
Reading the full result
Sensitivity and specificity are strong, but they are not enough. Predictive values explain what a positive or negative result means in your tested group. Positive predictive value depends on true positives and false positives. Negative predictive value depends on true negatives and false negatives. Both values change when prevalence changes. That is why this calculator can use an optional prevalence value.
Likelihood ratios are also helpful. LR positive shows how much a positive result increases evidence. LR negative shows how much a negative result lowers evidence. Values farther from one are usually more informative. The diagnostic odds ratio combines both likelihood ratios. Youden index summarizes total separation skill.
Using results responsibly
Counts should come from a clear reference standard. The reference standard should be independent when possible. Biased sampling can inflate performance. Small samples can also look better or worse than reality. Confidence intervals help show this uncertainty. Wider intervals mean the estimate needs more data.
Use the results with judgment. No single metric proves a test is ready. Compare the intended use, cost of errors, prevalence, and sample quality. A medical screening rule may need different priorities from a fraud filter. An engineering detector may need another balance. The best decision uses several measures together. Record the inputs, export the output, and review every metric before reporting. This practice improves transparency and supports repeatable review across future datasets safely.
FAQs
What is sensitivity?
Sensitivity is the share of actual positive cases that the test correctly identifies. It is calculated as true positives divided by true positives plus false negatives.
What is specificity?
Specificity is the share of actual negative cases that the test correctly identifies. It is calculated as true negatives divided by true negatives plus false positives.
Can I use this for R results?
Yes. Enter the same confusion matrix counts you use in R. The calculator shows equivalent sensitivity, specificity, and related performance measures.
What are true positives?
True positives are cases where the condition is present and the test also reports positive. They support sensitivity and positive predictive value.
What are false positives?
False positives are cases where the condition is absent, but the test reports positive. They reduce specificity and positive predictive value.
Why does prevalence matter?
Prevalence changes predictive values. A rare condition can produce a lower positive predictive value, even when sensitivity and specificity look strong.
What confidence interval is used?
The calculator uses Wilson score intervals for sensitivity and specificity. These intervals are often more stable than simple normal intervals for proportions.
Is accuracy enough?
No. Accuracy can hide poor performance when classes are imbalanced. Review sensitivity, specificity, predictive values, and likelihood ratios together.