function calculateIncidenceRate() {
// Get input values
var casesInput = document.getElementById('new_cases');
var personTimeInput = document.getElementById('person_time');
var multiplierSelect = document.getElementById('multiplier');
var unitLabelSelect = document.getElementById('time_unit_label');
var resultArea = document.getElementById('result-area');
var cases = parseFloat(casesInput.value);
var personTime = parseFloat(personTimeInput.value);
var multiplier = parseFloat(multiplierSelect.value);
var unitLabel = unitLabelSelect.value;
// Validation
if (isNaN(cases) || isNaN(personTime) || personTime <= 0 || cases < 0) {
alert("Please enter valid positive numbers for Cases and Person-Time.");
return;
}
// Calculation Logic
// Incidence Rate = Cases / Person-Time
var rawRate = cases / personTime;
var formattedResult = rawRate * multiplier;
// Formatting numbers
// We use toLocaleString for pretty commas and limit decimals
var rawRateString = rawRate.toPrecision(6);
var formattedResultString = formattedResult.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 4 });
var multiplierString = multiplier.toLocaleString();
// Display Results
resultArea.style.display = 'block';
// Set Main Result
document.getElementById('main_result_display').innerHTML =
formattedResultString + " cases per " + multiplierString + " " + unitLabel.toLowerCase();
// Set Details
document.getElementById('raw_rate_display').innerHTML = rawRateString;
document.getElementById('standard_rate_display').innerHTML = formattedResultString;
// Interpretation Logic
document.getElementById('interpretation_display').innerHTML =
"For every " + multiplierString + " " + unitLabel.toLowerCase() + " observed, there were " + formattedResultString + " new cases.";
}
Understanding Person-Time Incidence Rate
The Person-Time Incidence Rate Calculator (often referred to as Incidence Density) is a critical tool in epidemiology for measuring the frequency at which a new disease or event occurs within a population over a specific period. Unlike cumulative incidence, which assumes a fixed population over time, person-time incidence accounts for the varying amounts of time each individual contributes to the study.
Formula:
Incidence Rate (IR) = (Number of New Cases) / (Total Person-Time at Risk)
Why Use Person-Time?
In real-world cohort studies, participants may not be followed for the same duration. People may join the study late, drop out (loss to follow-up), or die from other causes. Using "Person-Time" in the denominator allows researchers to sum the actual time at risk contributed by all participants, providing a more accurate measure of the "speed" of disease occurrence.
For example, 100 person-years could represent:
100 people followed for 1 year each.
10 people followed for 10 years each.
50 people followed for 2 years each.
How to Use This Calculator
Number of New Cases: Enter the count of individuals who developed the disease or outcome of interest during the observation period. Do not include prevalent cases (those who already had the disease at the start).
Total Person-Time at Risk: Enter the sum of time units that all study participants were observed while at risk. Common units are Person-Years, Person-Months, or Person-Days.
Report Rate Per: Incidence rates are often very small numbers (e.g., 0.0045). Epidemiologists typically multiply this by 1,000, 10,000, or 100,000 to make the number readable and comparable.
Example Calculation
Imagine a study following a group of factory workers to see if they develop respiratory issues.
Scenario: You follow 500 workers. However, due to turnover, the total time they worked sums up to 2,500 person-years.
Events: During this time, 15 new cases of respiratory illness were diagnosed.
Standardization: To express this per 1,000 person-years, calculate: 0.006 × 1,000 = 6.
Result: The incidence rate is 6 cases per 1,000 person-years.
Interpreting the Results
The result tells you the "density" of the disease occurrence. A higher rate indicates that the disease is occurring more rapidly within the population at risk. This metric is fundamental for comparing health risks between different groups (e.g., smokers vs. non-smokers) while adjusting for different follow-up times.