The Attack Rate Ratio (ARR), also commonly known as the Risk Ratio or Relative Risk in the context of outbreak investigations, is a critical metric used by epidemiologists to identify the source of an illness. It compares the incidence of disease in a group exposed to a specific factor against the incidence in a group not exposed to that factor.
The Formula
To calculate the Attack Rate Ratio, we first determine the attack rate for both the exposed and unexposed groups:
Step 1: Attack Rate (Exposed) = (Number of Ill Exposed / Total Number Exposed) × 100 Step 2: Attack Rate (Unexposed) = (Number of Ill Unexposed / Total Number Unexposed) × 100 Step 3: Attack Rate Ratio = Attack Rate (Exposed) / Attack Rate (Unexposed)
Interpreting the Results
The resulting ratio helps investigators determine if a specific exposure is associated with the illness:
ARR = 1.0: The risk of disease is the same in both groups. The exposure is likely not associated with the illness (Null hypothesis).
ARR > 1.0: The risk of disease is higher in the exposed group. This suggests the exposure is a risk factor (e.g., eating contaminated food).
ARR < 1.0: The risk of disease is lower in the exposed group. This suggests the exposure might be protective (e.g., a vaccine).
Real-World Example: Foodborne Outbreak
Imagine a wedding reception where 150 guests attended. Public health officials suspect the potato salad caused food poisoning.
Exposure
Ill (Sick)
Well (Not Sick)
Total
Attack Rate
Ate Potato Salad
45
5
50
90%
Did Not Eat
10
90
100
10%
Calculation:
AR (Exposed) = 45 / 50 = 0.90 (90%)
AR (Unexposed) = 10 / 100 = 0.10 (10%)
Attack Rate Ratio = 0.90 / 0.10 = 9.0
An ARR of 9.0 indicates that people who ate the potato salad were 9 times more likely to get sick than those who did not, strongly implicating the dish as the source.
function calculateAttackRateRatio() {
// 1. Get Input Values
var expTotal = document.getElementById('exposedTotal').value;
var expIll = document.getElementById('exposedIll').value;
var unexpTotal = document.getElementById('unexposedTotal').value;
var unexpIll = document.getElementById('unexposedIll').value;
// 2. Validation
if (expTotal === "" || expIll === "" || unexpTotal === "" || unexpIll === "") {
alert("Please fill in all fields to calculate the ratio.");
return;
}
expTotal = parseFloat(expTotal);
expIll = parseFloat(expIll);
unexpTotal = parseFloat(unexpTotal);
unexpIll = parseFloat(unexpIll);
if (expTotal <= 0 || unexpTotal expTotal) {
alert("Number of ill people in the exposed group cannot exceed the total number exposed.");
return;
}
if (unexpIll > unexpTotal) {
alert("Number of ill people in the unexposed group cannot exceed the total number unexposed.");
return;
}
// 3. Calculation Logic
// Calculate Attack Rate (Risk) for Exposed Group (as a decimal)
var riskExposed = expIll / expTotal;
// Calculate Attack Rate (Risk) for Unexposed Group (as a decimal)
var riskUnexposed = unexpIll / unexpTotal;
// Handle division by zero if no one in unexposed group got sick
// In epidemiology, if unexposed risk is 0, the ratio is technically undefined or infinite.
var arr = 0;
var isInfinite = false;
if (riskUnexposed === 0) {
if (riskExposed === 0) {
arr = 0; // Both 0, effectively 0 risk or undefined
} else {
isInfinite = true; // Infinite risk
}
} else {
arr = riskExposed / riskUnexposed;
}
// 4. Display Results
document.getElementById('arr-result-area').style.display = 'block';
// Display Percentages
document.getElementById('res-ar-exp').innerText = (riskExposed * 100).toFixed(1) + "%";
document.getElementById('res-ar-unexp').innerText = (riskUnexposed * 100).toFixed(1) + "%";
// Display Ratio and Interpretation
var ratioText = "";
var interpText = "";
if (isInfinite) {
ratioText = "∞";
interpText = "The Attack Rate Ratio is infinite because the risk in the unexposed group is zero. This strongly suggests the exposure is the cause.";
} else if (isNaN(arr)) {
ratioText = "Error";
interpText = "Invalid calculation data.";
} else {
ratioText = arr.toFixed(2);
// Generate dynamic interpretation text
if (arr > 1) {
interpText = "Increased Risk: People in the exposed group are " + arr.toFixed(2) + " times more likely to become ill compared to the unexposed group. This suggests a positive association between the exposure and the illness.";
} else if (arr 0) {
interpText = "Decreased Risk: People in the exposed group are less likely to become ill. An ARR of " + arr.toFixed(2) + " suggests the exposure might have a protective effect (0.00 to 0.99 range).";
} else if (arr === 1) {
interpText = "No Association: The risk of illness is identical in both groups. The exposure is likely not related to the illness.";
} else {
interpText = "No risk detected in either group.";
}
}
document.getElementById('res-ratio').innerText = ratioText;
document.getElementById('res-interpretation').innerHTML = interpText;
}