Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Residual Checks With Irregular Measurement Schedules

Model Diagnostics · Tutorial 620 of 697

Residual Checks With Irregular Measurement Schedules

Learn to diagnose time-related residual structure without confusing it with differences in how often subjects are measured.

Advanced 12 min read

What You'll Learn

  • Define longitudinal residuals on the actual measurement-time scale.
  • Explain how unequal visit counts change pooled residual summaries.
  • Compare observation-weighted and subject-balanced diagnostics.
  • Check residual patterns across calendar time, visit number, and intervisit gap.
  • Recognize when informative visit schedules or event-related dropout limit interpretation.
  • Work through numerical residual summaries and a within-subject time comparison.

Why Irregular Schedules Change Residual Checks

Longitudinal residuals are attached to the occasions on which measurements were taken. When those occasions differ across subjects, a pooled residual plot does not give every subject equal influence: a subject measured 12 times contributes 12 points, while one measured twice contributes only two. The plot can therefore reflect both the model’s time-related fit and the composition of the observed measurement schedule.

The diagnostic question is not simply whether residuals vary with time. It is whether a pattern persists when the analysis distinguishes actual elapsed time from the number and distribution of observations contributed by each subject. A smooth trend over time and an apparent trend caused by certain subjects being measured more often are different problems, and they call for different follow-up.

Definition: Let \(Y_{ij}\) be the longitudinal measurement for subject \(i\) at their \(j\)th observed visit, made at actual time \(t_{ij}\). A longitudinal residual is the difference between the observed value and a specified fitted or predictive value at that time. For a fitted mean \(\hat m_i(t_{ij})\), the raw residual is \(r_{ij}=Y_{ij}-\hat m_i(t_{ij})\). A standardized residual divides this difference by a suitable predictive standard deviation. The residual definition, including whether the fit is conditional on subject-specific information, must be stated and used consistently.

A residual plot against \(t_{ij}\) asks whether residuals show structure on the chosen time scale, such as months since baseline. A plot against visit number asks a different question: whether residuals vary over a subject’s sequence of observed visits. With irregular schedules, the third visit might occur at month 2 for one subject and month 18 for another. Visit number cannot be treated as a substitute for elapsed time.

The basic reference expectation is that residuals have no systematic pattern under an adequate longitudinal mean model, on the relevant time scale and for the residual construction being used. This does not mean that every residual is independent or exactly centered at zero. Repeated measurements on a subject may be correlated, and fitted values may themselves depend on estimated subject effects. A residual plot is a diagnostic, not a set of independent observations for an ordinary significance test.

Two Ways to Summarize Unequally Sampled Subjects

An observation-weighted summary gives equal weight to each recorded measurement. If subject \(i\) has \(n_i\) observations and there are \(N\) subjects, the pooled mean residual is

$$ \bar r_{\mathrm{obs}}=\frac{\sum_{i=1}^{N}\sum_{j=1}^{n_i} r_{ij}}{\sum_{i=1}^{N}n_i}. $$

A subject-balanced summary first averages within each subject and then averages those subject means:

$$ \bar r_{\mathrm{subj}}=\frac{1}{N}\sum_{i=1}^{N}\bar r_i, \qquad \bar r_i=\frac{1}{n_i}\sum_{j=1}^{n_i}r_{ij}. $$

These summaries target different weightings. The observation-weighted summary describes the average over recorded measurements; the subject-balanced summary gives each subject equal weight. Neither is universally preferable. For a time-specific diagnostic, the same distinction applies within time bins or local windows: subjects with many measurements in a window can dominate an observation-weighted curve.

Why a Pooled Pattern Can Be a Composition Pattern

Suppose, for illustration, that subject \(i\) has a residual mean \(\mu_i\) that does not change over time, but subjects differ in \(\mu_i\). In a narrow time region, the pooled residual mean is approximately a weighted average of the subject means. The weight for subject \(i\) depends on how likely that subject is to contribute a measurement in that region. As the set of observed subjects changes over time, the pooled average can move even though no subject has a time trend.

The same issue appears in the overall mean. Since \(\sum_j r_{ij}=n_i\bar r_i\), the observation-weighted mean can be written as

$$ \bar r_{\mathrm{obs}} =\sum_{i=1}^{N}\frac{n_i}{\sum_{k=1}^{N}n_k}\bar r_i. $$

Thus subjects receive weights proportional to their visit counts. The subject-balanced mean instead assigns weight \(1/N\) to each subject. This algebra does not establish that subject balancing is always the correct diagnostic; it shows precisely why the two views can differ and why visit counts must be considered.

Worked Example: Unequal Visit Counts and the Pooled Mean

Consider two hypothetical subjects. Subject A has four residuals, \(-0.2, 0, 0.2, 0\), and subject B has one residual, \(1.0\). Calculate the observation-weighted and subject-balanced means.

For subject A, the residual mean is \((-0.2+0+0.2+0)/4=0\). For subject B, it is \(1.0/1=1.0\). The observation-weighted mean is

$$ \bar r_{\mathrm{obs}} =\frac{-0.2+0+0.2+0+1.0}{5} =\frac{1.0}{5} =0.20. $$

The subject-balanced mean is

$$ \bar r_{\mathrm{subj}}=\frac{0+1.0}{2}=0.50. $$

The summaries differ because subject A contributes four times as many observations as subject B. The pooled mean is closer to A’s mean; the subject-balanced mean gives the two subjects equal influence. This example does not show that either residual mean is a formal model test. It shows why a pooled diagnostic should be interpreted alongside subject-level summaries and the visit-count distribution.

A Practical Sequence of Checks

A useful assessment separates the time axis, the subject composition, and the measurement process. First, plot residuals against actual elapsed time, using the time scale represented by the fitted longitudinal model. Use a smoother cautiously: at times with few observations, it can suggest a stable pattern where the data provide little information. Show the number of subjects or observations supporting regions of the plot, and use bins or intervals wide enough to avoid treating isolated visits as a trend.

Next, assess whether a visible pattern is driven by a few heavily measured subjects. Compare the pooled plot with subject-specific traces where feasible, and with subject-balanced summaries in time regions containing enough measurements from multiple subjects. A pattern that appears within many subjects over comparable time ranges is stronger evidence of time-related misfit than one produced by a changing mix of subjects. Lack of overlap in observed times limits this comparison: if different groups of subjects supply the early and late data, the data cannot cleanly separate time change from subject composition.

Then inspect residuals against visit number and intervisit gap as supplementary checks. A pattern against visit number may indicate sequence-related structure, but it may also arise because later visits occur at systematically different times. A pattern against time since the previous measurement may suggest that the residual depends on recent observation history or that the measurement process deserves scrutiny. Neither plot alone identifies the cause.

1
Define the residual and time scale.
State whether residuals are raw or standardized and whether the horizontal axis is elapsed time, time since the previous visit, or visit number.
2
Inspect support and frequency.
Display how many subjects and observations contribute over time, and summarize the distribution of visits per subject.
3
Compare pooled and subject-balanced views.
Check whether time patterns persist when each subject has comparable influence and when subjects are viewed individually.
4
Interpret cautiously and investigate.
Look for sparse regions, event-related loss of follow-up, and changing subject composition before attributing a pattern to the longitudinal mean model.

Worked Checks on the Actual Time Scale

Worked Example: Comparing Residuals Within Subjects Over Time

In a hypothetical diagnostic data set, three subjects each have an early and a later residual. Their times and residuals are: A, month 0 residual \(0.0\) and month 2 residual \(1.0\); B, month 0 residual \(0.0\) and month 4 residual \(2.0\); C, month 1 residual \(0.0\) and month 3 residual \(1.0\). The residual units are biomarker units. Compare each subject’s later residual with their early residual.

The within-subject changes are \(1.0-0.0=1.0\) for A, \(2.0-0.0=2.0\) for B, and \(1.0-0.0=1.0\) for C. Their mean change is

$$ \frac{1.0+2.0+1.0}{3}=\frac{4.0}{3}=1.33 \text{ biomarker units}. $$

All three paired changes are positive, which is a coherent warning sign of increasing residuals within these subjects. However, the later measurements occur at different months, so this calculation does not estimate a common change per month. It is a direction-of-change check, not a time-slope estimate. A follow-up analysis should use the actual times and examine whether the positive pattern is supported across subjects over comparable time ranges.

Worked Example: A Pooled Time Pattern From Subject Composition

Suppose subject A has residual \(+1\) at months 0, 1, 2, and 3. Subject B has residual \(-1\) at months 0 and 3. Neither subject’s residual changes over time. At month 0 the pooled mean is \((1-1)/2=0\); at month 1 it is \(1\); at month 2 it is \(1\); and at month 3 it is \((1-1)/2=0\).

The pooled values are therefore \(0, 1, 1, 0\) at months 0 through 3. This pattern is not a common within-subject time trend: each subject’s residual is constant. At the middle months, only A contributes, so A’s residual determines the pooled average. The appropriate interpretation is that the pooled curve reflects changing subject composition and sparse support, not evidence by itself of a time-varying mean error.

A useful diagnostic display would show the two subject traces and the number of contributors at each time. Here the lack of multiple-subject support at months 1 and 2 is immediately apparent. No reweighting can create information about what B’s residual would have been at those times.

Assumptions, Comparisons, and Failure Modes

These checks are most interpretable when the residual definition is appropriate for the fitted model, the time scale matches the modeled trajectory, and there is adequate overlap in observation times to compare subjects. The residual variance and dependence structure also matter: a raw residual spread may change with time even when the mean is correctly specified. Standardization can help compare residual magnitudes when the predictive variance varies, but it does not remove dependence or repair a poorly specified predictive distribution.

Observation-weighted plots are direct summaries of recorded measurements and are often useful for locating regions of concern. Subject-balanced summaries reduce domination by frequent visitors, but can be unstable when a subject has only one observation in a time region. Subject-specific plots reveal heterogeneity and influential trajectories, but become difficult to read with many subjects. These are complementary views rather than competing universal methods.

An irregular schedule may also be related to health status: a patient could be measured more often when symptoms worsen, or could stop attending as illness progresses. In that situation, observed residuals are conditioned on the occasions that were observed. A residual plot alone cannot determine whether the visit process is informative or establish that the model accounts for it. Similarly, event occurrence can limit later biomarker measurements. An apparent late-time pattern may reflect which subjects remain observed, not simply a failure of the longitudinal mean model.

  • Do not replace time with visit number. Visit number is a sequence label, not a measure of elapsed time under irregular scheduling.
  • Do not treat every plotted point as independent evidence. Repeated residuals from a subject can be correlated, and fitted values may share estimated quantities.
  • Do not assume equal weighting answers every question. Observation weighting and subject balancing describe different summaries; report which one is being examined.
  • Do not overinterpret sparse time regions. A smooth curve cannot compensate for having few subjects or little overlap in observed times.
Key takeaway: With irregular measurement schedules, a residual pattern over time can arise from within-subject temporal structure, from changing subject composition, or from both. Examine actual elapsed time, visit counts, subject-level trajectories, and subject-balanced summaries together; interpret the result as a diagnostic of observed residuals, not as proof about the measurement process.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. Subject A has two residuals with mean \(0\), and subject B has six residuals with mean \(1\). What are the observation-weighted and subject-balanced residual means?
  2. Why can a pooled residual curve change over time even when each subject’s residual is constant over time?
  3. A residual pattern appears against visit number but not against elapsed months. What should be checked before concluding that the model has a sequence-related problem?
  4. What limitation arises if early residuals come from one set of subjects and late residuals from a completely different set?
  5. Does a residual plot establish that the visit process is non-informative? Explain.

Solutions. (1) The pooled mean is \((2(0)+6(1))/(2+6)=6/8=0.75\). The subject-balanced mean is \((0+1)/2=0.50\). (2) The mix of subjects contributing measurements can change over time, so the pooled curve can give different weights to subjects with different residual levels. (3) Check the actual elapsed times associated with each visit number, the intervisit gaps, and which subjects contribute at each sequence position. (4) Time change cannot be separated cleanly from differences between the two subject groups because there is no overlap supporting a within-subject or comparable-subject contrast. (5) No. A residual plot describes residuals at observed visits; it cannot by itself establish whether visit timing depends on health status or other unobserved factors.

Clinical Biostats