Total number of people in the group (excluding the primary case).
Number of contacts who are already immune (not susceptible).
Number of contacts who became infected.
Total Susceptible Population: 0
Secondary Attack Rate (SAR): 0%
function calculateSecondaryAttackRate() {
// Get input values
var totalExposed = parseFloat(document.getElementById('sar-total-exposed').value);
var immuneCount = parseFloat(document.getElementById('sar-immune').value);
var newCases = parseFloat(document.getElementById('sar-new-cases').value);
var resultBox = document.getElementById('sar-result');
var errorBox = document.getElementById('sar-error-msg');
// Reset display
resultBox.style.display = 'none';
errorBox.style.display = 'none';
errorBox.innerHTML = ";
// Validation
if (isNaN(totalExposed) || isNaN(immuneCount) || isNaN(newCases)) {
errorBox.innerHTML = "Please enter valid numbers for all fields.";
errorBox.style.display = 'block';
return;
}
if (totalExposed < 0 || immuneCount < 0 || newCases totalExposed) {
errorBox.innerHTML = "Immune contacts cannot exceed total exposed contacts.";
errorBox.style.display = 'block';
return;
}
// Calculate Susceptible Population
var susceptible = totalExposed – immuneCount;
if (susceptible === 0) {
errorBox.innerHTML = "Susceptible population is zero. Cannot calculate rate (division by zero).";
errorBox.style.display = 'block';
return;
}
if (newCases > susceptible) {
errorBox.innerHTML = "New cases cannot exceed the number of susceptible contacts.";
errorBox.style.display = 'block';
return;
}
// Calculate SAR
var sar = (newCases / susceptible) * 100;
// Display Results
document.getElementById('res-susceptible').innerHTML = susceptible;
document.getElementById('res-sar').innerHTML = sar.toFixed(2) + '%';
var interpretation = "";
if (sar < 10) {
interpretation = "This indicates a relatively low transmission efficiency in this setting.";
} else if (sar < 40) {
interpretation = "This indicates moderate transmissibility within the contact group.";
} else {
interpretation = "This indicates high transmissibility (e.g., highly infectious pathogen or close-contact environment).";
}
document.getElementById('res-interpretation').innerHTML = interpretation;
resultBox.style.display = 'block';
}
Understanding Secondary Attack Rate (SAR)
The Secondary Attack Rate (SAR) is a critical metric in epidemiology used to measure the frequency of new cases of a disease among the contacts of a known case. Unlike the basic reproduction number (R0), which estimates spread in a completely susceptible population at large, the SAR focuses on specific, defined groups such as households, classrooms, or office units.
It represents the probability that infection occurs among susceptible people within a specific group after exposure to a primary case (the index case).
The Secondary Attack Rate Formula
To calculate the SAR accurately, one must first identify the "population at risk." This means excluding individuals who are already immune due to vaccination or prior infection. The formula is:
SAR (%) = ( Number of New Cases / Number of Susceptible Contacts ) × 100
Where:
Number of New Cases: The count of secondary cases that arise within the incubation period of the disease.
Number of Susceptible Contacts: The total number of exposed contacts minus those who are immune.
Secondary Attack Rate Calculation Example
Let's look at a realistic scenario involving a household transmission event. This example demonstrates how to exclude immune individuals to find the true attack rate.
Scenario: Household Flu Outbreak
The Situation: One person in a household of 6 people (total) comes home with the flu (the Index Case). This leaves 5 exposed contacts.
Total Exposed Contacts: 5 people.
Immunity: 2 of these contacts received their flu shot and are considered immune.