Tutorials › Competing Risks and Multi-State Models › Deriving The Andersen-Gill Partial Likelihood

Recurrent-Event Estimands and Models · Tutorial 575 of 699

Deriving The Andersen-Gill Partial Likelihood

Follow the risk-set argument that produces the Andersen–Gill partial likelihood, and distinguish its event-time contributions from independent subject-level observations.

Advanced 11 min read

What You'll Learn

  • State the counting-process intensity model and the conditions used in the partial-likelihood derivation.
  • Derive each event-time factor by conditioning on an event in the risk set.
  • Construct an Andersen–Gill partial likelihood from recurrent-event histories.
  • Calculate partial-likelihood factors and score contributions in a hypothetical cohort.
  • Explain why repeated contributions from one subject are dependent and what the likelihood does—and does not—assume.
  • Recognize the consequences of tied event times, misspecified risk sets, and unmodeled subject heterogeneity.

Why a Recurrent-Event Partial Likelihood Needs a Risk-Set Argument

A recurrent-event record can contribute several event times for the same subject. The Andersen–Gill (AG) partial likelihood is built by asking, at each event time, which subjects were eligible to experience an event and how their modeled event intensities compare. Its algebra resembles the Cox partial likelihood, but the repeated contributions do not turn one subject into several independent subjects.

The key step is to derive an event-time factor from the intensity model, rather than to treat every recorded event as an independent survival outcome. The risk-set construction and AG model specification determine who is eligible and which covariates enter each factor.

Definition: For subject \(i\), let \(N_i(t)\) count recurrent events by time \(t\), and let \(Y_i(t)\) indicate whether that subject is under observation and at risk just before \(t\). Let \(X_i(t)\) be the covariate vector and \(\beta\) its coefficient vector. The AG model specifies the conditional intensity $$ \lambda_i(t\mid\mathcal{F}_{t-})=Y_i(t)\lambda_0(t)\exp\{\beta^\top X_i(t)\}, $$ where \(\mathcal{F}_{t-}\) denotes the observed history just before \(t\), and \(\lambda_0(t)\) is an unspecified baseline intensity. The risk set is \(R(t)=\{i:Y_i(t)=1\}\).

This is an event intensity: conditional on the history up to just before \(t\), it describes the instantaneous rate of an event for a subject currently at risk. After an event, that subject can remain at risk and contribute again, if the study’s risk-set rules say so. Censoring, study exit, and any other eligibility rules must be represented in \(Y_i(t)\). The model does not itself decide those rules.

Deriving the Event-Time Factor

Assume initially that event times are continuous, there are no tied events, and at most one subject has an event in an infinitesimal interval. Suppose an event occurs at time \(t\), and the event subject is not yet known. For a subject \(i\in R(t)\), the event probability over a short interval of length \(dt\), conditional on the history, is approximately \(\lambda_i(t\mid\mathcal{F}_{t-})dt\). Conditional on exactly one event in the risk set during that interval, the probability that subject \(i\) is the one who experiences it is therefore, to first order,

$$ \frac{\lambda_i(t\mid\mathcal{F}_{t-})dt} {\sum_{k\in R(t)}\lambda_k(t\mid\mathcal{F}_{t-})dt} = \frac{\exp\{\beta^\top X_i(t)\}} {\sum_{k\in R(t)}\exp\{\beta^\top X_k(t)\}}. $$

The common baseline intensity cancels. This conditional comparison is the source of the partial likelihood: it uses which subject had an event at each observed event time, without specifying or estimating the shape of \(\lambda_0(t)\).

Result: If the distinct observed event times are \(t_1,\ldots,t_D\), with event subject \(i_j\) at time \(t_j\), the no-ties AG partial likelihood is $$ L_p(\beta)=\prod_{j=1}^{D} \frac{\exp\{\beta^\top X_{i_j}(t_j)\}} {\sum_{k\in R(t_j)}\exp\{\beta^\top X_k(t_j)\}}. $$ A subject may appear as \(i_j\) more than once. The risk set in each factor is evaluated immediately before that event time.

The expression is a product over event times, not a product over independent subjects. Its factorization follows from the sequence of conditional event-identity probabilities given the risk-set histories. The histories include earlier events and changes in observation status. The result is not a claim that successive events from the same person are independent.

Worked Event-Time Calculations

Worked Example: One Event and a Three-Subject Risk Set

Suppose a hypothetical study has three subjects at risk just before time \(t_1\). Their binary covariates are \(X_1=1\), \(X_2=0\), and \(X_3=1\), and subject 1 experiences an event. With scalar coefficient \(\beta\), the event-time factor is $$ L_1(\beta)=\frac{\exp(\beta)}{\exp(\beta)+1+\exp(\beta)} =\frac{\exp(\beta)}{1+2\exp(\beta)}. $$

For a numerical check, set \(\beta=\log(2)\), so an exposed subject has relative weight \(\exp(\beta)=2\), while an unexposed subject has weight 1. Then $$ L_1\{\log(2)\}=\frac{2}{2+1+2}=\frac{2}{5}=0.400. $$ The factor is the modeled conditional probability that subject 1 is the event subject, given one event in this risk set at this time. It is not the probability that subject 1 experiences any event over the full follow-up.

Worked Example: Four Event Contributions From Recurrent Histories

Consider hypothetical subjects A, B, C, and D, all initially under observation. Their fixed binary covariates are \(X_A=X_C=1\) and \(X_B=X_D=0\). Events occur for A at time 2, B at time 4, A again at time 5, and C at time 7. D is censored at time 6; no one leaves observation earlier. Thus all four are at risk at the first three event times, while A, B, and C are at risk at time 7.

Write \(w=\exp(\beta)\). The four factors, in event-time order, are $$ \frac{w}{2w+2},\qquad \frac{1}{2w+2},\qquad \frac{w}{2w+2},\qquad \frac{w}{2w+1}. $$ The numerator in the third factor again belongs to A: the event at time 5 is a second event for that subject. The partial likelihood is $$ L_p(\beta)=\frac{w^2}{(2w+2)^3(2w+1)}. $$ At \(\beta=\log(2)\), \(w=2\), so $$ L_p\{\log(2)\} =\frac{2\cdot1\cdot2\cdot2}{6\cdot6\cdot6\cdot5} =\frac{8}{1080} =\frac{1}{135}\approx0.007407. $$ Equivalently, the four factors are \(1/3,\ 1/6,\ 1/3,\ 2/5\), whose product is \(1/135\). A’s two events generate two factors, but they share the same subject history and are not two independent subjects.

Score Contributions and the Meaning of Repetition

Taking logarithms turns the product into a sum. For the no-ties model, the partial log likelihood and its score are

$$ \ell_p(\beta)=\sum_{j=1}^D\left[ \beta^\top X_{i_j}(t_j)- \log\left\{\sum_{k\in R(t_j)}\exp(\beta^\top X_k(t_j))\right\} \right], $$
$$ U(\beta)=\frac{\partial\ell_p(\beta)}{\partial\beta} =\sum_{j=1}^D\left[ X_{i_j}(t_j)- \frac{\sum_{k\in R(t_j)}X_k(t_j)\exp\{\beta^\top X_k(t_j)\}} {\sum_{k\in R(t_j)}\exp\{\beta^\top X_k(t_j)\}} \right]. $$

Each score term is the observed event subject’s covariate vector minus a risk-set-weighted average. Repeated events from one subject can therefore affect several score terms, and the subject can also appear in the denominators of multiple terms. Those shared appearances are one reason event-level contributions should not be treated as independent observations.

Worked Example: A Recurrent Subject’s Score Contributions

Use the four-subject example above and evaluate the scalar score at \(\beta=0\). Every subject then has weight 1. At times 2, 4, and 5, the risk set has two exposed and two unexposed subjects, so its average covariate is \(2/4=1/2\). At time 7, there are two exposed subjects (A and C) and one unexposed subject (B), so the average is \(2/3\). The observed event covariates are \(1,0,1,1\), with sum 3. Thus $$ U(0)=3-\left(\frac12+\frac12+\frac12+\frac23\right) =3-\frac{13}{6} =\frac{5}{6}\approx0.8333. $$ The score is positive at zero for this hypothetical data set. This is an arithmetic description of the partial-likelihood score, not an estimate or inferential conclusion about a real study. A’s two observed events contribute twice to the observed-covariate sum, while their risk-set averages also depend on the same subject A.

Dependence can also arise from persistent unobserved differences between subjects. For example, suppose a subject has an unobserved event-rate multiplier \(U\), and counts in two intervals are conditionally independent Poisson variables given \(U\), with conditional means \(U\mu_1\) and \(U\mu_2\). Marginally, $$ \operatorname{Cov}(N_1,N_2) =\operatorname{Cov}(E[N_1\mid U],E[N_2\mid U]) =\mu_1\mu_2\operatorname{Var}(U), $$ which is positive when \(U\) varies across subjects and both interval means are positive. Thus conditional independence given a latent multiplier does not imply marginal independence. This example illustrates one mechanism; dependence may also reflect observed history, changing health status, or other shared subject-level features.

Assumptions, Ties, and Diagnostics

The derivation is justified when the stated intensity describes the conditional event rate given the modeled history, the risk set correctly identifies who is at risk, and the covariates used at each event time are available just before that time. The standard simple product also assumes distinct event times and no simultaneous events. The event processes should not have unmodeled common shocks that invalidate the event-identity argument. For conventional model-based likelihood inference, additional assumptions about the joint behavior of subjects are needed; repeated events within a subject do not satisfy an independent-subject interpretation merely because the likelihood is written as a product.

With tied event times, the no-ties derivation does not apply literally: the identity of the first event in an infinitesimal sequence is not observed. Software may use a tie method such as Breslow or Efron, or an exact method where appropriate. These methods handle ties differently; a tie approximation should be identified rather than presented as the exact no-ties likelihood.

Before fitting or interpreting an AG partial likelihood, check whether risk-set membership follows the study’s clock and eligibility rules, whether event times and censoring are recorded consistently, and whether time-varying covariates are measured before the event they help predict. Unexpected risk-set sizes, impossible event ordering, or a subject contributing after study exit are signs that the construction needs correction. A correctly computed partial likelihood cannot repair a wrongly defined risk set.

ApproachWhat is conditioned on or modeledImportant distinction
AG partial likelihoodEvent identity within the current recurrent-event risk setUses an unspecified baseline intensity; a subject can contribute at multiple event times
Full parametric event-time likelihoodEvent and censoring-time distributions under specified distributional formsRequires modeling the baseline or event-time distribution, rather than eliminating it by conditioning
Other recurrent-event model familiesMay change risk-set eligibility, event-order structure, or clock definitionThey can target different conditional comparisons; their risk sets should not be substituted into an AG derivation without justification

The partial likelihood removes the unspecified baseline intensity from the coefficient estimation step, but it does not provide a complete description of the event process. It does not, by itself, establish that event contributions from the same subject are independent, account for every source of unobserved heterogeneity, or make an incorrect risk-set choice harmless. Repeated-event dependence matters especially for uncertainty estimates: treating all event records as independent can understate uncertainty when within-subject association is present. Appropriate subject-level inference is a separate issue.

Common Mistakes and Limitations

  • Wrong reasoning: “There are \(D\) events, so there are \(D\) independent subjects.” Correction: The product has one factor per event time, but a subject may contribute repeatedly and the factors share subject histories and risk sets.
  • Wrong reasoning: “The AG product is just the ordinary first-event Cox likelihood.” Correction: The same conditional event-identity argument motivates the algebra, but AG risk sets can retain subjects after earlier events, so a subject may appear as the event subject more than once.
  • Wrong reasoning: “Any subject with a recorded event belongs in every later denominator.” Correction: Include a subject only when \(Y_i(t)=1\) under the prespecified eligibility, observation, and clock rules.
  • Wrong reasoning: “The no-ties formula is exact even when multiple events share a recorded time.” Correction: Ties require an explicitly chosen tie treatment; the distinct-event-time derivation assumes no ties.

The AG partial likelihood is useful when a common intensity structure across recurrences and the chosen risk-set construction match the scientific question. Its limitations follow from that structure: the baseline intensity is not specified by the partial likelihood, and the model’s conditional comparisons may not represent a desired alternative estimand. The likelihood alone does not settle whether the intensity model or dependence assumptions are scientifically adequate.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. At an event time, three subjects have covariates \(0,1,1\), and the second subject has the event. Write the partial-likelihood factor using \(\beta\).
  2. In a recurrent-event study, subject A has events at two distinct times and remains at risk between them. How many event-time factors have A as the event subject, and does that make the factors independent?
  3. For a risk set with covariates \(0,0,1\), calculate the event factor for the exposed subject at \(\beta=0\).
  4. Why does the common baseline intensity disappear from the no-ties event-time factor?
  5. What must be reconsidered when two or more subjects have events recorded at the same time?

Solutions. (1) The factor is \(\exp(\beta)/\{1+2\exp(\beta)\}\), since the event subject has covariate 1 and the risk-set weights are \(1,\exp(\beta),\exp(\beta)\). (2) A is the event subject in two factors. The repeated appearances do not establish independence; both contributions come from the same subject’s history. (3) At \(\beta=0\), all three weights equal 1, so the exposed subject’s factor is \(1/(1+1+1)=1/3\). (4) Each subject’s intensity contains the same \(\lambda_0(t)\), so it appears in both the event subject’s intensity and the sum over the risk set and cancels in their ratio. (5) The distinct-event-time derivation no longer applies directly; use and report an appropriate tie method rather than treating the no-ties factor as exact.

Clinical Biostats