← All posts

Incidence Rate [IR] and Incidence Rate Ratio [IRR]: Analysis of Rates in Clinical Epidemiology Using Stata

Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or StatisticsStata [Data Analytics]
On this page

1. Introduction

In clinical epidemiology, outcomes often occur over time, and individuals may contribute different lengths of follow-up. In such settings, simple risks or proportions are inadequate. Instead, incidence rates (IRs) and incidence rate ratios (IRRs) are appropriate measures of disease incidence and exposure effects.

Stata’s ir command is designed for this purpose and is widely used in cohort studies, occupational epidemiology, pharmacoepidemiology, and registry-based research.


2. Incidence Rate (IR)

Definition

The incidence rate quantifies how rapidly new events occur in a population:

Incidence Rate   (IR) = Number of new events Total person-time at risk

Key property (dominant concept)

IR measures speed of occurrence, not probability

Two groups may have the same number of events, but if their follow-up times differ, their incidence rates differ.


3. Person-Time: the Role of Time

Each individual contributes time until:

Example

SubjectEventFollow-up (years)
AYes1.0
BNo2.5
CYes0.5
IR = 2 / 4.0 = 0.5  events per person-year

4. Incidence Rate Ratio (IRR)

Definition

The incidence rate ratio compares incidence rates between two groups:

IRR = IR exposed IR unexposed

Interpretation

Example:

IRR = 2.0 → exposed group experiences events twice as fast


5. Why IR / IRR are Dominant Measures

IR and IRR are dominant when:

  1. Follow-up time varies between individuals
  2. Entry into cohort is staggered
  3. Loss to follow-up occurs
  4. Population is dynamic
  5. Outcome is recurrent or count-based
  6. Interest is in rate, not cumulative risk

They outperform:


6. Data Structure Required for ir

Each observation must contain:

VariableMeaning
casesNumber of events
exposedExposure indicator (0/1)
timePerson-time contribution

Data may be individual-level or aggregated.


7. Stata ir Command

Basic syntax

ir cases exposed time

What Stata does internally:

1. Splits data by exposed

2. Computes:

IR = cases time

3. Calculates IRR and confidence intervals


8. Worked Example (Individual-Level Data)

Example dataset

clear
input id exposed events time
1 1 1 1.2
2 1 0 2.0
3 1 1 0.8
4 0 0 3.0
5 0 1 1.5
6 0 0 2.5
end

Run incidence rate analysis

ir events exposed time

Interpretation


collapse (sum) events time, by(exposed)
gen ir = events / time
list

This produces two rows:

IRR = ratio of these two IRs.


10. Immediate Form: iri (Aggregated Data)

When you already have totals:

iri events_exposed events_unexposed time_exposed time_unexposed

Example

iri 12 8 240 400

Equivalent to the full ir command.


11. Stratified Analysis

ir events exposed time, by(agegroup)

12. Relationship to Poisson Regression

ir is mathematically equivalent to:

poisson events exposed, exposure(time) irr

Differences:

irpoisson
Table-basedModel-based
No covariatesMultiple covariates
Teaching & descriptiveMultivariable inference

13. Common Misinterpretations (Important)

❌ IR is not a proportion ❌ IRR is not an odds ratio ❌ IRR is not a hazard ratio

✔ IRR compares rates per time ✔ HR compares instantaneous hazards


14. How to Report in a Paper

“Incidence rates were calculated as events per person-year. Incidence rate ratios (IRRs) with 95% confidence intervals were estimated using person-time denominators.”


15. Take-Home Message

0
Message for International and Thai ReadersUnderstanding My Medical Context in ThailandRead more →Message for International and Thai ReadersUnderstanding My Broader Content Beyond MedicineRead more →

Comments

No comments yet. Be the first to share your thoughts.

Sign in to comment