Recurrent Events: Counting Every Admission Without Pretending They Are Independent

On this page
อ่านฉบับภาษาไทย (Thai version)
Abstract
When one patient can have the same event many times, such as repeated heart-failure admissions, asthma exacerbations or seizures, a time-to-first-event analysis stops at the first event and throws the rest away. Two questions then choose the model: does the order of events matter, and on which clock is time measured? The Andersen-Gill model puts every event on one continuing clock and estimates the effect on the overall recurrent-event rate. Because one patient's events are correlated, it is reported with a robust (sandwich) variance, which corrects the standard error without moving the estimate. The Prentice-Williams-Peterson (PWP) model makes the previous event matter, so a patient is at risk for the next event only after the one before, and its gap-time version restarts the clock after every event. Neither model by itself handles death as a competing terminal event. This article works through two patients' admissions, a design sentence read clue by clue and a decision rule for choosing the model.
A patient who keeps coming back
On a heart-failure ward, one patient is back for the fourth time this year. Another patient from the same clinic was admitted once and has not returned. A researcher planning the analysis of a treatment for these patients wants every admission to count, not only the first.
Before choosing a model, two things have to be decided. Does the order of the admissions matter? And on which clock should time be measured: one clock running from the start of follow-up, or a clock that restarts after each admission?
One patient, the same event, many times
Recurrent-event analysis is needed when one patient can experience the same type of event multiple times. These are recurrent events. Examples:
- repeated asthma exacerbations
- repeated hospitalizations
- repeated infections
- recurrent seizures
- recurrent cancer events
- recurrent bleeding
Take heart-failure hospitalization. One patient can go through $H_1 \rightarrow H_2 \rightarrow H_3 \rightarrow H_4$, where $H_1$ is the first hospitalization, $H_2$ the second, and so on.
An ordinary Cox model, the standard regression for time to an event, usually analyses the time to the first hospitalization. Follow-up for that patient stops at $H_1$. Everything after it is thrown away, so a patient admitted 1 time and a patient admitted 8 times can look the same in a primary first-event analysis. A huge amount of information is lost.
Two worlds before any model
Before naming any method, decide which world the outcome lives in.
Suppose the outcome is cancer recurrence. A patient can go from no event to recurrence, or from no event to death before recurrence:
$$\text{No event} \rightarrow \text{Recurrence}$$or
$$\text{No event} \rightarrow \text{Death before recurrence}$$Death here is a competing event: once it happens, the event of interest can never happen. Each patient has at most one first event, and the question is which one comes first. This is the competing-risk world, covered in Part 4 and Part 5 of this series.
Now suppose the outcome is hospitalization:
$$\text{Hospitalization}_1 \rightarrow \text{Hospitalization}_2 \rightarrow \text{Hospitalization}_3 \rightarrow \cdots$$The same event keeps happening to the same patient. This is the recurrent-event world.
Andersen-Gill: all events on one clock
The Andersen-Gill model treats all recurrent events as part of one continuing counting process: each patient carries a running count of events that steps up by one at every event. Time continues forward on the same overall scale, called total time, from the start of follow-up [1].
start
0 -------- event 1 -------- event 2 -------- event 3
total time →Andersen-Gill is an extension of the Cox model, in its counting-process form, for recurrent events. Take two patients:
$$\text{Patient A: } 0 \rightarrow H_1 \rightarrow H_2 \rightarrow H_3, \quad \text{Patient B: } 0 \rightarrow H_1$$Andersen-Gill uses $H_1$, $H_2$ and $H_3$ from patient A, all of them. Nothing after the first event is discarded.
So when the scientific question is what effect the treatment has on the overall recurrent-event rate, or intensity, over the whole follow-up, Andersen-Gill fits it better than a time-to-first-event analysis. The intensity is the rate at which events occur at a given moment for a patient still being followed.
Typical clues that point to Andersen-Gill:
- total time
- counting-process framing
- repeated events treated as occurring along one ongoing timeline
Why "with robust variance"?
Take one patient with three hospitalizations, $H_1$, $H_2$ and $H_3$. These three events are not independent. A patient who has been admitted once may well be the kind of patient who gets admitted again.
Written for patient A, the events $H_{A1}$, $H_{A2}$ and $H_{A3}$ all come from the same person. That is within-patient correlation.
If the analysis pretends that each event is independent, as if every admission came from a different person, the standard error can be wrong; when a patient's admissions go together, it usually comes out too small. The fix is the robust (sandwich) variance, clustered on patient. It first adds up everything each patient contributes to the estimate, then measures how much these patient totals vary, so the standard error and the inference stay valid under within-patient dependence [2]. It changes the standard error, not the hazard ratio (HR) itself, the ratio of event rates between arms among patients still at risk.
A simulated heart-failure trial of 1,500 patients with 1,313 admissions shows the point. The Andersen-Gill hazard ratio is 0.73. Treating the admissions as independent gives a standard error of its logarithm of 0.0555 and a 95% CI of 0.66 to 0.82.
The robust variance raises the standard error to 0.0738 and widens the interval to 0.63 to 0.85. The estimate does not move; only its uncertainty does.
R: one fit, naive and robust standard errors side by side
# Andersen-Gill: every admission counts, total time, robust (sandwich) SE clustered on patient
ag <- coxph(Surv(start, stop, event) ~ arm + cluster(id), data = rl, ties = "breslow")
print(summary(ag))
> ag <- coxph(Surv(start, stop, event) ~ arm + cluster(id),
+ data = rl, ties = "breslow")
> print(summary(ag))
Call:
coxph(formula = Surv(start, stop, event) ~ arm, data = rl, ties = "breslow",
cluster = id)
n= 2813, number of events= 1313
coef exp(coef) se(coef) robust se z Pr(>|z|)
arm -0.31129 0.73250 0.05555 0.07376 -4.22 2.44e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp(coef) exp(-coef) lower .95 upper .95
arm 0.7325 1.365 0.6339 0.8464
Concordance= 0.539 (se = 0.009 )
Likelihood ratio test= 31.63 on 1 df, p=2e-08
Wald test = 17.81 on 1 df, p=2e-05
Score (logrank) test = 31.66 on 1 df, p=2e-08, Robust = 17.59 p=3e-05
(Note: the likelihood ratio and score tests assume independence of
observations within a cluster, the Wald and robust score tests do not).
Kaplan-Meier versus Andersen-Gill: two patients
Two patients, times in months from the start of follow-up. The same admissions are read first in the time-to-first-event world, the world of Kaplan-Meier curves and the ordinary Cox model, and then in the Andersen-Gill world.
-
Patient A
\[ \text{hospitalized at } 1,\ 3,\ 5,\ 8 \text{ months} \]
Four hospitalizations.
-
Patient B
\[ \text{hospitalized at } 2 \text{ months only} \]
One hospitalization.
-
Time-to-first-event world (Kaplan-Meier, Cox)
\[ A:\ T = 1, \quad B:\ T = 2 \]
Each patient contributes one time: the time to the first hospitalization.
-
What the first-event world throws away
\[ 3,\ 5,\ 8 \]
Every hospitalization of patient A after month 1 is dropped from a time-to-first-event analysis.
-
Andersen-Gill world
\[ A:\ H_1, H_2, H_3, H_4; \quad B:\ H_1 \]
Patient A contributes all four hospitalizations and patient B contributes one.
Result: The first-event world sees only T = 1 for A and T = 2 for B and discards A's admissions at months 3, 5 and 8. Andersen-Gill keeps H1 to H4 from A and H1 from B, so it answers the total recurrent-event burden, or rate, better.
Prentice-Williams-Peterson: the previous event matters
The Prentice-Williams-Peterson (PWP) model explicitly respects event order [3]. A patient generally becomes at risk for event $k$ only after experiencing event $k - 1$: nobody is at risk of a second hospitalization before the first has happened.
Event 1 → Event 2 → Event 3Each event is therefore analysed conditional on the previous events. The first event, the second and the third are not interchangeable, as they are on the single Andersen-Gill clock. PWP can still run on total time, from the start of follow-up, but its best-known version changes the clock itself.
PWP gap-time: restart the clock
This is the version of PWP to know first. In gap time, the clock resets to 0 after each event:
Event 1:
0 ------------ 30 days
Event 2:
0 ------ 12 days
Event 3:
0 ---------------- 45 daysThe first event comes 30 days after the start. The clock then restarts, and the second event comes 12 days after the first. It restarts again, and the third comes 45 days after the second. Each time is measured from the previous event, not from the start of follow-up.
The question becomes:
"How long from the previous recurrence until the next recurrence?"
Reading a design sentence clue by clue
A protocol states: "Investigators want the effect on the next recurrence, conditional on previous recurrences, with time reset after each event." Break the sentence into clues.
-
"next recurrence"
The event repeats, so this is recurrent-event analysis.
-
"conditional on previous recurrences"
Event order matters, which points to PWP.
-
"time reset after each event"
The clock restarts after every event: gap time.
Result: Therefore: PWP gap-time.
Why the alternatives are different
Time to first event only. Discards all later recurrences, as patient A's admissions at months 3, 5 and 8 showed.
Negative binomial model. A regression for the number of events per patient. It is useful for event counts and rates, but it does not inherently preserve event order or detailed event timing.
Fine-Gray. Designed for competing risks, not ordered recurrent events. It models the first event of one type when another event can come first (Part 5 of this series).
When the question is about every recurrence, its order and its timing, the choice is between Andersen-Gill and PWP [4].
Andersen-Gill versus PWP
| Feature | Andersen-Gill | PWP |
|---|---|---|
| Repeated events | Yes | Yes |
| Event order emphasized | Less | Yes |
| Conditional on previous events | Not the defining feature | Yes |
| One continuing total-time scale | Typical | Can use the total-time version |
| Reset clock after each event | No | PWP gap-time |
The decision rule
Repeated event?
↓
Does previous event matter?
↓ yes
PWP
Does the clock reset after each event?
↓ yes
PWP gap-time- Is the event repeated in the same patient? If yes, this is recurrent-event analysis.
- Does the previous event matter? If yes, use PWP.
- Does the clock reset after each event? If yes, use PWP gap-time.
If the previous event does not define the question and every event sits on one continuing clock, the model is Andersen-Gill with a robust variance.
Andersen-Gill among the five time-to-event methods
Kaplan-Meier, the cumulative incidence function, cause-specific Cox and Fine-Gray all target the first event, and three of them are built for competing risks (Part 2, Part 4 and Part 5). Andersen-Gill with a robust variance is the only one of the five that targets several events in one patient.
When the question is the treatment effect on all hospitalizations, the first, the second, the third and onward, the answer is Andersen-Gill with a robust variance.
| Method | Events per patient it targets | Handles competing risks? | What it estimates | The question in plain words |
|---|---|---|---|---|
| Kaplan-Meier | First event | Not directly | S(t), the proportion still event-free | "What percentage are still event-free?" |
| Cumulative incidence function | First event of a given type | Yes | The actual probability of a specific cause | "What percentage really have a recurrence when some die first?" |
| Cause-specific Cox | First event of a given type | Yes | Cause-specific hazard ratio | "Among patients still event-free now, does recurrence come faster in one group?" |
| Fine-Gray | First event of a given type | Yes | Subdistribution hazard ratio, linked to the cumulative incidence | "How is the treatment or covariate associated with the cumulative incidence?" |
| Andersen-Gill + robust variance | Multiple recurrent events | Not a competing-risk model by itself | Effect on the overall recurrent-event intensity or rate | "Counting events 1, 2, 3 and onward, does treatment lower the event burden or rate?" |
Words that point to Andersen-Gill
Facing any survival question, ask first: can the event happen again in the same person, and does the question want every occurrence counted? Asthma exacerbations, admissions, infections, seizures and recurrent bleeding are the usual examples.
If yes, and a protocol or paper says any of these:
- "overall recurrent-event rate"
- "first and subsequent events"
- "account for within-patient dependence"
then the model is Andersen-Gill with a robust variance. If no, move on to the next question: is there a competing event that stops the primary event from happening?
| Wording | Points to |
|---|---|
| "subdistribution hazard" | Fine-Gray |
| "cause-specific hazard" | Cause-specific Cox |
| "repeated" or "recurrent events" with "first and later events" | Andersen-Gill |
| "within-patient dependence" | Robust (sandwich) variance |
Andersen-Gill does not solve competing death
Andersen-Gill answers one problem: many recurrent events per patient. It was not built to answer another: a competing terminal event.
Take recurrent hospitalizations that continue until death. Death is a terminal event: once it happens, no future hospitalization can follow. If death is linked to the underlying severity of the disease, the sickest patients both die sooner and would have been admitted more. The recurrent-event analysis may then need methods more complex than a plain Andersen-Gill model, depending on the quantity the study aims to estimate, such as joint or frailty approaches that model admissions and death together [5, 6].
So Andersen-Gill is not a universal survival model. Its job is the recurrent-event process.
Common misreadings and their fixes
-
"Time to the first event is enough even when events repeat."
A first-event analysis stops at the first event, so a patient admitted once and a patient admitted many times can look the same.
Fix: When the question is about every event, use a recurrent-event model: Andersen-Gill or PWP.
-
"Each admission is a separate observation."
Admissions from one patient are correlated: a patient admitted once is prone to be admitted again.
Fix: Report Andersen-Gill with a robust (sandwich) variance clustered on patient.
-
"The robust variance changes the answer and takes care of death."
In the simulated trial the hazard ratio stayed at 0.73 with either standard error, and a death still ends follow-up as if it were ordinary censoring.
Fix: Read the robust variance as a correction to the uncertainty only, and handle death as a separate problem.
-
"A negative binomial model gives the same answer as PWP."
A count model is useful for event counts and rates, but it does not inherently preserve event order or detailed event timing.
Fix: When order or timing matters, use PWP, or PWP gap-time when the clock restarts after each event.
-
"Fine-Gray handles recurrent events."
Fine-Gray is designed for competing risks on the first event, not for ordered recurrent events.
Fix: Use Fine-Gray when death can come before the first event and the question is the cumulative incidence; use Andersen-Gill or PWP when the same event repeats.
-
"Andersen-Gill is a universal survival model."
Its job is the recurrent-event process; it does not solve a competing terminal event such as death.
Fix: Choose the world first: first event with competing risks, or recurrent events, then the model.
-
"Every recurrent-event model keeps the order of events."
Andersen-Gill puts all events on one clock and treats them alike; order is the defining feature of PWP only.
Fix: Ask whether the previous event matters (PWP) and whether the clock restarts after each event (PWP gap-time).
The first branch of every time-to-event question
Start every time-to-event question with one branch:
- Does the event repeat?
- Yes → Andersen-Gill (or PWP when the previous event matters).
- No → is there a competing event?
- No → Kaplan-Meier and Cox.
- Yes → actual probability: the cumulative incidence function; probability with covariates: Fine-Gray; instantaneous cause-specific rate with covariates: cause-specific Cox.
The first part of this series draws the whole map.
Glossary
- recurrent events (เหตุการณ์ซ้ำ)
- Events of the same type, such as hospitalizations, that can occur more than once in the same patient.
- counting process
- A view of follow-up in which each patient's event count steps up by one at every event.
- intensity
- The rate at which events occur at a given moment for a patient still being followed.
- hazard ratio (อัตราส่วนฮาซาร์ด)
- The ratio of event rates between arms among patients still at risk; it is not a ratio of risks.
- Andersen-Gill model (แบบจำลอง Andersen-Gill)
- A Cox-type model that puts all recurrent events on one continuing clock and estimates the effect on the overall recurrent-event rate.
- within-patient correlation
- The dependence between events from the same patient: a patient with one event is more likely to have another.
- robust (sandwich) variance (ค่าคลาดเคลื่อนมาตรฐานแบบแซนด์วิช)
- A variance clustered on patient that keeps the standard error valid when a patient's events are correlated; it does not change the estimate.
- Prentice-Williams-Peterson model (แบบจำลอง Prentice-Williams-Peterson)
- A recurrent-event model that respects event order: a patient is at risk for event k only after event k - 1.
- total time
- Time measured on one continuing clock from the start of follow-up for every event.
- gap time
- Time measured from the previous event, with the clock restarting at 0 after each event.
- competing event (เหตุการณ์แข่งขัน)
- An event, such as death, that prevents the event of interest from ever happening.
- terminal event
- An event, such as death, after which no further recurrent events can occur.
- negative binomial regression
- A regression for the number of events per patient; it handles counts and rates but not event order or timing.
- Fine-Gray model (แบบจำลอง Fine-Gray)
- A regression model for the cumulative incidence of the first event of one type when competing events can occur first.
References
- Andersen PK, Gill RD. Cox's regression model for counting processes: a large sample study. Ann Stat. 1982;10(4):1100-1120. doi:10.1214/aos/1176345976 https://doi.org/10.1214/aos/1176345976
- Lin DY, Wei LJ, Yang I, Ying Z. Semiparametric regression for the mean and rate functions of recurrent events. J R Stat Soc Series B Stat Methodol. 2000;62(4):711-730. doi:10.1111/1467-9868.00259 https://doi.org/10.1111/1467-9868.00259
- Prentice RL, Williams BJ, Peterson AV. On the regression analysis of multivariate failure time data. Biometrika. 1981;68(2):373-379. doi:10.1093/biomet/68.2.373 https://doi.org/10.1093/biomet/68.2.373
- Amorim LDAF, Cai J. Modelling recurrent events: a tutorial for analysis in epidemiology. Int J Epidemiol. 2015;44(1):324-333. doi:10.1093/ije/dyu222 https://doi.org/10.1093/ije/dyu222
- Ghosh D, Lin DY. Nonparametric analysis of recurrent events and death. Biometrics. 2000;56(2):554-562. doi:10.1111/j.0006-341X.2000.00554.x https://doi.org/10.1111/j.0006-341X.2000.00554.x
- Rogers JK, Pocock SJ, McMurray JJV, Granger CB, Michelson EL, Ostergren J, et al. Analysing recurrent hospitalizations in heart failure: a review of statistical methodology, with application to CHARM-Preserved. Eur J Heart Fail. 2014;16(1):33-40. doi:10.1002/ejhf.29 https://doi.org/10.1002/ejhf.29
Key takeaways
- When the same event can happen again in one patient, a time-to-first-event analysis throws away every event after the first.
- Andersen-Gill puts all events on one clock and estimates the effect on the overall recurrent-event rate, with a robust (sandwich) variance because one patient's events are correlated.
- PWP makes the previous event matter: a patient is at risk for event k only after event k - 1.
- PWP gap-time restarts the clock after every event and asks how long it takes from one recurrence to the next.
- Andersen-Gill is not a competing-risk model: death stops future events and needs its own handling.
Related in the wiki: [[time-to-event-survival-analysis]]