Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Subject-Level Likelihood Contributions in Joint Models

Bayesian Joint Models · Tutorial 292 of 697

Subject-Level Likelihood Contributions in Joint Models

Learn to construct and check a subject’s conditional joint likelihood from longitudinal biomarker data and event-time or right-censoring data.

Advanced 11 min read

What You'll Learn

  • Write the longitudinal likelihood conditional on a subject’s shared random effects.
  • Derive event and right-censoring contributions from the conditional hazard and survival function.
  • Combine the two data sources into a subject-level joint likelihood.
  • Check conditional-independence and censoring assumptions behind the factorization.
  • Interpret likelihood contributions with the correct units and identify common calculation errors.

Why Construct a Subject-Level Contribution?

A joint model connects repeated biomarker measurements with an event process, such as time to disease progression or death. The subject-level likelihood contribution makes that connection explicit: it records how well the model accounts for all the observed data from one subject, conditional on that subject’s shared random effects. This conditional contribution is a building block for inference, but it is not by itself the likelihood after accounting for the distribution of the random effects.

The key is to keep three pieces distinct: the longitudinal measurement density, the event-time or censoring contribution, and the assumptions that allow those pieces to be multiplied. The shared random effects link the two outcomes by entering both the biomarker trajectory and the event hazard.

Definition: For subject \(i\), let \(Y_{ij}\) be the biomarker measurement at time \(t_{ij}\), for \(j=1,\ldots,n_i\). Let \(b_i\) be that subject’s shared random-effects vector, and let \(\tilde T_i\) and \(\delta_i\) be the observed event or censoring time and event indicator, respectively. The subject-level conditional joint likelihood contribution is the density of the subject’s observed longitudinal and event data, conditional on \(b_i\) and the model parameters.

Model and Assumptions

Write the longitudinal model’s conditional mean as \(m_i(t\mid b_i)\). For a simple Gaussian specification, suppose \(Y_{ij}=m_i(t_{ij}\mid b_i)+\epsilon_{ij}\), where the errors are conditionally independent and \(\epsilon_{ij}\sim N(0,\sigma^2)\). Conditional independence here means that, given \(b_i\), the covariates, and the model parameters, the measurement errors at the observed times are independent. Other longitudinal models can be used, but their appropriate joint density must replace the Gaussian product below.

Let \(h_i(t\mid b_i)\) be the event hazard conditional on the shared random effects and covariates. Define the cumulative hazard and conditional survival function by \(H_i(t\mid b_i)=\int_0^t h_i(u\mid b_i)\,du\) and \(S_i(t\mid b_i)=\exp\{-H_i(t\mid b_i)\}\). The hazard must be nonnegative and integrable over the time interval of interest.

The usual event-time contribution assumes that, conditional on the random effects and modeled covariates, the event process has the specified hazard. It also assumes that censoring is noninformative for the event-time likelihood: censoring does not add information about the event time after conditioning on the modeled variables. If the censoring process itself is modeled, its likelihood must be handled separately. The standard factorization further assumes that the longitudinal measurements and event process are conditionally independent given the shared random effects and covariates. Their marginal association is then induced through the shared effects.

Definition: Under these assumptions, the longitudinal density is \(L_{Yi}=\prod_{j=1}^{n_i} f_Y(Y_{ij}\mid b_i)\). The event-time or right-censoring contribution is \(L_{Ti}=h_i(\tilde T_i\mid b_i)^{\delta_i}S_i(\tilde T_i\mid b_i)\). Thus the subject-level conditional joint contribution is \(L_i(\theta;b_i)=L_{Yi}L_{Ti}\), where \(\theta\) denotes the model parameters.

The survival factor appears for both observed events and right-censored observations. For an observed event, the continuous event-time density is \(f_i(t\mid b_i)=h_i(t\mid b_i)S_i(t\mid b_i)\). For right censoring at time \(c\), the observation tells us only that the event time exceeds \(c\), which contributes \(P(T_i>c\mid b_i)=S_i(c\mid b_i)\). Combining these cases gives \(h_i(\tilde T_i\mid b_i)^{\delta_i}S_i(\tilde T_i\mid b_i)\).

$$ L_i(\theta;b_i) = \left\{\prod_{j=1}^{n_i}f_Y(Y_{ij}\mid b_i)\right\} h_i(\tilde T_i\mid b_i)^{\delta_i} \exp\{-H_i(\tilde T_i\mid b_i)\}. $$

For conditionally independent Gaussian measurement errors, the longitudinal part becomes \(\prod_j (2\pi\sigma^2)^{-1/2}\exp[-\{Y_{ij}-m_i(t_{ij}\mid b_i)\}^2/(2\sigma^2)]\). A subject with no recorded measurements has no such product contribution (the empty product is 1); this does not remove that subject’s event-time contribution. Conversely, a subject censored before any measurement still contributes survival information.

Worked Examples

Worked Example: Longitudinal Contribution Conditional on Random Effects

Hypothetical data. Suppose \(m_i(t\mid b_i)=1.7+0.5t\), the residual standard deviation is \(\sigma=0.5\) biomarker units, and the subject’s observed measurements are \(1.8,\ 2.4,\ 2.6\) at times \(0,\ 1,\ 2\) years. Treat the subject’s random effects as fixed at the conditional value used in this mean trajectory.

The model-predicted means are \(1.7,\ 2.2,\ 2.7\), so the residuals are \(0.1,\ 0.2,\ -0.1\) biomarker units. Under the stated independent Gaussian-error assumption,

$$ L_{Yi} =(2\pi(0.5)^2)^{-3/2} \exp\left\{-\frac{0.1^2+0.2^2+(-0.1)^2}{2(0.5)^2}\right\}. $$

The sum of squared residuals is \(0.01+0.04+0.01=0.06\). The normalizing factor is \((2\pi(0.25))^{-3/2}\approx0.5079\), and the exponential factor is \(\exp(-0.06/0.5)=\exp(-0.12)\approx0.8869\). Therefore \(L_{Yi}\approx0.4505\) in inverse biomarker cubed units. This is a density, not a probability that the three measurements occurred exactly as recorded.

Worked Example: Event and Right-Censoring Contributions

Hypothetical model. Let the conditional hazard be \(h_i(u\mid b_i)=0.1\exp\{0.3(1.7+0.5u)\}\) per year, for \(0\leq u\leq2\). The constants and trajectory are illustrative. Compute the event contribution for an event at year 2, and the contribution for a subject right-censored at year 2.

At year 2, the value in the hazard’s exponent is \(0.3(1.7+0.5(2))=0.81\). Thus the event-time hazard is \(0.1\exp(0.81)\approx0.2248\) per year. The cumulative hazard is

$$ H_i(2\mid b_i) =0.1\int_0^2\exp\{0.3(1.7+0.5u)\}\,du =0.1\exp(0.51)\frac{\exp(0.3)-1}{0.15} \approx0.3884. $$

Consequently, \(S_i(2\mid b_i)=\exp(-0.3884)\approx0.6781\). For an event at year 2, \(\delta_i=1\), so the contribution is \(h_i(2\mid b_i)S_i(2\mid b_i)\approx0.2248\times0.6781=0.1524\) per year. For right censoring at year 2, \(\delta_i=0\), so the contribution is only \(S_i(2\mid b_i)\approx0.6781\), a dimensionless probability. Both calculations use the same cumulative hazard; the event indicator determines whether the hazard factor is included.

Worked Example: Combining Both Data Sources

Hypothetical data. Use the trajectory and hazard from the preceding example. Suppose two measurements are taken at years 0 and 1, with observed values \(1.9915\) and \(2.4915\), and \(\sigma=0.5\). The predicted means are \(1.7\) and \(2.2\), so each residual is \(0.2915\). Suppose an event occurs at year 2.

The longitudinal likelihood is

$$ L_{Yi} =(2\pi(0.5)^2)^{-1} \exp\left\{-\frac{2(0.2915)^2}{2(0.5)^2}\right\} \approx0.4532. $$

From the preceding calculation, the event contribution is approximately \(0.1524\) per year. Conditional independence of the longitudinal errors and event process given the shared random effects allows the two pieces to be multiplied:

$$ L_i(\theta;b_i) =L_{Yi}L_{Ti} \approx0.4532\times0.1524 \approx0.06907. $$

The result is a joint density for two continuous biomarker measurements and an event time. Its units combine the measurement-density units with inverse years; it is not a probability of the exact observations.

Why the Product Is Justified—and When It Is Not

The factorization follows from the conditional-independence assumption. Let \(\mathbf Y_i\) denote all of subject \(i\)’s observed longitudinal measurements and \(D_i=(\tilde T_i,\delta_i)\) the observed event data. If \(\mathbf Y_i\) and \(D_i\) are conditionally independent given \(b_i\) and covariates, then \(f(\mathbf Y_i,D_i\mid b_i)=f(\mathbf Y_i\mid b_i)f(D_i\mid b_i)\). Substituting the longitudinal density and the event/censoring likelihood derived above yields \(L_i=L_{Yi}L_{Ti}\). This is a statement about the conditional data model, not a claim that the two outcomes are marginally independent.

The assumption is inappropriate if dependence remains after conditioning on the shared effects and modeled covariates. For example, measurement errors may have serial correlation not captured by the longitudinal model, or an unmodeled visit process may be related to health status. In such cases, multiplying independent Gaussian measurement densities and the usual event contribution does not represent the stated data-generating process; the relevant dependence or observation process must be modeled.

The event contribution also depends on the hazard definition. If the hazard contains a time-varying biomarker trajectory, such as \(h_i(t\mid b_i)=h_0(t)\exp\{\alpha m_i(t\mid b_i)\}\), then the current trajectory value enters the hazard at the event time, while the entire trajectory over follow-up affects the cumulative hazard integral. Replacing the integral by a single hazard value times follow-up time is generally wrong unless the hazard is constant over that interval.

Diagnostics, Alternatives, and Limitations

Check a constructed contribution before using it in computation. Confirm that each measurement density uses the observed value and its matching time; verify that the event indicator is coded as 1 for an observed event and 0 for right censoring; and check that the cumulative hazard is integrated from the time origin to the observed time. For a nonnegative hazard, \(H_i(t\mid b_i)\) must be nonnegative and nondecreasing, and the resulting survival probability must lie between 0 and 1. Numerical integration should be checked for stability when the hazard has no simple antiderivative.

A useful computational check is the log contribution:

$$ \log L_i(\theta;b_i) = \sum_{j=1}^{n_i}\log f_Y(Y_{ij}\mid b_i) +\delta_i\log h_i(\tilde T_i\mid b_i) -H_i(\tilde T_i\mid b_i). $$

This form avoids underflow when many densities or small event contributions are multiplied. It also makes a sign error in the cumulative-hazard term easier to detect: survival contributes \(-H_i\), not \(+H_i\). An event-time density has units of inverse time, whereas a censoring survival contribution is dimensionless; the different units are expected.

The main alternatives change the data model, not merely the arithmetic. One can specify correlated longitudinal errors and use their joint multivariate density instead of a product of independent densities. One can explicitly model informative censoring or the visit process when the assumptions for omitting those mechanisms do not hold. A model that omits shared random effects may treat longitudinal and event outcomes as unrelated conditional on covariates, but then it does not represent their association through subject-specific effects. Each alternative requires assumptions suited to the scientific and observation processes.

A frequent limitation is that shared random effects capture only the dependence represented by their chosen structure. A random intercept alone, for example, cannot represent every possible subject-specific trajectory difference. Further, the conditional contribution is not the integrated subject-level likelihood: it conditions on \(b_i\). The distribution of random effects and the treatment of unknown parameters are separate ingredients. Keeping this distinction clear avoids interpreting a conditional contribution as a complete marginal likelihood or as a posterior distribution.

Common pitfall: A censored subject is sometimes assigned only a hazard contribution, or an event subject is assigned only a survival probability. Both are incorrect. An observed event contributes \(h_i(\tilde T_i\mid b_i)S_i(\tilde T_i\mid b_i)\); right censoring contributes \(S_i(\tilde T_i\mid b_i)\). The hazard factor records an event at that time, while survival records remaining event-free up to that time.

Check Your Understanding

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

  1. For a subject censored at time \(c\), what is the event-process contribution, and why is there no hazard factor?
  2. If three Gaussian measurements have conditionally independent errors, how does their longitudinal density factorize?
  3. For an event at time \(t\), write the contribution in terms of the conditional hazard and cumulative hazard.
  4. Suppose \(H_i(t\mid b_i)=-0.2\). State one reason this result signals an error.
  5. Why does conditional independence given \(b_i\) not imply marginal independence of the longitudinal and event outcomes?

Solutions. (1) The contribution is \(S_i(c\mid b_i)=\exp\{-H_i(c\mid b_i)\}\), because the observation establishes survival through \(c\) but does not establish an event at \(c\). (2) It is \(\prod_{j=1}^3 f_Y(Y_{ij}\mid b_i)\). (3) It is \(h_i(t\mid b_i)S_i(t\mid b_i)=h_i(t\mid b_i)\exp\{-H_i(t\mid b_i)\}\). (4) A cumulative hazard is the integral of a nonnegative hazard, so it cannot be negative; check the hazard specification or integration. (5) Both outcomes depend on the same random effects. Averaging over variation in \(b_i\) can therefore associate the outcomes even when they are independent conditional on \(b_i\).

Clinical Biostats