Andersen-Gill and Lin-Wei-Yang-Ying recurrent-event models
Andersen-Gill and LWYY use repeated events, but distinguish effects on a history-specific event intensity from effects on a marginal event rate.
Fit
When to use it, and when not to
Use it when
- People can have the same event repeatedly and you know event dates and periods at risk.
- Your question concerns all events, with the intensity or mean-rate interpretation fixed before analysis.
Not when
- Only the first event answers your question. A first-event Cox analysis may suffice. Read: Cox proportional hazards regression
- Events are known only as totals, without reliable dates. Consider a count model with appropriate exposure time. Read: Zero-inflated Poisson regression
Before you start
What you need
- Repeat-event definition and datesDefine distinct events and when a person can return to risk.
- Intensity or marginal ratesummaryMeasurerepeatedMeasuresState which interpretation and covariate history the model uses.
- Censoring and terminal eventscompetingEventsRecord follow-up end, death and periods when events cannot occur.
- The chosen proportional model fits the question.How to check: Andersen-Gill models intensity given history. LWYY models the marginal mean or rate; proportionality concerns that chosen target.
- Independent people provide the units of uncertainty.How to check: Use patient-level robust variance. Many events in a few people do not supply many independent units.
- Follow-up loss is noninformative under the model’s conditions.How to check: A robust variance does not remove informative dropout. Death stops future events and requires an explicit estimand and suitable analysis.
- Choose a missing-data method because of a stated assumption.How to check: Missing completely at random (MCAR) means gaps depend on neither observed nor unseen data. Missing at random (MAR) means recorded data explain gaps. Under MAR, suitable multiple imputation may help; it is not inherently better. Missing not at random (MNAR) means unseen values still predict gaps. Under plausible MNAR, add a delta or tipping-point sensitivity analysis. Dropping people with missing exposure can cause selection bias.
Plain language
How it works
Split follow-up at each event and at changes in covariates. Record each interval’s start, stop and event indicator. People can return to risk after an event. Keep one patient identifier across all intervals.
Andersen-Gill specifies event intensity conditional on the modeled history. Lin-Wei-Yang-Ying (LWYY) specifies a marginal mean or rate model with patient-robust variance. Under matching covariates and risk processes, the fits can share estimating equations. Their interpretations and assumptions still differ. Robust variance allows linked events within a person; it does not guarantee either interpretation. Check proportionality and state how death is handled.
Worked example
A worked example
- Setting
- One patient has recurrent admissions during follow-up.
- Question
- How is follow-up represented without discarding later admissions?
- Approach
- Admissions occur at months 2 and 5. Follow-up ends at month 8, with no further admission.
- Result
- Intervals run from 0 to 2, 2 to 5, and 5 to 8 months. Durations are 2, 3 and 3 months: 8 total.
- What it means
- There are 2 events in 8 person-months, a crude rate of 0.25 per person-month. This is not an adjusted model effect.
In practice
Recent studies PubMed search · not vetted
Watch out
Common mistakes
The one to remember
Andersen-Gill intensity and LWYY marginal rate interpretations require different assumptions, even when fitted coefficients coincide. Robust variance handles within-person dependence, not informative death or a wrong effect model.
- Calling a recurrent-event rate ratio a risk ratio.Instead: Name the modeled intensity or marginal rate and report the chosen follow-up horizon.
- Assuming robust errors make an intensity model correct.Instead: Robust errors change uncertainty, not the fitted mean or intensity assumptions.
- Treating death as routine independent censoring.Instead: Specify how death enters the question and report deaths alongside recurrence.
Inside Mallard
How Mallard uses this
Learn search lists Andersen-Gill and Lin-Wei-Yang-Ying recurrent-event models. The method registry links this method to its single-method article and code.
andersen-gill-recurrent-events).analysis.andersen_gill_lwyy, the id a plan cue records.Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- Cox’s regression model for counting processes: a large sample study (opens in a new tab) · Ann Stat
- Semiparametric regression for the mean and rate functions of recurrent events (opens in a new tab) · J R Stat Soc Series B Stat Methodol
- Modelling recurrent events: a tutorial for analysis in epidemiology (opens in a new tab) · Int J Epidemiol · doi 10.1093/ije/dyu222
- Recurrent disability progression endpoints in multiple sclerosis clinical trials (opens in a new tab) · Mult Scler · doi 10.1177/13524585221125382