The Rate Ratio (RR), also known as the Incidence Density Ratio, is a relative measure of effect used primarily in cohort studies. It compares the incidence rate of a disease or health outcome in an exposed group to the incidence rate in an unexposed (reference) group over a specific period of person-time.
The Rate Ratio Formula
To calculate the rate ratio manually, you must first determine the incidence density rate (IDR) for both groups. The formula is:
Rate Ratio (RR) = Ie / Iu
Where:
Ie (Incidence Rate in Exposed) = Number of cases in exposed group / Person-time of exposed group.
Iu (Incidence Rate in Unexposed) = Number of cases in unexposed group / Person-time of unexposed group.
Understanding the Inputs
Incident Cases: The number of new disease events that occurred during the study period.
Person-Time: The sum of the time each participant contributed to the study while at risk. This is often measured in person-years, person-months, or person-days.
Interpreting the Results
The Rate Ratio indicates the strength of the association between the exposure and the outcome:
RR = 1.0: Null value. The incidence rate is the same in both groups; there is no association.
RR > 1.0: The exposure is a risk factor. For example, an RR of 2.0 implies the exposed group has twice the rate of disease compared to the unexposed group.
RR < 1.0: The exposure is a protective factor. An RR of 0.5 implies the exposed group has half the rate of disease compared to the unexposed group.
Example Calculation
Imagine a study on smoking and heart disease:
Smokers (Exposed): 50 heart attacks over 10,000 person-years.
Non-Smokers (Unexposed): 10 heart attacks over 5,000 person-years.
Step 1: Calculate Incidence Rates.
Rate (Smokers) = 50 / 10,000 = 0.005
Rate (Non-Smokers) = 10 / 5,000 = 0.002
Step 2: Calculate Ratio.
RR = 0.005 / 0.002 = 2.5
Conclusion: Smokers had 2.5 times the rate of heart attacks compared to non-smokers in this study.
function calculateRateRatio() {
// Get input values
var exposedCases = document.getElementById('exposed_cases').value;
var exposedTime = document.getElementById('exposed_time').value;
var unexposedCases = document.getElementById('unexposed_cases').value;
var unexposedTime = document.getElementById('unexposed_time').value;
// Parse values to floats
var a = parseFloat(exposedCases);
var pt1 = parseFloat(exposedTime);
var b = parseFloat(unexposedCases);
var pt0 = parseFloat(unexposedTime);
// Validation
if (isNaN(a) || isNaN(pt1) || isNaN(b) || isNaN(pt0)) {
alert("Please enter valid numeric values for all fields.");
return;
}
if (pt1 <= 0 || pt0 <= 0) {
alert("Person-Time must be greater than 0.");
return;
}
// Calculate Incidence Rates
var rateExposed = a / pt1;
var rateUnexposed = b / pt0;
// Avoid division by zero for the ratio
if (rateUnexposed === 0) {
document.getElementById('rr-result-box').style.display = 'block';
document.getElementById('ir-exposed').innerHTML = rateExposed.toFixed(5);
document.getElementById('ir-unexposed').innerHTML = "0.00000";
document.getElementById('rr-final').innerHTML = "Undefined (Division by Zero)";
document.getElementById('rr-interpretation').innerHTML = "The rate in the unexposed group is zero, so the ratio cannot be calculated.";
return;
}
// Calculate Rate Ratio
var rr = rateExposed / rateUnexposed;
// Format Numbers (Scientific notation if very small, otherwise fixed)
function formatRate(num) {
if (num 0) {
return num.toExponential(3);
}
return num.toFixed(5);
}
// Display Results
document.getElementById('rr-result-box').style.display = 'block';
document.getElementById('ir-exposed').innerHTML = formatRate(rateExposed);
document.getElementById('ir-unexposed').innerHTML = formatRate(rateUnexposed);
document.getElementById('rr-final').innerHTML = rr.toFixed(3);
// Generate Interpretation
var interpretationText = "";
if (rr.toFixed(3) == 1.000) {
interpretationText = "The incidence rate is identical in both groups (Null association).";
} else if (rr > 1) {
interpretationText = "The exposed group has " + rr.toFixed(2) + " times the rate of the outcome compared to the unexposed group. This suggests a positive association (risk factor).";
} else {
// Calculate reduction percentage
var reduction = (1 – rr) * 100;
interpretationText = "The exposed group has only " + (rr * 100).toFixed(1) + "% of the rate of the unexposed group. This suggests a negative association (protective factor).";
}
document.getElementById('rr-interpretation').innerHTML = interpretationText;
}