Skip to main content
v2026.11,772 entries · CC-BY 4.0

Recurrent Event Analysis: Andersen-Gill, PWP, and WLW Models

Recurrent events — readmissions, exacerbations, infections, device failures — need a different Cox extension than a single-event survival model. This guide covers Andersen-Gill, Prentice-Williams-Peterson, and Wei-Lin-Weissfeld models, when to pick each, robust variance, and count-based and non-parametric alternatives.

Written and maintained by CASRAI Editorial Board

Last updated

Recurrent event analysis is the set of statistical methods for outcomes that a subject can experience more than once during a study period — hospital readmissions, disease exacerbations, infections, device failures, seizures. Standard survival analysis (Kaplan-Meier curves, a plain Cox model) is built around a single terminal event per subject and, applied to recurrent data, either discards every event after the first or misrepresents the correlation between events from the same person. This guide covers the three standard Cox-based extensions for repeated events, how they differ, when to pick each one, and the count-based and non-parametric alternatives worth knowing before you commit to a model.

Why “time to first event” isn’t enough

A trial arm with fewer readmissions per patient but a similar time-to-first-readmission looks identical to a naive Kaplan-Meier curve, because that curve stops counting the moment a patient is readmitted once. If the real clinical or scientific question is about the total burden of events — how often something happens, not just whether and when it first happens — a first-event-only analysis throws away exactly the information the study was designed to capture. Composite-endpoint and recurrent-event methods exist because regulators and methodologists have repeatedly found that first-event analyses understate treatment effects that operate mainly by lowering the rate of subsequent events, not just delaying the first one.

The complication is that events from the same subject are not independent observations the way the standard Cox model assumes. A patient who is readmitted once is mechanically more likely to be readmitted again — through unmeasured frailty, disease severity, or simply having more remaining follow-up time in which to have another event. Fitting a plain Cox model to a “long” dataset of repeated event rows without accounting for that clustering produces standard errors that are too small and p-values that are too optimistic.

Three standard Cox-based approaches

All three extensions below start from the same idea — restructure the data into one row per event-at-risk interval per subject — and differ in how they define the risk set and the time scale. For the underlying model these extend, see the Cox proportional hazards model.

Andersen-Gill (AG)

The Andersen-Gill model (Andersen & Gill, 1982) treats each subject’s sequence of events as a counting process: a subject remains at risk for the next event for as long as they are under observation, regardless of how many events they have already had. Every event interval — from the start of follow-up or the previous event, to the next event or censoring — contributes to a single shared baseline hazard, with covariates entered exactly as in a standard Cox model. AG is the simplest of the three to fit and interpret (one hazard ratio per covariate, on the rate of any event), but it assumes the risk of a second, third, or later event follows the same baseline hazard shape as the risk of the first — an assumption that fails when event risk genuinely changes after a subject has already had one or more events (which is common: a first exacerbation often raises the risk and changes the pattern of the next one).

Prentice-Williams-Peterson (PWP)

The Prentice-Williams-Peterson model (Prentice, Williams & Peterson, 1981) fixes that assumption by stratifying the baseline hazard on event number — a subject is only “at risk” for their second event after having had a first, and the second-event stratum is allowed its own baseline hazard shape, separate from the first-event stratum, and so on. PWP comes in two time-scale variants: the total-time model keeps the same clock-time-since-study-entry scale as AG (just adds an event-number stratum), while the gap-time model resets the clock to zero at each event, so the time scale becomes time-since-the-previous-event. The choice between them is substantive, not just technical: total-time answers “how does risk evolve over calendar time in the study,” gap-time answers “how does risk evolve since the last event” — pick based on which timescale the clinical or scientific question is actually about.

Wei-Lin-Weissfeld (WLW)

The Wei-Lin-Weissfeld model (Wei, Lin & Weissfeld, 1989) takes a different approach entirely: instead of treating events as ordered and mutually exclusive risk sets, it fits a separate marginal Cox model for each event number (first event, second event, third event…) using the whole cohort as the risk set for every stratum — every subject is “at risk” for their k-th event from time zero, even if they never reach it. This makes WLW a marginal-means model rather than a model of within-subject event ordering, which is a defensible choice when event number itself isn’t a meaningful ordering (e.g., recurrent infections where “the second infection” isn’t conceptually different from “the first”), but a poor choice when it is. A published methods comparison across composite-endpoint data found AG and PWP producing similar effect estimates under most realistic data-generating scenarios, while WLW estimates diverged more, particularly when event counts per subject varied widely (BMC Medical Research Methodology, 2018).

Choosing between them

Model Risk set for event k Time scale Best fit when…
Andersen-Gill Anyone still under observation Total (study-entry) time Events are exchangeable and risk doesn’t structurally change after prior events
PWP total-time Only subjects who reached event k-1 Total (study-entry) time Order matters and the calendar-time trajectory is the question
PWP gap-time Only subjects who reached event k-1 Reset at each event Order matters and “time since the last event” is the question
Wei-Lin-Weissfeld Whole cohort, every stratum Total (study-entry) time Event number isn’t a meaningful within-subject ordering

Getting the variance right: robust standard errors

Whichever model you fit, the within-subject correlation between a person’s events means the ordinary Cox variance estimator is invalid — it treats every row as an independent observation, which repeated-event rows from the same subject are not. All three models above are fit with a subject-level cluster-robust (“sandwich”) variance estimator (Lin & Wei, 1989), specified in software as a cluster or robust-variance option keyed on the subject ID. Reporting a recurrent-event Cox model’s confidence intervals without this correction is one of the most common errors in published recurrent-event analyses — it is not optional model-fitting hygiene, it is required for the standard errors to mean anything.

An alternative framing: modeling event counts, not event timing

If the scientific question is really about the rate of events per unit of follow-up time rather than their exact timing or sequence, negative binomial regression (or Poisson regression with an offset for follow-up time, when the data don’t show overdispersion) is a legitimate and often simpler alternative to a Cox-based recurrent-event model. It models each subject’s total event count directly, conditional on their length of follow-up, and reports an incidence rate ratio rather than a hazard ratio. This trades away any information about within-subject event order or clustering by cause, but it is easier to interpret and communicate, and is frequently the right choice when the outcome is genuinely count-like (number of falls, number of migraine days) rather than a sequence of discrete clinical events. See the Poisson distribution for the count-data model this builds on, and mixed-effects models if you need a subject-level random effect on top of the count model rather than a robust variance correction.

A non-parametric alternative: the mean cumulative function

Before — or instead of — fitting any regression model, the mean cumulative function (MCF) is a Nelson-Aalen-based non-parametric estimate of the expected cumulative number of events per subject by time t, analogous to what a Kaplan-Meier curve does for a single event. Plotting the MCF by treatment arm or exposure group is a useful, assumption-light first look at whether event burden differs over time before committing to any of the Cox-based or count-based models above, and it correctly accounts for a subject’s death or dropout as a competing risk on further events when it is estimated properly (a naive cumulative-count plot that ignores dropout will overstate later-time event burden in the group with more attrition).

What this means for your data-analysis plan or protocol

The choice among AG, PWP, WLW, and a count-based model should be made and justified in the statistical analysis plan before unblinding, not selected post hoc from whichever gives the cleanest result — the published comparison above found the models can genuinely disagree on estimated effect size, which makes this a pre-specification issue, not just a technical footnote. State explicitly: which model, which time scale (if PWP), how many events per subject the study expects (informs power), and that a subject-level robust variance estimator will be used. If you’re building a clinical trial’s statistical analysis plan or writing up methods for a manuscript, name the model and cite the original methodological reference (Andersen & Gill 1982; Prentice, Williams & Peterson 1981; or Wei, Lin & Weissfeld 1989) rather than only naming the software procedure used to fit it.

Frequently asked questions

Is recurrent event analysis the same as competing risks analysis?

No. Competing risks analysis handles the case where one event type (e.g., death) prevents a different event type from ever occurring for that subject. Recurrent event analysis handles the case where the same event type can happen more than once for the same subject. The two are frequently combined in practice — for example, treating death as a competing terminal event that stops further recurrent-event risk — but they answer different structural problems.

Do I need a frailty model instead?

A shared-frailty survival model is a related but distinct approach: it adds a subject-level random effect directly into the hazard rather than correcting the variance after the fact with a robust sandwich estimator. It’s a reasonable alternative to AG/PWP/WLW, particularly when you want to explicitly model and report the magnitude of unobserved between-subject heterogeneity rather than treat it as a nuisance to be corrected for. See frailty models for clustered survival data for how that approach works and how to choose between it and a robust-variance Cox extension.

Which software procedures fit these models?

In R, the survival package’s coxph() function fits AG directly; PWP and WLW are set up by restructuring the data into the appropriate counting-process (start, stop, status) form with the right stratification and risk-set definition, most easily built with the survSplit()/tmerge() helpers. In SAS, PROC PHREG supports all three via its COUNTING process style and STRATA/ID statements.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · included with Regulatory Radar

Ask about Recurrent Event Analysis: Andersen-Gill, PWP, and WLW Models

Ask CASRAI answers research-administration questions and cites the passages behind every claim — and says so when the corpus does not cover something, instead of guessing. It comes with a Regulatory Radar subscription at $29 a month, alongside the daily digest of regulatory changes and the dashboard of what changed.

150 questions a day, on this site, over the API, or inside your own tools through the CASRAI MCP server.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Regulatory Radar

Stop finding out after the fact

$29/month, cancel anytime. Daily digest updates from our analysis, a dashboard holding the same items, and a cited assistant for everything they raise.

  • Federal Register, Federal Register+, Grants.gov, Regulations.gov, NSF News, UKRI, plus CASRAI’s own published content.
  • 72,264 indexed passages, and every answer cites the ones it drew on.