Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Comparing Patients With Different Marker Histories

Dynamic Prediction · Tutorial 545 of 697

Comparing Patients With Different Marker Histories

You will learn to separate the effects of biomarker history and event-free survival when calculating and interpreting patient-specific conditional risks.

Advanced 11 min read

What You'll Learn

  • Write conditional risk over a future horizon given survival to a landmark.
  • Explain how longitudinal measurements and event-free follow-up update a patient’s latent-marker distribution.
  • Compare predicted risks when patients share baseline covariates but have different biomarker histories.
  • Calculate conditional risk under a finite-mixture marker model and a linear marker trajectory.
  • Identify when plug-in predictions differ from predictions that integrate over latent-marker and parameter uncertainty.
  • Diagnose common errors in comparing patient-specific risks.

Why Patient Histories Matter

Two patients can have the same baseline covariates and still have different predicted risks at the same prediction time. Their repeated biomarker measurements may imply different latent marker levels or trajectories. In addition, being event-free through the prediction time is information: among patients with different latent risks, those who remain event-free may have a different distribution of latent marker values than they had earlier.

The comparison in this tutorial is a comparison of conditional predictions. Each prediction concerns the risk of an event in a future horizon, given that the patient has survived without the event to a specified landmark and given the information available by that landmark. It is not a comparison of marginal survival from baseline.

Conditional Risk in a Joint Model

Suppose the event hazard for patient \(i\), conditional on model parameters \(\theta\) and latent patient effects \(b_i\), is

$$ h_i(t\mid b_i,\theta) = h_0(t;\theta) \exp\{\gamma^\top x_i+\alpha m_i(t;b_i,\theta)\}. $$

Here \(x_i\) is the baseline covariate vector, \(m_i(t;b_i,\theta)\) is the latent biomarker trajectory, and \(\alpha\) describes how the latent marker is associated with the event hazard. The longitudinal measurement model links observed biomarker values to \(m_i(t)\); for example, \(Y_{ij}=m_i(t_{ij})+\epsilon_{ij}\), with measurement errors independent of the event process conditional on the latent effects and model parameters. The event hazard and measurement model must be fitted under their stated distributional and independence assumptions. In particular, the marker values used in the hazard are latent values, not error-free observed measurements.

Let \(T_i\) be the event time, \(s\) the landmark, and \(w>0\) the prediction horizon. The target is the probability of an event by \(s+w\), conditional on survival to \(s\) and the patient’s observed marker history through \(s\).

Definition: The dynamic conditional risk for patient \(i\) at landmark \(s\) over horizon \(w\) is $$ R_i(s,w) = P(T_i\le s+w\mid T_i>s,\mathcal H_i(s),x_i,\mathcal D), $$ where \(\mathcal H_i(s)\) is the patient’s observed longitudinal history through \(s\), and \(\mathcal D\) denotes the data used to fit the joint model. Under the joint model, $$ R_i(s,w) = 1- E\left[ \exp\left\{-\int_s^{s+w}h_i(u\mid b_i,\theta)\,du\right\} \middle| T_i>s,\mathcal H_i(s),x_i,\mathcal D \right]. $$

The expectation is essential when the latent trajectory or model parameters are uncertain. The conditional distribution inside that expectation uses both the marker observations and the fact that the patient remained event-free through \(s\). If future covariates or marker paths are uncertain and enter the hazard, they must also be integrated over according to the fitted model.

Why Survival to the Landmark Changes the Comparison

Conditional on a particular latent trajectory and parameters, survival through \(s\) has probability

$$ S_i(s\mid b_i,\theta) = \exp\left\{-\int_0^s h_i(u\mid b_i,\theta)\,du\right\}. $$

Thus, up to proportionality, the distribution used for prediction weights each latent trajectory by its longitudinal-data likelihood and by its probability of surviving to the landmark:

$$ p(b_i,\theta\mid \mathcal H_i(s),T_i>s,x_i,\mathcal D) \ \propto\ p(\mathcal H_i(s)\mid b_i,\theta,x_i)\, S_i(s\mid b_i,\theta)\, p(b_i,\theta\mid x_i,\mathcal D). $$

This expression describes the update for a patient conditional on the fitted model and its uncertainty. In a Bayesian analysis, uncertainty in \(\theta\) is represented by its posterior distribution from the fitting data. In a plug-in analysis, \(\theta\) may instead be held at an estimate, but uncertainty in patient-specific latent effects should still be handled if the prediction is intended to reflect it.

The survival factor downweights latent trajectories that would have made survival to \(s\) less likely. It does not mean that survival to \(s\) guarantees a lower future risk: the resulting direction depends on the hazard over the future horizon and on how the latent trajectories relate to it.

Worked Example: Different Marker Histories at the Same Landmark

Worked Example: Different Marker Histories at the Same Landmark

Consider a hypothetical model with identical baseline covariates for patients A and B. The baseline hazard is constant at \(0.02\) per year, and \(h(t)=0.02\exp(0.8m)\), where the latent marker is constant over time. For a transparent finite-mixture calculation, suppose the marker is either low, \(m=1\), or high, \(m=2\). The patients’ different observed histories imply probabilities of a high marker of \(0.20\) for A and \(0.70\) for B, before using their event-free status to update those probabilities. Both patients are event-free at \(s=1\) year. Calculate their risks over the next two years.

The state-specific hazards are

$$ \lambda_L=0.02e^{0.8}=0.04451\text{ per year}, \qquad \lambda_H=0.02e^{1.6}=0.09906\text{ per year}. $$

Survival through the one-year landmark is \(e^{-\lambda_L}\approx0.9565\) in the low state and \(e^{-\lambda_H}\approx0.9057\) in the high state. For A, the updated probability of the high state is

$$ q_A = \frac{0.20(0.9057)} {0.80(0.9565)+0.20(0.9057)} \approx 0.1914. $$

For B, the corresponding calculation is

$$ q_B = \frac{0.70(0.9057)} {0.30(0.9565)+0.70(0.9057)} \approx 0.6884. $$

Over two future years, the state-specific event risks are

$$ r_L=1-e^{-2(0.04451)}\approx0.08517, \qquad r_H=1-e^{-2(0.09906)}\approx0.1797. $$

Averaging over each patient’s updated state probabilities gives

$$ R_A=(1-0.1914)(0.08517)+0.1914(0.1797)\approx0.1033, $$
$$ R_B=(1-0.6884)(0.08517)+0.6884(0.1797)\approx0.1503. $$

Under this hypothetical model, A’s estimated two-year conditional risk is about \(10.33\%\), compared with about \(15.03\%\) for B. The difference reflects their different marker histories and the survival update. It is a model-based association, not evidence that changing a patient’s marker would cause the risk to change by this amount.

Derivation of the Mixture Prediction

For a fixed latent trajectory and parameter value, the event-free probability from \(s\) to \(s+w\) is the exponential of minus the integrated hazard. The conditional event risk is therefore one minus that survival probability. When a patient has a distribution over possible latent states, the predictive survival probability is the average of state-specific survival probabilities, weighted by the state probabilities conditional on the information at \(s\). In the two-state example, this gives

$$ R_i(s,w) = (1-q_i)\{1-e^{-w\lambda_L}\} + q_i\{1-e^{-w\lambda_H}\}, $$

where \(q_i=P(m=2\mid \mathcal H_i(s),T_i>s,x_i,\mathcal D)\). This is an average of risks, equivalently one minus an average of survivals. It is generally not the risk calculated by substituting the average marker or average hazard into the hazard formula, because exponentiation and averaging do not generally commute.

Worked Example: Same Current Marker, Different Trajectories

Worked Example: Same Current Marker, Different Trajectories

Now suppose two hypothetical patients have the same baseline covariates, are event-free at \(s=1\), and have the same latent marker value \(m(1)=1.1\). Their fitted linear marker paths over the next year are \(m_A(1+u)=1.1+0.1u\) and \(m_B(1+u)=1.1+0.4u\), for \(0\le u\le1\). Use the same constant baseline hazard \(0.02\) per year and marker association \(\alpha=0.8\). For this illustration, treat each fitted path and the model parameters as fixed; this is a plug-in calculation, not a full uncertainty-integrated prediction.

For a slope \(b\), the cumulative hazard over the next year is

$$ \Lambda(b) = 0.02e^{0.8(1.1)} \int_0^1 e^{0.8bu}\,du = 0.02e^{0.88}\frac{e^{0.8b}-1}{0.8b}. $$

For patient A, \(b=0.1\), so

$$ \Lambda_A = 0.02e^{0.88}\frac{e^{0.08}-1}{0.08} \approx 0.048218(1.04109) \approx 0.05020. $$

Thus \(R_A=1-e^{-0.05020}\approx0.04896\), or about \(4.896\%\). For patient B, \(b=0.4\), giving

$$ \Lambda_B = 0.02e^{0.88}\frac{e^{0.32}-1}{0.32} \approx 0.048218(1.17852) \approx 0.05683. $$

Thus \(R_B=1-e^{-0.05683}\approx0.05524\), or about \(5.524\%\). The patients have the same marker value at the landmark, but their different fitted future paths produce different plug-in risks. A full dynamic prediction would average over uncertainty in the paths and parameters rather than treating these paths as known.

Worked Example: Longer Event-Free Follow-Up

Worked Example: Longer Event-Free Follow-Up

Return to the two-state constant-hazard model with \(\lambda_L=0.04451\) and \(\lambda_H=0.09906\) per year. Suppose a patient’s marker history gives a high-state probability of \(0.50\) before accounting for event-free follow-up. Compare predictions for the next two years after being event-free for one year versus three years. Keep the baseline hazard constant so the example isolates the effect of survival updating the state probabilities.

After \(s\) years event-free, the high-state probability is

$$ q(s) = \frac{0.50e^{-\lambda_Hs}} {0.50e^{-\lambda_Ls}+0.50e^{-\lambda_Hs}} = \frac{1}{1+e^{(\lambda_H-\lambda_L)s}}. $$

Since \(\lambda_H-\lambda_L\approx0.05455\), this gives \(q(1)\approx0.4864\) and \(q(3)\approx0.4592\). The two-year state-specific risks remain \(r_L\approx0.08517\) and \(r_H\approx0.1797\). Therefore,

$$ R(1,2) = 0.08517+0.4864(0.1797-0.08517) \approx0.1311, $$
$$ R(3,2) = 0.08517+0.4592(0.1797-0.08517) \approx0.1286. $$

In this simplified model, longer event-free follow-up lowers the high-state weight and hence the next-two-year risk. The calculation does not establish that longer follow-up always lowers risk. If the baseline hazard changes with time, or if the marker path evolves, both the future integrated hazards and the updated latent distribution can affect the comparison.

How to Make a Fair Comparison

For patients with identical baseline covariates, a useful comparison holds the landmark and prediction horizon fixed. Then differences in the predictions can be traced to the patients’ observed histories and the resulting conditional distributions of latent effects and parameters. When landmarks differ, the predictions may also differ because the patients have survived for different lengths of time and because the baseline hazard over the future horizon may differ.

A practical comparison should state the prediction target before interpreting the numbers: the landmark, horizon, event definition, conditioning information, and units. For example, “two-year risk conditional on being event-free at year one” is more precise than “risk at year three.” Posterior predictive draws can be used to represent uncertainty in the risk, as in the earlier material on uncertainty intervals for individual risk; the point estimates alone do not express that uncertainty.

Assumptions, Diagnostics, and Alternatives

These predictions rely on the fitted joint model being a reasonable description of the longitudinal and event data. Important assumptions include an adequate longitudinal trajectory and measurement-error model, an adequate event hazard model, and a suitable specification of how the latent marker enters the hazard. The conditional-independence structure must also be appropriate: after conditioning on the modeled latent effects and covariates, the measurement errors and event process must not retain dependence that the model ignores. Censoring assumptions used in fitting must be appropriate as well.

Warning signs include systematic residual patterns in the longitudinal model, poor fit of predicted versus observed event patterns across time, unstable predictions when a small number of biomarker observations are removed, and large differences between plausible trajectory or association specifications. Sparse or irregular marker histories can leave latent slopes weakly determined; in that case, a narrow-looking plug-in prediction may conceal substantial uncertainty.

The main alternative is a plug-in calculation using one estimated latent trajectory and one parameter estimate. It is quick and can be useful for illustrating how a fitted path affects the hazard, as in the second worked example, but it ignores uncertainty and may give overconfident predictions. A prediction that integrates over the patient-specific latent effects and parameter uncertainty is more complete. A simpler survival model that uses only baseline covariates avoids modeling the marker history, but it cannot use the dynamic information that motivates the joint model. These approaches answer different prediction questions and should not be treated as interchangeable.

Common Mistakes and Limitations

  • Ignoring event-free survival to the landmark. Using only the marker-history likelihood can leave the latent-state weights wrong. Include survival to \(s\) when conditioning on \(T_i>s\).
  • Using the observed marker as if it were the latent value. A noisy measurement is evidence about the latent trajectory, not necessarily the trajectory value itself.
  • Comparing different targets. Predictions at different landmarks or over different horizons are not directly comparable without saying how those targets differ.
  • Averaging before applying the hazard. In general, risk at an average marker is not the average of risks over possible marker trajectories.
  • Interpreting a prediction contrast causally. Different histories can be associated with different predicted risks, but the contrast alone does not estimate the effect of intervening to change a biomarker.

Predictions are limited by the model and the information available at the landmark. They do not automatically account for unmeasured predictors, misspecified marker dynamics, or future clinical information not included in the model. A patient’s predicted risk is therefore conditional and model-based, not a guaranteed individual outcome.

Key takeaway: With the same baseline covariates, patients can have different dynamic risks because their biomarker histories imply different latent trajectories. Correct conditional predictions also incorporate event-free survival to the landmark and average over relevant uncertainty.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. Why does survival to the landmark alter the distribution used to calculate a patient’s conditional risk?
  2. Two patients share baseline covariates and have the same marker value at the landmark, but one has a steeper increasing fitted trajectory. Under a positive marker association, what feature can make its plug-in future risk higher?
  3. In the two-state model, why is a mixture prediction not generally obtained by inserting the average marker into the hazard?
  4. What must be held fixed to attribute a risk difference most directly to different marker histories?

Solutions. (1) Survival weights latent trajectories by their probability of remaining event-free through the landmark, changing their conditional distribution. (2) The steeper path can produce a larger integrated future hazard because the marker increases more during the horizon. (3) The hazard and survival involve exponentials, so averaging state-specific risks generally differs from applying the risk formula to an average marker. (4) Use the same landmark, horizon, event definition, and baseline covariates; then state that history and its induced latent-trajectory distribution differ.

Clinical Biostats