Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › A Subject Likelihood With an Observed Event

The Basic Joint Model · Tutorial 153 of 697

A Subject Likelihood With an Observed Event

Learn to calculate and interpret a subject’s conditional likelihood when repeated marker values and an observed event time are available.

Advanced 10 min read

What You'll Learn

  • Write the longitudinal and event-time contributions to a subject’s conditional likelihood.
  • Calculate marker densities from residuals under a specified random-effects value.
  • Obtain an observed-event contribution from the hazard and cumulative hazard.
  • Multiply the contributions while tracking their units and assumptions.
  • Distinguish a conditional likelihood contribution from a likelihood marginalized over random effects.
  • Identify common errors in event-time likelihood calculations.

What an Observed Event Contributes

For a subject with repeated marker measurements and an observed event time, the subject-level likelihood has two sources of information. The measurements describe how well the longitudinal model fits the recorded marker values. The event contribution describes both the occurrence of the event at its observed time and the subject’s remaining event-free up to that time. Both pieces depend on the subject’s random effects when the event hazard is linked to the latent marker trajectory.

This tutorial calculates that likelihood conditional on specified random effects. The random effects are held fixed during the calculation. In a full joint likelihood, the conditional contribution is combined with the random-effects distribution and integrated over the random effects; that integration is not part of the numerical calculations below.

Definition: Suppose subject \(i\) has marker measurements \(Y_{ij}\) at times \(t_{ij}\), and an event is observed at time \(T_i\). Conditional on random effects \(b_i\) and covariates, the subject’s likelihood contribution is the product of the conditional density of the observed marker measurements and the conditional density of the observed event time, provided the marker-measurement errors and event process are conditionally independent given the modeled trajectory and covariates.

Model and Assumptions

Use a linear mixed model for the marker and a proportional-hazards model linked to its latent, error-free trajectory:

$$ Y_{ij}=m_i(t_{ij})+\varepsilon_{ij}, \qquad m_i(t)=\beta_0+\beta_1t+b_{0i}+b_{1i}t, $$
$$ \varepsilon_{ij}\mid b_i \sim N(0,\sigma^2), \qquad h_i(t\mid b_i)=h_0(t)\exp\{\gamma^\mathsf{T}w_i+\alpha m_i(t)\}. $$

Here \(m_i(t)\) is the latent marker value, \(b_i=(b_{0i},b_{1i})\) is the subject’s random intercept and slope, \(w_i\) is a vector of covariates, \(h_0(t)\) is the baseline hazard, and \(\alpha\) is the association parameter. For the calculation, assume the random effects and model parameters are specified. Conditional on those random effects, the marker errors are independent with the stated normal distribution. Assume the event time is observed exactly, the subject is at risk from time zero, and the event hazard is the stated hazard. The measurement schedule is treated as fixed or noninformative under the model. There is no censoring or competing event in this calculation.

Define the cumulative hazard through time \(T_i\) as \(H_i(T_i\mid b_i)=\int_0^{T_i} h_i(u\mid b_i)\,du\). Conditional survival to time \(T_i\) is \(\exp\{-H_i(T_i\mid b_i)\}\). Therefore, the event-time density at an observed event time is the hazard at that time multiplied by survival to that time:

$$ f_i(T_i\mid b_i) =h_i(T_i\mid b_i)\exp\{-H_i(T_i\mid b_i)\}. $$

If the observed marker values are conditionally independent given the random effects and the event process, their conditional joint density is the product of their normal densities. The resulting subject likelihood is

$$ L_i(b_i) = \left[ \prod_{j=1}^{n_i} \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left\{-\frac{(Y_{ij}-m_i(t_{ij}))^2}{2\sigma^2}\right\} \right] h_i(T_i\mid b_i)\exp\{-H_i(T_i\mid b_i)\}. $$

A marker recorded exactly at \(T_i\) contributes a measurement density too, if it is included under the assumed measurement schedule. Its measurement error is still distinct from the event-time contribution: the hazard uses the latent marker value, not the noisy recorded value.

Why the Event Term Has This Form

Let \(S_i(t\mid b_i)\) be the conditional probability of remaining event-free beyond time \(t\). A hazard is the instantaneous event rate among subjects still at risk. It follows that \(S_i(t\mid b_i)=\exp\{-H_i(t\mid b_i)\}\), where \(H_i\) is the integrated hazard. Differentiating survival gives the event-time density:

$$ \begin{aligned} f_i(t\mid b_i) &=-\frac{d}{dt}S_i(t\mid b_i)\\ &=-\frac{d}{dt}\exp\{-H_i(t\mid b_i)\}\\ &=h_i(t\mid b_i)\exp\{-H_i(t\mid b_i)\}. \end{aligned} $$

Thus the hazard at the event time alone is not the event contribution. It accounts for the local event rate at that time, but not the requirement that the subject remained event-free earlier in follow-up. The survival factor supplies that requirement.

Worked Example: Repeated Measurements and a Time-Varying Hazard

Consider a hypothetical subject with measurements \(Y_{i1}=1.0\) at \(t_{i1}=0\) years and \(Y_{i2}=1.6\) at \(t_{i2}=1\) year. An event is observed at \(T_i=2\) years. Take \(\beta_0=1\), \(\beta_1=0.2\) marker units per year, \(b_{0i}=0.2\) marker units, \(b_{1i}=0.1\) marker units per year, and \(\sigma=0.5\) marker units. Let \(w_i=0\), \(h_0(t)=0.1\) per year, and \(\alpha=\log(2)\) per marker unit.

First calculate the conditional latent marker values. The trajectory is \(m_i(t)=1.2+0.3t\). At the two measurement times, the fitted means are \(1.2\) and \(1.5\). The residuals are \(1.0-1.2=-0.2\) and \(1.6-1.5=0.1\). Hence the longitudinal contribution is

$$ \begin{aligned} L_{Y,i}(b_i) &=\frac{1}{0.5\sqrt{2\pi}} \exp\left\{-\frac{(-0.2)^2}{2(0.5)^2}\right\} \frac{1}{0.5\sqrt{2\pi}} \exp\left\{-\frac{(0.1)^2}{2(0.5)^2}\right\}\\ &=\frac{1}{2\pi(0.5)^2}\exp(-0.10)\\ &\approx 0.5760\ \text{(marker units)}^{-2}. \end{aligned} $$

The hazard along this trajectory is \(0.1\exp\{(\log 2)(1.2+0.3t)\}\) per year. At the event time, \(m_i(2)=1.8\), so

$$ h_i(2\mid b_i)=0.1\,2^{1.8}\approx 0.3482\ \text{per year}. $$

Integrating the hazard from zero to two years gives

$$ \begin{aligned} H_i(2\mid b_i) &=0.1\,2^{1.2}\int_0^2 \exp\{0.3(\log 2)u\}\,du\\ &=0.1\,2^{1.2} \frac{\exp\{0.6\log 2\}-1}{0.3\log 2}\\ &\approx 0.5699. \end{aligned} $$

The event-time density is \(0.3482\exp(-0.5699)\approx0.1969\) per year. Multiplying the two components, the conditional subject likelihood is approximately \(0.5760(0.1969)=0.1134\) per year per squared marker unit. This is a density contribution, not a probability that the event occurred at exactly two years.

Calculation Sequence and Checks

1
Evaluate the trajectory.
Substitute the specified fixed effects and random effects into \(m_i(t)\), at each measurement time and throughout the event-time integration.
2
Calculate the marker density.
For each recorded value, form its residual from \(m_i(t_{ij})\), evaluate its normal density, and multiply the densities.
3
Calculate the event density.
Evaluate the hazard at \(T_i\), integrate the hazard over the full at-risk period, and multiply the hazard by \(\exp\{-H_i(T_i\mid b_i)\}\).
4
Form the conditional contribution.
Multiply the longitudinal density by the observed-event density. Keep track of marker and time units, and check that the integration covers the subject’s stated risk period.

Useful checks include confirming that the hazard is nonnegative, the cumulative hazard is nonnegative, and the survival factor lies between zero and one. With a time-varying marker, the hazard generally varies over follow-up, so evaluating the hazard at \(T_i\) and multiplying by \(T_i\) is not generally a valid way to calculate the cumulative hazard. Likelihood densities can exceed one; that is not by itself an error.

Worked Example: A Constant Latent Marker

For a second hypothetical subject, suppose the latent marker is \(m_i(t)=1.5\) marker units throughout follow-up, \(\sigma=0.2\) marker units, and the three measurements at years 0, 1, and 2 are 1.4, 1.6, and 1.5. The event is observed at year 3. Let \(h_0(t)=0.08\) per year, \(\alpha=\log(2)\) per marker unit, and \(w_i=0\). The three residuals are \(-0.1\), \(0.1\), and \(0\), so

$$ \begin{aligned} L_{Y,i}(b_i) &=\left(\frac{1}{0.2\sqrt{2\pi}}\right)^3 \exp\left\{-\frac{0.01+0.01+0}{2(0.2)^2}\right\}\\ &=\left(\frac{1}{0.2\sqrt{2\pi}}\right)^3\exp(-0.25)\\ &\approx 6.181\ \text{(marker units)}^{-3}. \end{aligned} $$

The hazard is constant over time in this example because the latent marker is constant. Its value is \(0.08\exp\{(\log 2)(1.5)\}=0.2263\) per year, and its cumulative value over three years is \(3(0.2263)=0.6788\). Therefore,

$$ f_i(3\mid b_i)=0.2263\exp(-0.6788)\approx0.1148\ \text{per year}. $$

The conditional subject likelihood is \(6.181(0.1148)\approx0.7096\) per year per cubed marker unit. The marker density is greater than one, which is possible for a continuous density; it does not imply a probability greater than one.

Conditional Contribution Versus Marginal Likelihood

The calculations so far condition on a specified \(b_i\). That conditional likelihood is one value of the integrand used to form the observed-data likelihood. If the random effects have density \(g(b_i)\), the marginal subject contribution is obtained by averaging over their possible values:

$$ L_i=\int L_i(b_i)g(b_i)\,db_i. $$

The conditional contribution at a chosen random-effects value is not, by itself, this integral. In particular, a value selected because it fits the subject’s measurements well does not replace integration over the random-effects distribution. The distinction matters because both the marker density and the event-time density can change with \(b_i\).

Worked Example: Comparing Two Specified Random-Effects Values

Return to the measurements and event time in the first example, with all model parameters unchanged. Compare the original random effects \(b_{0i}=0.2,\ b_{1i}=0.1\) with the alternative specified values \(b_{0i}=0,\ b_{1i}=0.1\). Under the alternative, \(m_i(t)=1+0.3t\). The measurement residuals are now \(0\) and \(0.3\), giving

$$ L_{Y,i}(b_i) =\frac{1}{2\pi(0.5)^2} \exp\left\{-\frac{0^2+0.3^2}{2(0.5)^2}\right\} =0.6366\exp(-0.18) \approx0.5318\ \text{(marker units)}^{-2}. $$

At year 2 the alternative trajectory has \(m_i(2)=1.6\), so \(h_i(2\mid b_i)=0.1\,2^{1.6}\approx0.3031\) per year. Its cumulative hazard is

$$ H_i(2\mid b_i) =0.1(2^1)\frac{\exp\{0.6\log 2\}-1}{0.3\log 2} \approx0.4960. $$

The event density is \(0.3031\exp(-0.4960)\approx0.1846\) per year, and the conditional subject contribution is \(0.5318(0.1846)\approx0.0982\) per year per squared marker unit. This is smaller than the approximately \(0.1134\) contribution at the first specified random-effects value. It is a comparison of conditional likelihood values, not a comparison of probabilities that either random-effects value is true, and it is not the marginal likelihood.

Common Mistakes and Limitations

  • Using only the hazard at the event time. The event density is \(h_i(T_i\mid b_i)\exp\{-H_i(T_i\mid b_i)\}\), not just \(h_i(T_i\mid b_i)\). Omitting survival ignores the time the subject remained event-free.
  • Using the noisy marker value in the hazard. In this model the hazard depends on \(m_i(t)\), the latent trajectory conditional on random effects, rather than on \(Y_{ij}\), which also contains measurement error.
  • Treating an event-time density as a point probability. For a continuous event time, the density has units of inverse time; the probability of an event at exactly one specified instant is zero.
  • Assuming a constant hazard when the latent marker changes. A time-varying \(m_i(t)\) generally makes \(h_i(t\mid b_i)\) time-varying, so the cumulative hazard must be integrated over time.

The result relies on the stated model for the marker and event process and on the conditional independence assumption used to multiply their contributions. If the observation schedule is informative in a way not represented by the model, or if the hazard or marker distribution is misspecified, this likelihood may not adequately describe the data. The calculation also assumes exact event times and complete observation from time zero; other observation patterns require their own likelihood contributions.

Check Your Understanding

Try each question, then check the solutions below.

  1. For an observed event at \(T_i\), write the event-time density contribution in terms of the hazard and cumulative hazard.
  2. A subject has a constant conditional hazard of \(0.2\) per year and an observed event at year 2. Calculate the event-time density contribution.
  3. Why is the hazard at the observed event time not, by itself, the event-time likelihood contribution?
  4. If the specified random effects change, which parts of the conditional subject likelihood can change in the shared-marker model used here?

Solutions. (1) The contribution is \(h_i(T_i\mid b_i)\exp\{-H_i(T_i\mid b_i)\}\). (2) The cumulative hazard is \(0.2(2)=0.4\), so the density is \(0.2\exp(-0.4)\approx0.1341\) per year. (3) The hazard gives the instantaneous event rate at that time but omits survival up to that time; the exponential cumulative-hazard factor accounts for remaining event-free beforehand. (4) The random effects can change the fitted latent marker values and thus both the longitudinal measurement density and the event hazard and cumulative hazard; consequently, both likelihood factors can change.

Clinical Biostats