Calculator Input
Enter binary classification counts from a chemistry assay, screening method, or laboratory validation study.
Example Data Table
Use any row below to populate the calculator and test the chemistry-focused workflow.
| Example | TP | FP | TN | FN | Sensitivity | Specificity | Accuracy | Action |
|---|---|---|---|---|---|---|---|---|
| Lead Strip Validation | 48 | 5 | 91 | 6 | 88.89% | 94.79% | 92.67% | |
| Solvent Residue Screen | 72 | 11 | 134 | 9 | 88.89% | 92.41% | 91.15% | |
| Water Nitrate Alarm | 25 | 2 | 58 | 15 | 62.50% | 96.67% | 83.00% |
Formulas Used
These equations are derived from the confusion matrix and are widely used in chemistry assay validation and screening analysis.
| Metric | Formula | Meaning |
|---|---|---|
| Sensitivity | TP / (TP + FN) | Measures how well the method detects truly positive samples. |
| Specificity | TN / (TN + FP) | Measures how well the method rejects truly negative samples. |
| Accuracy | (TP + TN) / (TP + FP + TN + FN) | Shows the overall proportion of correct classifications. |
| Precision | TP / (TP + FP) | Shows how many positive predictions were truly positive. |
| NPV | TN / (TN + FN) | Shows how many negative predictions were truly negative. |
| F1 Score | 2TP / (2TP + FP + FN) | Balances precision and sensitivity in one score. |
| Balanced Accuracy | (Sensitivity + Specificity) / 2 | Useful when positives and negatives are imbalanced. |
| Youden's J | Sensitivity + Specificity - 1 | Summarizes discrimination strength beyond random classification. |
| LR+ | Sensitivity / (1 - Specificity) | Shows how much a positive result strengthens evidence. |
| LR- | (1 - Sensitivity) / Specificity | Shows how much a negative result weakens evidence. |
| MCC | ((TP × TN) - (FP × FN)) / √((TP+FP)(TP+FN)(TN+FP)(TN+FN)) | A balanced correlation score using all four matrix cells. |
If any denominator becomes zero, the related metric is shown as N/A because it cannot be computed from the current dataset.
How to Use This Calculator
- Enter a chemistry assay or method name for clear reporting.
- Set positive and negative class labels that match your laboratory decision rule.
- Type the confusion matrix counts for true positives, false positives, true negatives, and false negatives.
- Select how many decimal places you want in the results.
- Click Calculate Metrics to show results above the form, including detailed rates, a confusion matrix, and a Plotly graph.
- Use the export buttons to save the current report as CSV or PDF.
- Compare sensitivity and specificity together before judging method quality.
- Review false-negative and false-positive rates to decide whether detection or selectivity needs improvement.
Frequently Asked Questions
1. What do sensitivity and specificity mean in chemistry?
Sensitivity measures how well an assay catches truly positive samples. Specificity measures how well it rejects truly negative samples. In chemistry, both matter when validating contaminant tests, screening methods, and binary pass-fail decisions.
2. When can accuracy be misleading?
Accuracy can look high when negative samples dominate the dataset. A method may classify many clean samples correctly while still missing important contaminated ones. That is why sensitivity, specificity, and balanced accuracy should be reviewed together.
3. Why are precision and NPV included?
Precision estimates how many positive calls are truly positive. NPV estimates how many negative calls are truly negative. Together they help laboratories judge trustworthiness of released results under changing prevalence conditions.
4. What does a false negative mean in assay validation?
A false negative means the method missed a sample that truly contains the target analyte or condition. In chemistry screening, that can hide safety, compliance, or quality risks, so low false-negative rates are often very important.
5. Can this calculator be used for chromatography or spectroscopy screening?
Yes. The calculator works for any binary classification table, including spectroscopy screening, chromatography confirmation, contamination flags, sensor alarms, and pass-fail assay outcomes. You only need the four confusion matrix counts.
6. What is balanced accuracy?
Balanced accuracy averages sensitivity and specificity. It gives equal weight to positive and negative classes, which makes it useful when your data is imbalanced or when ordinary accuracy overstates performance.
7. Why are likelihood ratios useful?
Likelihood ratios show how much a positive or negative result shifts belief in the target condition. Higher LR+ values strengthen positive evidence, while lower LR− values strengthen negative evidence.
8. What happens when a denominator becomes zero?
A zero denominator happens when a required subgroup is empty, such as no positive samples or no negative samples. The calculator shows N/A for those metrics. Add representative validation data for complete interpretation.