Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Andersen-Gill Intensities in Joint Models

Competing Risks and Recurrent Events · Tutorial 430 of 697

Andersen-Gill Intensities in Joint Models

Learn to specify, calculate, and diagnose a longitudinal joint model with an Andersen-Gill recurrent-event intensity and a terminal event.

Advanced 12 min read

What You'll Learn

  • Define the Andersen-Gill counting process and total-time at-risk indicator.
  • Specify a recurrent-event intensity linked to a latent longitudinal trajectory.
  • Interpret the shared biomarker association parameter on the hazard scale.
  • Construct the recurrent-event likelihood contribution from event times and at-risk exposure.
  • Account for terminal events as the endpoint of recurrent-event risk and as an event outcome.
  • Recognize assumptions, diagnostics, and limitations of the Andersen-Gill formulation.

Why an Andersen-Gill Intensity in a Joint Model?

A participant may experience several nonfatal events, such as repeated exacerbations or hospitalizations, before a terminal event ends the possibility of further recurrence. An Andersen-Gill (AG) model represents those recurrent events with a counting process indexed by calendar time from a common origin. In a joint model, its event intensity can depend on the participant’s latent longitudinal trajectory, while a terminal-event model describes the risk of the event that ends recurrent follow-up.

The key bookkeeping is the at-risk process. A participant contributes recurrent-event exposure only while under observation and still capable of having the event. Each recurrent event increments the count, but does not by itself reset the time scale or remove the participant from risk. A terminal event does remove the participant from recurrent-event risk.

The model below uses a latent trajectory \(m_i(t)\) to connect the longitudinal and recurrent-event processes. This is a joint-model association: it describes how the model’s latent biomarker trajectory is related to event intensity, not a causal effect of changing the biomarker.

Definition: For participant \(i\), let \(N_i^R(t)\) be the number of recurrent events observed by time \(t\). Its increment \(dN_i^R(t)\) is 1 at a recurrent event time and 0 otherwise. Let \(Y_i^R(t)\) be 1 when participant \(i\) is under observation and at risk for recurrence just before \(t\), and 0 otherwise. The Andersen-Gill recurrent-event intensity \(\lambda_i^R(t)\) is the instantaneous event rate conditional on the observed history just before \(t\) and the model’s covariates or latent effects: \(E[dN_i^R(t)\mid\mathcal F_{i,t-}]=Y_i^R(t)\lambda_i^R(t)\,dt+o(dt)\).

Model Specification and Assumptions

For a common longitudinal submodel, measurements \(y_{ij}\) at times \(t_{ij}\) satisfy \(y_{ij}=m_i(t_{ij})+\epsilon_{ij}\), where \(m_i(t)=X_i^L(t)^\top\beta_L+Z_i^L(t)^\top b_i\) and \(b_i\sim N(0,D)\). Here \(X_i^L(t)\) and \(Z_i^L(t)\) are design vectors, \(\beta_L\) is a vector of fixed effects, and \(b_i\) is a participant-specific random-effect vector. A standard measurement model assumes \(\epsilon_{ij}\sim N(0,\sigma^2)\), independent across measurements conditional on \(b_i\). Other longitudinal specifications are possible; the essential point here is that \(m_i(t)\) is the latent trajectory used in the event model, rather than the noisy observed measurement at a particular visit.

With total time as the time scale, one AG joint-model specification is

$$ \lambda_i^R(t\mid b_i,\mathcal F_{i,t-}) = Y_i^R(t)\lambda_0^R(t) \exp\!\left\{X_i^R(t)^\top\beta_R+\alpha m_i(t)\right\}. $$

Here \(\lambda_0^R(t)\) is the recurrent-event baseline intensity, \(X_i^R(t)\) contains observed covariates, \(\beta_R\) is their coefficient vector, and \(\alpha\) is the shared biomarker association parameter. The conditional rate is zero when \(Y_i^R(t)=0\). For two participants with the same covariates and at risk at time \(t\), a one-unit difference in \(m_i(t)\) corresponds to an intensity ratio of \(\exp(\alpha)\), holding the other terms fixed. The units of \(m_i(t)\) determine what “one unit” means.

Let \(T_i\) be the terminal-event time and \(C_i\) the censoring time. The observed endpoint is \(\widetilde T_i=\min(T_i,C_i)\), and \(\delta_i=1\) if the terminal event is observed and 0 if follow-up is censored first. If \(L_i\) is the entry time, a typical recurrent-event risk indicator is

$$ Y_i^R(t)=I(L_i<t\leq \widetilde T_i),\qquad Y_i^D(t)=I(L_i<t\leq \widetilde T_i). $$

The terminal-event indicator is denoted \(Y_i^D(t)\); the terminal hazard while at risk might be specified as

$$ \lambda_i^D(t\mid b_i) = Y_i^D(t)\lambda_0^D(t) \exp\!\left\{X_i^D(t)^\top\beta_D+\eta m_i(t)+\zeta^\top b_i\right\}. $$

The terminal model may share the latent trajectory or random effects with the recurrent model. The particular shared terms should be specified before fitting. The notation above allows both a trajectory association and additional shared random effects; it does not require every application to include both. A recurrent event at exactly the terminal time has probability zero under continuous event-time models, so the endpoint convention does not affect the usual likelihood.

The interpretation of the joint model relies on assumptions. The intensity must correctly describe recurrent-event rates conditional on the stated history, covariates, and latent effects. The latent trajectory and its distribution must be adequately specified. The recurrent and terminal processes may be dependent marginally, but their dependence must be represented by the included shared latent terms and any specified history dependence; the processes are conditionally modeled given those terms. Censoring is assumed noninformative conditional on the modeled information, unless a censoring model is added. These assumptions are substantive and should not be inferred merely because a model converges.

Worked Example: Interpreting a Shared Trajectory Association

Suppose a hypothetical model has recurrent-event baseline intensity \(0.08\) events per person-year at a particular time. At that time, a participant has a covariate value \(x_i=1\) with coefficient \(0.30\), latent biomarker value \(m_i(t)=5.2\) units, and the biomarker is centered at 4 units in the event model. Let \(\alpha=0.25\) per biomarker unit. Assume the participant is at risk, so \(Y_i^R(t)=1\).

The intensity is

$$ \lambda_i^R(t) =0.08\exp\{0.30(1)+0.25(5.2-4)\} =0.08\exp(0.60) =0.1458 $$

Thus the model-implied instantaneous recurrent-event rate at that time is \(0.1458\) events per person-year, conditional on the stated covariate and latent trajectory. The association for a one-unit higher latent biomarker value, holding other terms fixed, is \(\exp(0.25)=1.284\): a 28.4% higher modeled intensity. This is an association under the model, not evidence that intervening to change the biomarker would change recurrence risk.

Risk Time and the Recurrent-Event Likelihood

Under the AG formulation, the time scale continues from the common origin after each recurrent event. If a participant remains under observation and has not had the terminal event, the participant remains at risk after a recurrence. The event count increases, but the time origin does not restart. This is distinct from defining a new clock after each event; the AG model uses total time.

Conditional on the latent effects and covariates, the recurrent-process likelihood contribution through the observed endpoint is

$$ L_i^R(b_i) = \left\{\prod_{k=1}^{n_i^R} \lambda_i^R(t_{ik}\mid b_i,\mathcal F_{i,t_{ik}-})\right\} \exp\!\left\{-\int_{L_i}^{\widetilde T_i} Y_i^R(t)\lambda_i^R(t\mid b_i,\mathcal F_{i,t-})\,dt\right\}. $$

Here \(t_{ik}\) is the time of recurrent event \(k\), and \(n_i^R\) is the observed number of recurrent events. The product supplies the intensity at each observed event time; the exponential is the probability contribution associated with having no additional recurrent event over the observed at-risk time, given the intensity. The integral is often called the cumulative intensity or compensator.

The terminal-event contribution is

$$ L_i^D(b_i) = \{\lambda_i^D(\widetilde T_i\mid b_i)\}^{\delta_i} \exp\!\left\{-\int_{L_i}^{\widetilde T_i}\lambda_i^D(t\mid b_i)\,dt\right\}. $$

When \(\delta_i=1\), the terminal hazard at the observed event time contributes. When \(\delta_i=0\), that hazard factor is absent, but the participant’s terminal-event survival contribution through censoring remains. With a longitudinal density \(L_i^L(b_i)\) and a random-effects density \(f(b_i)\), a conditional-independence joint likelihood has participant contribution

$$ L_i=\int L_i^L(b_i)L_i^R(b_i)L_i^D(b_i)f(b_i)\,db_i. $$

This integration is essential: the random effects are unobserved, so the likelihood for the observed data averages the conditional contributions over their distribution. The factorization is appropriate only when the specified conditional model supports it. In particular, dependence not represented by the shared latent effects or the stated event history can invalidate that factorization.

Justification of the event-process contribution: Over a short interval of length \(dt\) while at risk, the conditional probability of one event is \(\lambda_i^R(t)\,dt+o(dt)\), and the probability of no event is \(1-\lambda_i^R(t)\,dt+o(dt)\). Multiplying event contributions at observed event times and no-event contributions over the remaining at-risk time gives the product of intensities times the exponential of minus the integrated intensity. The terminal time truncates this exposure: after \(\widetilde T_i\), \(Y_i^R(t)=0\), so no recurrent-event exposure is accumulated.

Worked Example: Calculating an AG Recurrent Contribution

Consider hypothetical follow-up from time 0 to a terminal event at time 3 years. The participant has recurrent events at 0.8 and 2.1 years and remains at risk throughout \((0,3]\). Suppose the fitted recurrent intensity is \(0.12\) events per year from time 0 to 1.5 years and \(0.18\) events per year from 1.5 to 3 years. These rates are treated as fixed within their intervals for this calculation.

The two observed event-time intensities are \(0.12\) and \(0.18\). The cumulative intensity is

$$ \int_0^3 Y_i^R(t)\lambda_i^R(t)\,dt =(0.12)(1.5)+(0.18)(1.5)=0.18+0.27=0.45. $$

Therefore the recurrent-event likelihood contribution is

$$ L_i^R=(0.12)(0.18)\exp(-0.45) =0.0216(0.6376) =0.01377. $$

This is a likelihood contribution in the units induced by two event-time intensities; it is not itself a probability. Notice that the second event does not restart the total-time clock. Exposure continues from 0 to 3 years, with the intensity changing at 1.5 years as specified.

Handling the Terminal Event

A terminal event is not merely another recurrent event, nor is time after it ordinary censoring time. It ends the participant’s opportunity to experience the recurrent event. The recurrent intensity is therefore multiplied by an at-risk indicator that becomes zero at the terminal time. The terminal event also has its own likelihood contribution when observed. This distinction matters even when the terminal time is treated as a censoring endpoint in a recurrent-event analysis: the participant’s recurrence exposure ends there, but a joint model can additionally use the terminal outcome and its dependence on the latent trajectory.

Worked Example: Terminal Event Versus Censoring

Suppose a hypothetical participant has a constant terminal hazard of \(0.20\) per year while at risk, and the observed endpoint is at 3 years. If a terminal event occurs at 3 years, \(\delta_i=1\), and the terminal likelihood contribution is

$$ L_i^D=(0.20)^1\exp\{-(0.20)(3)\} =0.20\exp(-0.60) =0.1098. $$

If instead the participant is censored at 3 years without a terminal event, \(\delta_i=0\), the contribution is

$$ L_i^D=\exp\{-(0.20)(3)\}=\exp(-0.60)=0.5488. $$

In both cases, recurrent-event exposure stops at year 3. If a recurrent intensity were \(0.10\) per year, the no-event exponential factor over that exposure would be \(\exp\{-(0.10)(3)\}=\exp(-0.30)\). Extending it to year 4 would incorrectly use \(\exp(-0.40)\), because the participant contributes no recurrent-event risk after the observed endpoint. The terminal-event likelihood distinguishes an observed terminal event from censoring; the recurrent at-risk process defines the exposure window in either case.

Diagnostics, Alternatives, and Limitations

Several checks help assess whether the AG joint model is a reasonable representation. Confirm from event histories that the risk indicator switches on at entry, remains on after each recurrence, and switches off at terminal event or censoring. Check that event times lie within the recorded risk intervals and that the longitudinal time scale and event time scale align as intended. Inspect estimated baseline intensity and association parameters for implausible values, large standard errors, or sensitivity to reasonable changes in the longitudinal and event submodels. Sparse events or weak variation in latent trajectories can make the shared association difficult to estimate.

A fitted intensity should also be assessed against observed recurrent-event patterns over time and across relevant covariates. For example, compare observed and model-predicted event counts over intervals in which participants are at risk, rather than comparing raw counts without accounting for differing follow-up. If residual patterns or event rates after an event differ systematically from the model’s predictions, the specified conditional intensity may be inadequate. Convergence alone is not evidence of a good fit.

The AG formulation is useful when a common total-time intensity is scientifically appropriate and recurrent events do not require a different baseline hazard solely because they are first, second, or later events. An event-order-specific formulation allows the baseline recurrence hazard to vary by event order; a gap-time formulation uses time since the preceding event. Those alternatives answer different modeling questions and should not be substituted without considering the time scale and interpretation. A conventional first-event survival analysis discards later recurrent events, while separate longitudinal and recurrent/terminal analyses do not directly account for dependence induced by shared latent effects.

The AG model does not automatically capture every kind of within-person event dependence. A shared trajectory can induce association between recurrence and terminal risk, but it does not guarantee that all dependence among recurrent events is represented. If event history has a direct effect on subsequent intensity, that history dependence needs to be specified. Inference can also be sensitive to the latent trajectory form, the assumed random-effects distribution, and the censoring assumption. The association parameter is conditional on the model; it is not a causal effect, and a conditional intensity ratio should not be interpreted as a marginal cumulative risk ratio.

Common pitfall: “The participant had a recurrence, so the AG clock should restart, and after death I can keep their follow-up as censored time.” Both parts are incorrect for the total-time AG specification. A recurrence increments \(N_i^R(t)\) but does not reset the common time origin; a terminal event turns \(Y_i^R(t)\) off, so no recurrent exposure accumulates afterward. The model’s risk indicator and time scale must match the scientific question.

Check Your Understanding

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

  1. A participant has recurrent events at 1 and 2 years, followed by censoring at 4 years. Under a total-time AG model, when does the risk clock restart after the first event?
  2. If \(\alpha=0.40\), what is the conditional intensity ratio for a one-unit increase in the latent biomarker trajectory, holding other modeled terms fixed?
  3. A terminal event occurs at year 5. What recurrent-event exposure is contributed after year 5?
  4. Give one assumption needed to interpret the shared trajectory association in the joint model.
  5. Why is the product of conditional likelihood contributions integrated over the random-effects distribution?

Solutions. (1) It does not restart; time remains measured from the common origin, and each recurrence increments the counting process while the participant remains at risk. (2) The ratio is \(\exp(0.40)=1.492\), or about 49.2% higher conditional intensity per one-unit increase. (3) None: the at-risk indicator is zero after the terminal event. (4) For example, the latent trajectory and its random-effects distribution must be adequately specified, and the recurrent intensity must be correct conditional on the modeled history and latent terms. (5) The random effects are unobserved; integration averages the conditional longitudinal, recurrent, and terminal contributions over their assumed distribution to obtain a likelihood for observed data.

Clinical Biostats