Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Factorizing the Conditional Subject Likelihood

The Basic Joint Model · Tutorial 137 of 697

Factorizing the Conditional Subject Likelihood

Learn to factor a subject’s conditional likelihood into its longitudinal measurement contribution and event-process contribution, and interpret each factor correctly.

Advanced 10 min read

What You'll Learn

  • State the conditional independence assumptions that permit subject-level likelihood factorization.
  • Write the longitudinal measurement contribution as a product of conditional densities.
  • Express the event contribution for an observed event or right censoring.
  • Combine both contributions and calculate the result in worked examples.
  • Diagnose errors caused by omitting shared random effects or misclassifying censoring.
  • Distinguish a conditional subject likelihood from separate marginal analyses.

Why Factor the Subject Likelihood?

A subject in a joint model contributes two kinds of observed information: repeated measurements of a longitudinal outcome and a record of event time or right censoring. The model connects these processes through shared random effects. Conditional on those effects, the two contributions can be written as separate factors and multiplied. This factorization is a compact expression of the model’s assumptions, not a claim that the measurements and event process are unrelated overall.

The distinction matters. A subject with an unusual marker trajectory may also have a different event risk because both processes depend on the same latent subject-specific effects. The conditional likelihood keeps that shared dependence in view: each factor is evaluated at the same subject-specific random-effects value.

Definition: For subject \(i\), let \(Y_{ij}\) be the longitudinal measurement at time \(t_{ij}\), for \(j=1,\ldots,n_i\). Let \(T_i\) be the observed event or censoring time, and let \(\delta_i=1\) indicate an observed event and \(\delta_i=0\) indicate right censoring. Write \(b_i\) for the subject’s shared random effects. The conditional subject likelihood is the likelihood of that subject’s observed measurements and event record, conditional on \(b_i\) and the covariates and measurement schedule: \[ L_i(b_i)=f(\mathbf y_i\mid b_i)\,L_{E,i}(b_i), \] where \(f(\mathbf y_i\mid b_i)\) is the longitudinal measurement contribution and \(L_{E,i}(b_i)\) is the event-process contribution.

Assumptions Behind the Product

The factorization uses assumptions about the data-generating model. First, conditional on \(b_i\), covariates, and the measurement times, the longitudinal measurements have the specified conditional distribution. In the common Gaussian measurement model, the latent mean at time \(t\) is \(m_i(t;b_i)\), and \(Y_{ij}=m_i(t_{ij};b_i)+\epsilon_{ij}\), where the measurement errors are conditionally independent and follow \(N(0,\sigma^2)\). Under that model, the longitudinal contribution is a product of normal densities. The Gaussian form is an assumption for this example of a measurement model, not a requirement for the general factorization.

Second, conditional on the shared random effects and covariates, the longitudinal process and event process are independent. In particular, once \(b_i\) is specified, the event record contributes no further information about the measurement errors, and the measurements contribute no further information about the event record. Their dependence in the joint model is represented through their common dependence on \(b_i\).

Third, the event record is treated as an observed event time or a right-censored time under the event model. The censoring mechanism must be non-informative for this event likelihood under the conditioning used; otherwise, its contribution may also need to be modeled. The measurement schedule and covariates are conditioned upon here, rather than assigned likelihood contributions. These assumptions should be checked against the study design; the factorization does not by itself justify them.

Deriving the Factorization

Let \(\mathbf y_i=(y_{i1},\ldots,y_{in_i})\) denote the observed measurements. By the multiplication rule for conditional densities, the joint conditional contribution can be written as the longitudinal density times the event-record density conditional on the longitudinal data. Conditional independence makes the latter event-record density equal to its version conditional only on \(b_i\) and the covariates. If the measurements are also conditionally independent given \(b_i\), their joint density factors into individual measurement densities.

$$ \begin{aligned} L_i(b_i) &= f(\mathbf y_i,T_i,\delta_i\mid b_i)\\ &= f(\mathbf y_i\mid b_i)\, f(T_i,\delta_i\mid \mathbf y_i,b_i)\\ &= \left\{\prod_{j=1}^{n_i} f_Y(y_{ij}\mid b_i,t_{ij})\right\} L_{E,i}(b_i). \end{aligned} $$

For the event part, let \(h_i(t\mid b_i)\) be the subject-specific hazard and let \(H_i(t\mid b_i)=\int_0^t h_i(u\mid b_i)\,du\) be its cumulative hazard. The conditional survival function is \(S_i(t\mid b_i)=\exp\{-H_i(t\mid b_i)\}\). An observed event at \(T_i\) contributes the event-time density \(h_i(T_i\mid b_i)S_i(T_i\mid b_i)\); right censoring at \(T_i\) contributes \(S_i(T_i\mid b_i)\). Thus, for either record, the event contribution is \(h_i(T_i\mid b_i)^{\delta_i}S_i(T_i\mid b_i)\), or equivalently:

$$ L_{E,i}(b_i) = h_i(T_i\mid b_i)^{\delta_i} \exp\{-H_i(T_i\mid b_i)\}. $$

Combining the longitudinal and event terms gives the conditional subject likelihood:

$$ L_i(b_i) = \left\{\prod_{j=1}^{n_i}f_Y(y_{ij}\mid b_i,t_{ij})\right\} h_i(T_i\mid b_i)^{\delta_i} \exp\{-H_i(T_i\mid b_i)\}. $$

This is a likelihood contribution for the observed data conditional on \(b_i\), not a probability that the continuous measurements or event time take exactly their observed values. It also is not the marginal likelihood: the random effects have not been averaged over their distribution. The same \(b_i\) appears in both factors.

Worked Examples

Worked Example: Multiplying Measurement and Event Contributions

Hypothetical data. A subject has three measurements \(y_{i1}=5.2\), \(y_{i2}=4.7\), and \(y_{i3}=4.1\). At the given \(b_i\) and measurement times, the model means are \(5.0\), \(4.5\), and \(4.0\), with conditionally independent normal errors having \(\sigma=0.5\) units. The subject experiences an event at month 10. Suppose the event hazard at month 10 is \(0.06\) per month and the cumulative hazard through month 10 is \(0.72\). These hazard values are stipulated model quantities for this calculation.

For a normal density with standard deviation \(0.5\), each measurement density is \(\{1/(0.5\sqrt{2\pi})\}\exp\{-(y-\mu)^2/(2(0.5)^2)\}\). The residuals are \(0.2\), \(0.2\), and \(0.1\) units, so the three densities are:

$$ \begin{aligned} f_Y(5.2)&=0.797885\exp(-0.08)\approx 0.73654,\\ f_Y(4.7)&=0.797885\exp(-0.08)\approx 0.73654,\\ f_Y(4.1)&=0.797885\exp(-0.02)\approx 0.78209. \end{aligned} $$

The longitudinal contribution is therefore \(0.73654(0.73654)(0.78209)\approx 0.4243\), in the corresponding density units. Because an event was observed, \(\delta_i=1\), and the event contribution is \(0.06\exp(-0.72)\approx 0.02921\) per month. The full conditional likelihood contribution is:

$$ L_i(b_i)\approx 0.4243(0.02921)\approx 0.01239. $$

This value is a likelihood density, not a probability of observing this exact dataset. The units include the measurement-density units and inverse months from the event-time density.

Worked Example: A Right-Censored Subject

Hypothetical data. A second subject has two measurements, \(1.2\) and \(0.8\) units, each with conditional mean \(1.0\) unit and conditionally independent normal errors with standard deviation \(1.0\) unit. The subject is right-censored at month 6, and the cumulative hazard through month 6 is \(0.45\). Assume the stated Gaussian measurement model and non-informative censoring for this calculation.

For each measurement, the residual is \(0.2\) or \(-0.2\), and the normal density is \((1/\sqrt{2\pi})\exp(-0.2^2/2)\approx 0.39104\) per measurement unit. Hence \(f(\mathbf y_i\mid b_i)\approx 0.39104^2=0.1529\) per squared measurement unit. Since \(\delta_i=0\), there is no hazard multiplier: the event contribution is the conditional survival probability, \(\exp(-0.45)\approx 0.6376\). Thus:

$$ L_i(b_i)\approx 0.1529(0.6376)\approx 0.09750. $$

The censoring record says that the subject’s event time exceeds 6 months; it does not say that an event occurred at month 6. Multiplying by the hazard at month 6 would incorrectly treat censoring as an observed event.

Worked Example: Changing the Event Indicator

Hypothetical comparison. Consider a single measurement of \(y_{i1}=2.0\) units with conditional mean \(2.0\) units and normal error standard deviation \(1.0\) unit. Its density is \(1/\sqrt{2\pi}\approx 0.39894\) per measurement unit. Suppose \(T_i=8\) months, \(H_i(8\mid b_i)=0.50\), and \(h_i(8\mid b_i)=0.10\) per month. Compare an observed event at month 8 with censoring at month 8, holding the other quantities fixed.

For an observed event, \(\delta_i=1\), so the event factor is \(0.10\exp(-0.50)\approx 0.06065\) per month. The full conditional contribution is \(0.39894(0.06065)\approx 0.02420\), per measurement unit per month.

For right censoring, \(\delta_i=0\), so the event factor is only \(\exp(-0.50)\approx 0.6065\). The full contribution is \(0.39894(0.6065)\approx 0.2420\) per measurement unit. The difference follows from what was observed: an event record has a density at its event time, while a censoring record contributes survival through the censoring time.

Log-Likelihood, Checks, and Common Errors

For computation, the log of the conditional subject likelihood is often more convenient. The product over measurements becomes a sum, and the event contribution becomes a hazard term plus a cumulative-hazard term:

$$ \ell_i(b_i) = \sum_{j=1}^{n_i}\log f_Y(y_{ij}\mid b_i,t_{ij}) +\delta_i\log h_i(T_i\mid b_i) -H_i(T_i\mid b_i). $$

When \(\delta_i=0\), the hazard term vanishes, leaving the longitudinal log-density sum minus the cumulative hazard. When \(\delta_i=1\), the log hazard is added. This representation is also useful for checking arithmetic: exponentiating the total log contribution should recover the product, up to rounding.

A practical check is to calculate the two components separately before combining them. Verify that the longitudinal factors use the correct measurement times, means, and error scale; verify that the event term uses the correct \(T_i\), \(\delta_i\), hazard, and cumulative hazard. A zero or negative hazard at an observed event time is incompatible with a finite event log-likelihood. Very small products may underflow in software, which is one reason to accumulate log contributions instead.

  • Common mistake: treating conditional independence as unconditional independence. The incorrect reasoning is, “The likelihood factors, so the marker and event time are unrelated.” The correction is that the factorization is conditional on \(b_i\). Both factors may depend on the same random effects, inducing association in the observed data.
  • Common mistake: using a hazard for a censored record. The incorrect reasoning is, “The subject has a recorded time, so multiply by the hazard at that time.” The correction is to use \(h_i(T_i\mid b_i)^{\delta_i}\); when \(\delta_i=0\), the event factor is survival alone.
  • Common mistake: assigning different random effects to the two factors. That would discard the shared-effects structure. In this model, both contributions are evaluated at the same \(b_i\).
  • Common mistake: calling this the marginal likelihood. The displayed expression conditions on \(b_i\). It has not incorporated the random-effects distribution.

What the Factorization Does and Does Not Do

The conditional factorization is useful because it separates the roles of the two submodels while retaining their shared subject-specific effects. It provides a direct way to inspect how each subject’s measurements and event record contribute to the model. It is also different from fitting two unrelated models and multiplying their marginal results: such an approach does not generally represent the shared dependence specified by the joint model.

The product is valid only to the extent that the stated conditional distributions and independence assumptions are appropriate. If measurement errors remain associated after conditioning on \(b_i\), if the event process still depends on unmodeled features of the longitudinal process, or if censoring is informative under the assumed model, the simple factors may not describe the observed-data likelihood correctly. Likewise, conditioning on the measurement schedule does not establish that the schedule is non-informative. These are modeling questions, not algebraic consequences of the product.

Finally, the conditional contribution is one part of likelihood construction, not by itself a complete prescription for inference about all model parameters. It makes explicit what the subject’s observed data contribute at a specified random-effects value. The random effects remain shared latent quantities, and their treatment is essential to moving from this conditional expression to population-level likelihood inference.

Key takeaway: Under conditional independence, a subject’s likelihood conditional on shared random effects is the product of the longitudinal measurement density and the right-censored event contribution: \(L_i(b_i)=\{\prod_j f_Y(y_{ij}\mid b_i,t_{ij})\}h_i(T_i\mid b_i)^{\delta_i}\exp\{-H_i(T_i\mid b_i)\}\). The same \(b_i\) links both processes.

Check Your Understanding

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

  1. If \(\delta_i=0\), which part of the event contribution remains, and why?
  2. A subject has two conditionally independent measurements with densities \(0.30\) and \(0.40\), and a censoring contribution of \(0.70\). What is the conditional subject likelihood contribution?
  3. Why does a conditional product of measurement and event factors not imply that the two processes are marginally independent?
  4. For an observed event, suppose \(h_i(T_i\mid b_i)=0.08\) per month and \(H_i(T_i\mid b_i)=0.60\). Calculate the event contribution.
  5. Name one condition under which the stated factorization could fail to represent the appropriate likelihood.

Solutions. (1) The survival factor \(\exp\{-H_i(T_i\mid b_i)\}\) remains; censoring indicates survival through \(T_i\), not an event at \(T_i\). (2) \(0.30(0.40)(0.70)=0.0840\). (3) Both factors depend on the same \(b_i\), so averaging or otherwise accounting for that shared latent quantity can induce dependence between the observed processes. (4) Since \(\delta_i=1\), the contribution is \(0.08\exp(-0.60)\approx 0.04390\) per month. (5) Examples include residual dependence between the processes after conditioning on \(b_i\), an incorrect conditional measurement model, or informative censoring not represented in the likelihood.

Clinical Biostats