Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Using Actual Measurement Times in Prediction

Dynamic Prediction · Tutorial 511 of 697

Using Actual Measurement Times in Prediction

Use the observed measurement dates in a joint model to update a patient’s history and calculate survival predictions at a landmark.

Advanced 11 min read

What You'll Learn

  • Represent a patient’s biomarker history as observed values paired with their actual measurement times.
  • Explain how measurement times enter the longitudinal likelihood and latent-effect weights.
  • Derive conditional survival prediction from the updated distribution of random effects.
  • Calculate how conditioning on survival to a landmark further updates latent-risk weights.
  • Identify when an assumed regular visit schedule or informative visit process can distort predictions.
  • Compare actual-time modeling with regular-grid substitution, interpolation, and last-observation-carried-forward.

Why the Recorded Times Matter

A patient’s biomarker history is not just a list of values. Each value was observed at a particular time, and that time determines what the value says about the patient’s underlying trajectory. A value of 8 measured one month after baseline and the same value measured six months after baseline can provide quite different evidence about a rising biomarker. Dynamic prediction should therefore use the dates on which measurements were actually recorded, not dates implied by a convenient regular schedule.

This matters even when the prediction method itself has already been established. In a joint model, the longitudinal history updates the distribution of a patient’s latent effects, while event-free follow-up also informs that distribution. The prediction then averages survival over the updated latent-effect distribution. If the recorded times are replaced, the longitudinal evidence and consequently the prediction may change.

Definition: For patient \(i\), let \(Y_i(s)=\{(y_{ij},t_{ij}):t_{ij}\leq s\}\) denote the longitudinal history available by landmark time \(s\). Here \(y_{ij}\) is the observed biomarker value at actual time \(t_{ij}\). The dynamic survival prediction at future time \(u>s\) is \(P(T_i^*>u\mid T_i^*>s,Y_i(s),x_i)\), where \(T_i^*\) is the event time and \(x_i\) denotes baseline covariates.

The landmark \(s\) is the time at which the prediction is made. Only measurements available by \(s\) belong in \(Y_i(s)\); using a value measured after \(s\) would introduce future information. The actual times can be irregular, such as 0, 1.4, and 3.1 months, or may differ across patients. Neither feature requires observations to be interpolated onto a common grid.

Where Actual Times Enter the Model

Suppose the longitudinal submodel has conditional mean \(m_i(t;b_i,x_i)\), where \(b_i\) is a patient-specific latent effect. For example, the mean might include a patient-specific intercept and slope, with time measured in months. Under a common Gaussian measurement model,

$$ y_{ij}=m_i(t_{ij};b_i,x_i)+\varepsilon_{ij},\qquad \varepsilon_{ij}\mid b_i,x_i,t_{ij}\sim N(0,\sigma^2). $$

Each observation is evaluated at its own \(t_{ij}\). If the residuals are conditionally independent, the longitudinal likelihood for the observed history is the product of the densities evaluated at those times. If the model instead specifies serially correlated residuals, the corresponding covariance structure must also use the actual time gaps. The product form is not a universal assumption; it is valid only under conditional independence.

The time-to-event submodel supplies a hazard \(\lambda_i(v\mid b_i,x_i)\) and conditional survival function \(S_i(v\mid b_i,x_i)\). The particular association between the longitudinal and event processes is specified by the joint model. The prediction procedure here does not require replacing actual measurement times with a particular association form.

Key result: Under the fitted joint model, the latent-effect distribution given the observed history and survival to \(s\) is proportional to the prior density of \(b_i\), the longitudinal likelihood evaluated at the actual measurement times, and the probability of surviving to \(s\). The conditional survival prediction averages the survival from \(s\) to \(u\) over this updated distribution.

Deriving the Conditional Prediction

Write \(p(b_i\mid x_i)\) for the model’s latent-effect distribution before using this patient’s longitudinal history and event-free follow-up. Let \(f(Y_i(s)\mid b_i,x_i,\mathbf t_i)\) be the longitudinal likelihood, where \(\mathbf t_i\) collects the actual observed times. Bayes’ rule gives the following posterior density, conditional on being event-free at \(s\):

$$ p(b_i\mid Y_i(s),T_i^*>s,x_i,\mathbf t_i) \propto f(Y_i(s)\mid b_i,x_i,\mathbf t_i)\, S_i(s\mid b_i,x_i)\, p(b_i\mid x_i). $$

The survival factor is necessary because a patient who remains event-free to \(s\) provides information about latent risk. The proportionality constant is the integral of the right-hand side over all possible \(b_i\), making the posterior density integrate to one.

For a fixed \(b_i\), the chance of surviving beyond \(u\), given survival to \(s\), is \(S_i(u\mid b_i,x_i)/S_i(s\mid b_i,x_i)\). Averaging this ratio over the posterior density just defined yields:

$$ P(T_i^*>u\mid T_i^*>s,Y_i(s),x_i,\mathbf t_i) = \int \frac{S_i(u\mid b_i,x_i)}{S_i(s\mid b_i,x_i)} p(b_i\mid Y_i(s),T_i^*>s,x_i,\mathbf t_i)\,db_i. $$

This follows by conditioning first on \(b_i\), then integrating over its conditional distribution given the available history and survival. Equivalently, because \(S_i(v\mid b_i,x_i)=\exp\{-\int_0^v\lambda_i(r\mid b_i,x_i)\,dr\}\), the ratio is \(\exp\{-\int_s^u\lambda_i(r\mid b_i,x_i)\,dr\}\). Thus the prediction concerns survival over the future interval from \(s\) to \(u\), not survival from baseline treated as if the patient’s history were unavailable.

In computation, the integral may be approximated using quadrature, Monte Carlo draws, or another suitable integration method. Whatever method is used, the longitudinal likelihood must evaluate each observed value at its recorded time. If the likelihood depends on time gaps through a residual covariance model, those actual gaps must be retained as well.

Worked Example: Evaluating a Trajectory at Actual Dates

Suppose, purely for illustration, a fitted longitudinal mean for a hypothetical patient is \(m(t)=10+1.5t\), with time \(t\) measured in months. The recorded values are 10.2 at month 0, 12.0 at month 1.4, and 14.8 at month 3.1. Assume independent Gaussian measurement errors with standard deviation 0.5 months’ worth of biomarker units. Compare the residual evidence under the actual times with what would result from incorrectly assigning the three values to months 0, 1, and 2.

At the actual times, the fitted means are \(m(0)=10\), \(m(1.4)=10+1.5(1.4)=12.1\), and \(m(3.1)=10+1.5(3.1)=14.65\). The residuals are therefore \(0.2,-0.1,\) and \(0.15\), giving a sum of squared residuals \(0.2^2+(-0.1)^2+0.15^2=0.0725\).

For the assumed regular times 0, 1, and 2, the fitted means would instead be 10, 11.5, and 13. The residuals would be \(0.2,0.5,\) and \(1.8\), with sum of squares \(0.2^2+0.5^2+1.8^2=3.53\). Under the stated Gaussian error model, the likelihood is proportional to \(\exp\{-\text{sum of squared residuals}/(2(0.5)^2)\}\). The actual-time likelihood contribution is proportional to \(\exp(-0.0725/0.5)=0.8650\), whereas the substituted-time contribution is proportional to \(\exp(-3.53/0.5)=0.000859\). The discrepancy is not a minor bookkeeping change: the substituted dates make these observations appear far less compatible with the trajectory.

Worked Example: Actual Dates Change Latent-Effect Weights

Consider a hypothetical two-point latent-effect model with \(b\in\{0,1\}\), prior probabilities 0.5 each, and biomarker mean \(m(t;b)=5+bt\). Measurement errors are independent normal with standard deviation 1. The patient has values 6 at month 1 and 8 at month 3. Calculate the posterior probability of \(b=1\) using the actual dates, then compare it with the result from wrongly treating the second measurement as occurring at month 2.

At the actual dates, the means under \(b=1\) are 6 and 8, so the residuals are 0 and 0. Under \(b=0\), the means are 5 and 5, so the residuals are 1 and 3. Normalizing constants cancel in the likelihood ratio, giving \(L(b=1)/L(b=0)=\exp\{(1^2+3^2-0^2-0^2)/2\}=\exp(5)=148.4\). With equal prior probabilities, the posterior probability is \(148.4/(1+148.4)=0.9933\).

If the second value is incorrectly assigned to month 2, the means under \(b=1\) become 6 and 7, with residuals 0 and 1; the means under \(b=0\) remain 5 and 5, with residuals 1 and 3. The likelihood ratio is now \(\exp\{(10-1)/2\}=\exp(4.5)=90.02\), and the resulting posterior probability is \(90.02/(1+90.02)=0.9890\). Both calculations favor \(b=1\), but the incorrect date changes the evidence and the posterior weight. In a model with a more complicated trajectory or survival association, that change can also affect the prediction.

Survival to the Landmark Also Updates the Prediction

Actual measurement times determine how the biomarker history informs latent effects, but the event-free period up to the landmark contributes additional information. The following calculation separates these two updates to show where survival enters.

Worked Example: Updating Weights Before Predicting Future Survival

Suppose a hypothetical patient’s biomarker history, evaluated at its actual dates, gives probabilities 0.8 and 0.2 for two latent risk states. These are weights before conditioning on survival through the next year. The hazards are constant at 0.1 and 0.3 per year, respectively. Assume the patient is event-free for that year, so the landmark is one year later. Find the posterior state weights at the landmark, then calculate the probability of surviving a further two years.

The probabilities of surviving the first year in the two states are \(\exp(-0.1)=0.9048\) and \(\exp(-0.3)=0.7408\). Multiplying these by the pre-survival weights gives unnormalized weights \(0.8(0.9048)=0.7238\) and \(0.2(0.7408)=0.1482\). Using the unrounded survival probabilities, the landmark weights are 0.8301 and 0.1699, to four significant figures.

The conditional two-year survival probabilities are \(\exp\{-0.1(2)\}=0.8187\) and \(\exp\{-0.3(2)\}=0.5488\). Using the unrounded quantities, the conditional two-year survival probability is \(\frac{0.8\exp(-0.3)+0.2\exp(-0.9)}{0.8\exp(-0.1)+0.2\exp(-0.3)}=0.7729\). The model-based conditional probability of remaining event-free for the next two years is therefore about 0.7729. It is not the probability of surviving three years from baseline: the requested interval begins at the landmark, and the weights already reflect survival to it.

Assumptions, Diagnostics, and Alternatives

Using actual measurement times is necessary, but it does not by itself guarantee a valid prediction. The model must represent the longitudinal mean and residual structure adequately at the observed times, and the event model and its link to latent effects must be suitable for the prediction target. The history must be restricted to information available by the landmark, and the patient must be event-free at that landmark.

A further issue is how measurements came to be taken. If visit times are independent of unobserved biomarker values and event risk conditional on the modeled information, it may be appropriate to condition on the observed times without modeling the visit process. If worsening symptoms or unrecorded biomarker values prompt earlier visits, the timing itself can carry information. Treating such a process as ignorable may distort the latent-effect update; a model for the observation or visit process may then be needed. The relevant assumption is substantive and should be justified, not inferred merely because the dates are present in the data.

Useful checks include plotting each patient’s measurements against the actual time scale, inspecting whether residual patterns change with elapsed time or time gaps, and comparing predictions under plausible trajectory and residual specifications. Investigate unexpectedly large residuals at irregularly timed observations and whether visit intensity changes with observed history. Predictions that shift substantially under reasonable timing assumptions warrant caution. Sparse observations far from the landmark, extrapolation beyond the observed time range, and misspecified visit mechanisms remain important limitations.

Regular-grid substitution is generally inappropriate because it changes the model inputs. Interpolation creates values that were not observed and can understate uncertainty if treated as data. Last-observation-carried-forward ignores subsequent trajectory change and does not provide the joint likelihood update. A simpler landmark model may use a summary of the available history, but it does not automatically retain the information in each value-date pair. These approaches can be useful for other purposes, but they are not equivalent to evaluating the joint model at the actual measurement times.

Common mistake: “The visits are usually about three months apart, so I can label every measurement as if it occurred exactly three months after the last.” This is wrong when the analysis model uses time to describe trajectory or residual dependence: the substituted date changes the expected value, the likelihood, and potentially the prediction. Use the recorded time for every observation; if visit timing is informative, address that process explicitly rather than regularizing the dates by assumption.

Check Your Understanding

Answer each question using the definitions and calculations above. Solutions are included after the questions.

  1. A patient has biomarker values recorded at months 0.5, 2.2, and 4.0. Which times enter the longitudinal likelihood for a prediction made at month 4.0?
  2. Why does the latent-effect posterior at landmark \(s\) include a survival factor as well as the longitudinal likelihood?
  3. For a trajectory mean \(m(t)=3+2t\), a value of 9 recorded at time 3 has what residual? What residual would result if it were wrongly assigned time 2?
  4. In a two-state model, why can conditioning on survival to the landmark change the state weights even when no new biomarker value is recorded?
  5. What concern arises if visits are scheduled sooner when a patient’s unobserved biomarker is worsening?

Solutions. (1) Use all three recorded times, 0.5, 2.2, and 4.0, since each measurement is available by the month-4 landmark. (2) Event-free survival to \(s\) is evidence about latent risk, so Bayes’ rule weights each latent effect by its probability of surviving that period. (3) At time 3, the fitted mean is \(3+2(3)=9\), so the residual is 0. At the incorrectly assigned time 2, the mean is 7 and the residual is \(9-7=2\). (4) Latent states with different event risks have different probabilities of surviving to \(s\); conditioning on observed survival therefore changes their relative weights. (5) Visit timing may be informative about the unobserved trajectory or risk. Assuming it is ignorable could bias the history update, so the observation process may need to be modeled.

Clinical Biostats