- Introduced by
- Andersen & Gill (AG, 1982); Prentice, Williams & Peterson (PWP, 1981); Wei, Lin & Weissfeld (WLW, 1989)
- Year
- 1981
- Type
- Semi-parametric hazard model for repeated events
What does it do?
A recurrent event model is a survival-analysis extension for time-to-event data in which the same event, such as a hospital readmission, disease relapse or equipment failure, can occur more than once in the same individual. Its main frameworks, developed by Prentice, Williams and Peterson (1981), Andersen and Gill (1982) and Wei, Lin and Weissfeld (1989), are the Andersen-Gill (AG) model, the Prentice-Williams-Peterson (PWP) stratified model and the Wei-Lin-Weissfeld (WLW) marginal model.
They differ mainly in their assumptions about how repeated events within a subject are related.
The intuition behind the method
Standard Cox regression treats each subject as contributing time until a single event, after which the subject leaves the risk set. In settings such as repeated asthma attacks, epileptic seizures or machine breakdowns, the same individual can experience the event several times, and discarding later episodes means losing information about the process. Recurrent event models use a counting-process layout so that each interval between events for the same person contributes to the likelihood. Because observations from one individual are correlated, they also rely on robust standard errors or frailty terms.
History
Andersen and Gill (1982, Annals of Statistics) placed the counting-process formulation for survival data on a rigorous footing and extended Cox's partial likelihood to allow multiple events per subject. Prentice, Williams and Peterson (1981) proposed a stratified approach for ordered recurrent events, and Wei, Lin and Weissfeld (1989) introduced a marginal model. Cook and Lawless (2007) provide a comprehensive monograph that unifies these frameworks, and Amorim and Cai (2015) give an epidemiological tutorial with worked software examples.
When to use it
Use a recurrent event model when the same subject can experience the event more than once and the timing or number of recurrences is scientifically relevant. The data must be laid out in counting-process form, with a start time, stop time and event indicator for each interval, plus a subject identifier so that a subject's rows can be linked. Choose AG when event order is not important and a single hazard ratio across recurrences is an adequate summary. Choose PWP when the risk of later events is expected to depend on how many earlier events have occurred, such as successive relapses. Choose WLW when separate marginal hazard ratios for each event occurrence are wanted, without the risk-set restriction that PWP imposes. Do not use these models when only the first event is of interest, since standard Cox regression is then sufficient, or when the number of recurrent events is too small to estimate the later strata reliably. Consider adding a frailty term when unobserved differences between subjects are suspected.
Limitations and considerations
- Data preparation in counting-process format (multiple rows per subject) is substantially more involved than for standard survival data and is a frequent source of errors.
- Model selection among AG, PWP, and WLW requires domain knowledge; the wrong choice can yield misleading hazard ratios.
- Informative censoring — where a subject drops out because of deterioration related to the event process — biases all three frameworks.
- Sparse data in later event strata (e.g., fifth or sixth recurrences) can produce unreliable PWP stratum-specific estimates.
- Validity depends on several assumptions: proportional hazards, conditional independence of events given covariates under AG, correctly constructed stratum-specific risk sets under PWP, noninformative censoring, and a time scale matched to the model. Proportional hazards can be examined with residual-based checks before hazard ratios are interpreted.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Exploits all recurrences from each subject, substantially increasing statistical power relative to first-event-only analyses.
- The three frameworks — AG, PWP, WLW — cover a wide spectrum of biological and engineering scenarios, from order-irrelevant failures to ordered disease relapses.
- Robust standard errors accommodate within-subject dependence without requiring a fully specified correlation model.
- Frailty extensions naturally incorporate unobserved subject-level heterogeneity.
Applications
- Clinical medicine: modelling hospital readmissions, asthma attacks, or epileptic seizures in chronic disease patients.
- Oncology: analysis of tumour relapses and time between successive chemotherapy cycles.
- Public health and epidemiology: studying repeated infections or injury recurrences in longitudinal cohort studies.
- Industrial reliability: modelling repeated equipment failures and estimating maintenance intervention effects.
How it works
How it works
Each subject contributes one row per interval, recorded as (start, stop, event), and N_i(t) is the number of events for subject i accumulated up to time t. Because a subject re-enters the risk set after each event, the analysis uses every recurrence rather than only the first. This layout is the basis of the extension over standard survival analysis.
Formula
N_i(t) = \text{number of events for subject } i \text{ in } (0, t]The Andersen-Gill model uses one baseline hazard for all events in all subjects and a single set of regression coefficients for covariate effects. Its central assumption is that events within a subject are conditionally independent given the covariates. Clustering by subject ID gives robust (sandwich) standard errors that allow for dependence between a subject's events without modelling that dependence explicitly.
Formula
\lambda_i(t) = \lambda_0(t) \exp(\boldsymbol{\beta}^\top \mathbf{x}_i(t))The Prentice-Williams-Peterson model stratifies the baseline hazard by event number, so the first, second and later events each have their own baseline hazard shape. A subject enters the stratum for the k-th event only after k-1 events have occurred, which keeps event ordering in the analysis. This is the natural choice when the risk of later events changes with the recurrence count. Amorim and Cai (2015) describe two PWP variants: PWP-TT, which measures time from study entry (total time), and PWP-GT, which measures time from the previous event (gap time).
Formula
\lambda_{ik}(t) = \lambda_{0k}(t) \exp(\boldsymbol{\beta}_k^\top \mathbf{x}_{ik}(t))Repeated observations from one subject are correlated, so ordinary Cox standard errors are typically too small. The robust estimator sums each subject's score residuals to form B and places it between inverse information matrices as A^-1 B A^-1. This corrects the standard errors without requiring a fully specified correlation structure.
Formula
\hat{V}_{\text{robust}} = A^{-1} B A^{-1}, \quad B = \sum_{i} \mathbf{s}_i \mathbf{s}_i^\topCommon pitfalls
- Structuring data with only one row per subject and using the last event time, which ignores all intermediate events and reverts to a first-event analysis.
- Forgetting to cluster on subject ID (or add a frailty term), producing standard errors that treat repeated measurements as independent and are therefore too small.
- Applying AG when event ordering is biologically important (e.g., cancer relapses), where PWP stratification is the appropriate choice.
- Mixing time scales: the PWP variants described by Amorim and Cai (2015) measure time either from study entry (total time) or from the previous event (gap time), and AG uses time from study entry. Fitting one time scale to data prepared for another gives incorrect risk sets.
Frequently asked questions
How does a recurrent event model differ from standard Cox regression?
Standard Cox regression stops the clock for a subject after the first event and cannot use information from subsequent recurrences. A recurrent event model keeps each subject in the dataset across multiple event episodes by adopting counting-process format, so every interval from start to stop contributes to the partial likelihood. The within-subject correlation introduced by repeated observations is handled via robust standard errors or frailty terms.
When should I choose PWP over AG?
Choose PWP when the risk of the next event is likely to depend on how many events the subject has already experienced, for example successive cancer relapses or repeated hospitalisations in a deteriorating patient. PWP stratifies the baseline hazard by event number, allowing it to change shape across recurrences, and restricts the risk set for the k-th event to subjects who have already experienced k-1 events. AG is preferable when events are treated as exchangeable and a single hazard ratio across all recurrences is a satisfactory summary.
What is a frailty term and when should I add one?
A frailty is a subject-specific random effect, often a Gamma or log-normal multiplier on the baseline hazard, that captures unobserved heterogeneity between subjects. When some individuals are more prone to events for reasons the covariates do not capture, event counts are more dispersed than the model assumes. The effect on hazard ratio estimates and standard errors depends on whether the model is conditional or marginal and on the frailty distribution, so no single direction of bias applies. A frailty model is worth considering when such heterogeneity is plausible; robust standard errors clustered on subject ID are a simpler way to account for within-subject correlation.
What minimum sample size is needed?
A planning figure of 50 subjects is associated with this method, but it is a rough guide and does not guarantee stable estimates. For PWP, the number of events in the later recurrence strata is often the binding constraint: with few events, the partial likelihood for those strata may be flat, causing convergence problems or unstable estimates. If the total number of events is small, a standard Cox regression on the first event is a simpler and more stable alternative.
Related methods
Sources
Cook, R.J. & Lawless, J.F. (2007). The Statistical Analysis of Recurrent Events. Springer.
Open DOI referenceAmorim, L.D.A.F. & Cai, J. (2015). Modelling Recurrent Events: A Tutorial for Analysis in Epidemiology. International Journal of Epidemiology, 44(1), 324–333.
Open DOI reference