function calculateIncidenceRate() {
var newCasesInput = document.getElementById('newCases').value;
var personTimeInput = document.getElementById('personTime').value;
var multiplierInput = document.getElementById('multiplier').value;
var resultOutput = document.getElementById('resultOutput');
// Basic validation
if (newCasesInput === " || personTimeInput === " || multiplierInput === ") {
resultOutput.innerHTML = 'Please fill in all fields.';
return;
}
var cases = parseFloat(newCasesInput);
var personTime = parseFloat(personTimeInput);
var multiplier = parseFloat(multiplierInput);
if (isNaN(cases) || isNaN(personTime) || isNaN(multiplier)) {
resultOutput.innerHTML = 'Please enter valid numbers.';
return;
}
if (personTime <= 0) {
resultOutput.innerHTML = 'Total Person-Time at Risk must be greater than zero.';
return;
}
if (cases < 0) {
resultOutput.innerHTML = 'Number of new cases cannot be negative.';
return;
}
// The core formula: (New Cases / Person-Time) * Multiplier
var rawRate = cases / personTime;
var calculatedRate = rawRate * multiplier;
// Formatting the output to a reasonable number of decimals (e.g., 2) and adding commas for large numbers
var formattedRate = calculatedRate.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 4 });
var formattedMultiplier = multiplier.toLocaleString();
resultOutput.innerHTML =
'
In epidemiology, the incidence rate is a crucial measure of the frequency with which a disease or a specific event occurs within a population over a defined period. Unlike prevalence, which looks at existing cases at a specific point in time, incidence focuses strictly on new cases developing over time.
The Incidence Rate Formula Explained
The incidence rate is calculated by dividing the number of new cases that occur during a specified time period by the total "person-time" at risk during that same period. The result is often multiplied by a base number (like 1,000 or 100,000) to make the final figure easier to read and interpret.
The formula used in this calculator is:
Incidence Rate = (Number of New Cases / Total Person-Time at Risk) × Multiplier
Number of New Cases: The count of individuals who develop the outcome of interest (e.g., a disease) during the study period.
Total Person-Time at Risk: The sum of the time periods that each individual in the study population was observed and at risk of developing the outcome. This is often measured in "person-years," "person-months," or "person-days." It accounts for people entering or leaving the study at different times.
Multiplier: A standard base used to normalize the data for reporting. For common diseases, 1,000 is often used; for rarer conditions, 100,000 might be preferred.
Why Use Person-Time?
Using person-time in the denominator (incidence density) is more accurate than simply using the total population size at the start of a study (cumulative incidence). Person-time accounts for the fact that people may drop out of a study, die from other causes, or only be followed for a short duration. It provides a true "rate" of occurrence.
Example Calculation
Let's look at a practical example of how this formula works in a real-world scenario:
Imagine a 5-year study tracking the development of a specific condition in a town. The researchers calculated that the total time contributed by all participants while they were healthy and at risk amounted to 25,000 person-years. During the course of those 5 years, 150 new cases of the condition were diagnosed.
To find the incidence rate per 1,000 person-years:
Raw Rate Calculation: 150 cases / 25,000 person-years = 0.006
Applying the Multiplier: 0.006 × 1,000 = 6
The incidence rate is 6 cases per 1,000 person-years.