Calculate Type II Error Rate from Confusion Matrix Data
Positive cases incorrectly classified as negative.
Positive cases correctly classified as positive.
False Negative Rate (FNR):0%
Sensitivity (Recall):0%
Total Actual Positives (P):0
What is False Negative Rate (FNR)?
The False Negative Rate (FNR) is a statistical metric used in binary classification and medical testing. It represents the proportion of actual positive cases that were incorrectly classified as negative. In statistics, this is known as a Type II Error.
In a medical context, a false negative is arguably the most dangerous error, as it involves telling a sick patient that they are healthy, potentially delaying necessary treatment.
Formula
The formula for calculating the False Negative Rate is:
FNR = FN / (FN + TP)
Where:
FN (False Negatives): The number of positive items incorrectly labeled as negative.
TP (True Positives): The number of positive items correctly labeled as positive.
FN + TP: Represents the Total Actual Positive cases (often denoted as P).
Example Calculation
Imagine a spam filter testing 200 emails, where 100 are actually spam (Total Positives).
The filter correctly identifies 90 emails as spam (TP = 90).
The filter misses 10 spam emails, letting them into the inbox (FN = 10).
Calculation:
FNR = 10 / (10 + 90) = 10 / 100 = 0.10
The False Negative Rate is 10%. This means 10% of the spam emails were missed.
Relationship to Sensitivity
The False Negative Rate is the complement of Sensitivity (also known as Recall or True Positive Rate). If you know the Sensitivity of a test, you can easily find the FNR:
FNR = 1 – Sensitivity
function calculateFNR() {
// Get input values
var fnInput = document.getElementById('fnInput');
var tpInput = document.getElementById('tpInput');
var resultBox = document.getElementById('fnrResult');
// Parse values
var fn = parseFloat(fnInput.value);
var tp = parseFloat(tpInput.value);
// Validation
if (isNaN(fn) || isNaN(tp)) {
alert("Please enter valid numbers for both False Negatives and True Positives.");
resultBox.style.display = "none";
return;
}
if (fn < 0 || tp < 0) {
alert("Values cannot be negative.");
resultBox.style.display = "none";
return;
}
// Calculation Logic
var totalPositives = fn + tp;
if (totalPositives === 0) {
alert("Total Actual Positives (FN + TP) equals zero. Cannot divide by zero.");
resultBox.style.display = "none";
return;
}
var fnr = fn / totalPositives;
var sensitivity = tp / totalPositives; // Sensitivity = 1 – FNR
// Formatting results (Percentage)
var fnrPercent = (fnr * 100).toFixed(2) + "%";
var sensitivityPercent = (sensitivity * 100).toFixed(2) + "%";
// Update DOM
document.getElementById('resFNR').innerHTML = fnrPercent;
document.getElementById('resSensitivity').innerHTML = sensitivityPercent;
document.getElementById('resTotalPositives').innerHTML = totalPositives;
// Dynamic Interpretation
var interpretation = "Out of " + totalPositives + " actual positive cases, the system failed to identify " + fn + " of them.";
document.getElementById('resInterpretation').innerHTML = interpretation;
// Show result box
resultBox.style.display = "block";
}