How to Calculate True Negative Rate
The true negative rate (TNR) is a key metric in statistics and machine learning that measures how well a classification model correctly identifies negative cases. This guide explains how to calculate TNR, provides an interactive calculator, and offers practical interpretation.
What is True Negative Rate?
The true negative rate (TNR) is a performance metric that answers the question: "What proportion of actual negatives was identified correctly?" In other words, it measures the model's ability to correctly classify negative cases.
TNR is also known as specificity and is calculated as the number of true negatives divided by the total number of actual negatives. A high TNR indicates good performance at identifying negative cases.
Key Point: TNR is complementary to the true positive rate (TPR). While TNR focuses on negative cases, TPR focuses on positive cases.
How to Calculate True Negative Rate
To calculate the true negative rate, you need two key pieces of information:
- The number of true negatives (TN) - cases correctly identified as negative
- The total number of actual negatives (TN + false negatives, FN)
Formula
True Negative Rate (TNR) = (True Negatives / Total Actual Negatives) × 100%
Or mathematically: TNR = TN / (TN + FN)
Step-by-Step Calculation
- Count the number of true negatives (TN) in your dataset
- Count the total number of actual negatives (TN + FN)
- Divide the number of true negatives by the total number of actual negatives
- Multiply by 100 to get a percentage
Confusion Matrix
A confusion matrix helps visualize the components of TNR calculation:
| Predicted Positive | Predicted Negative | |
|---|---|---|
| Actual Positive | True Positives (TP) | False Negatives (FN) |
| Actual Negative | False Positives (FP) | True Negatives (TN) |
Worked Example
Let's calculate the TNR for a medical test that screens for a disease:
| Test Positive | Test Negative | |
|---|---|---|
| Disease Present | 120 (False Positives) | 80 (False Negatives) |
| Disease Absent | 30 (True Positives) | 470 (True Negatives) |
In this example:
- True Negatives (TN) = 470
- Total Actual Negatives = TN + FN = 470 + 80 = 550
Calculation
TNR = (470 / 550) × 100% ≈ 85.45%
This means the test correctly identified 85.45% of people who do not have the disease.
Interpreting the Result
The true negative rate provides several important insights:
- Model Performance: A high TNR indicates the model is good at identifying negative cases
- Error Analysis: A low TNR suggests the model is missing many negative cases
- Comparison: You can compare TNR across different models or datasets
Practical Tip: Always consider TNR alongside other metrics like precision and recall for a complete picture of model performance.
FAQ
- What is the difference between TNR and accuracy?
- Accuracy measures overall correctness (TP+TN)/(TP+TN+FP+FN), while TNR specifically measures correctness for negative cases.
- When is a high TNR important?
- A high TNR is crucial when false negatives are particularly costly (e.g., missing a disease diagnosis).
- Can TNR be 100%?
- Yes, if all actual negatives are correctly identified as negative (TN = total actual negatives).
- How does TNR relate to the false positive rate?
- TNR and false positive rate (FPR) are complementary: TNR = 1 - FPR.
- Is TNR the same as specificity?
- Yes, TNR and specificity refer to the same concept in statistics.