Why Examine Residual Dependence Within Subjects?
A longitudinal component can represent each subject’s average trajectory and account for between-subject variation through random effects, yet still leave a pattern in the measurements over time. For example, a measurement higher than its fitted value may tend to be followed by another positive residual. That pattern is within-subject residual serial dependence: dependence between deviations from the fitted longitudinal component at different times for the same subject.
This diagnostic has a specific role in a joint model. Dependence in the observed marker values can arise because subjects have different random intercepts or slopes; that is not, by itself, evidence of residual serial dependence. The question here is whether residuals still co-vary after the longitudinal component’s subject-specific fitted trajectory has been taken into account. Residual correlograms and lag plots address that question descriptively. They do not, on their own, establish a cause or prove that a particular covariance model is correct.
The definition presumes that the chosen conditional mean and residual scale are meaningful for the marker and that the conditional residuals are expected to have mean zero. Under a longitudinal model with independent Gaussian innovations, for example, residuals at distinct times are conditionally uncorrelated given the subject effects. A residual correlogram looks for departures from that implication. In practice, the subject effects and model parameters are estimated, so plotted residuals are not independent observations from a known distribution.
Conditional residuals are usually the relevant choice for this question. Marginal residuals can retain correlation induced by shared random effects, even if the conditional innovations are independent. Conversely, estimated subject effects can absorb part of a slowly varying residual pattern, making conditional residual dependence look weaker than it is. Interpret either feature in light of how the residuals were constructed.
Building a Correlogram When Visit Times Vary
For a pair of measurements from the same subject, define the elapsed-time lag as \(\Delta_{ijk}=|t_{ik}-t_{ij}|\), with \(j<k\) after ordering visits by time. A residual lag plot places one residual in a pair against the other, for example \(r_{ij}\) on the horizontal axis and \(r_{ik}\) on the vertical axis. Points near the diagonal, particularly for short elapsed-time gaps, can indicate that residuals with the same sign tend to occur near one another. A plot should show or distinguish the elapsed-time gap; otherwise, its pattern can combine pairs separated by very different durations.
A correlogram summarizes residual pair products over specified elapsed-time lag bins. For a bin \(B\), let \(\mathcal{P}_B\) be the set of same-subject measurement pairs whose time gaps fall in \(B\). A simple pooled estimate is:
Here \(N\) is the number of observed measurements used in the zero-lag scale. If residuals have first been standardized to a common residual variance, \(\widehat{\gamma}(0)\) will often be near one, but it need not equal one in a finite sample. Positive \(\widehat{\rho}(B)\) means that residual pairs in the bin tend to have the same sign; negative values mean they tend to have opposite signs. These summaries are descriptive estimates, not automatically valid test statistics.
With irregular measurement times, a “lag of one visit” is not a fixed time interval: consecutive visits might be a week apart for one subject and a year apart for another. Use bins in the original time unit, such as 0–0.5 years and 0.5–1.5 years, or display the pair products against their actual gaps with a smooth summary. State the bin boundaries and unit. Very narrow bins can contain few pairs; very wide bins can average distinct patterns together.
Worked Example: Calculating a Pooled Lag Summary
Suppose three hypothetical subjects each have standardized conditional residuals at times 0, 1, and 2 years. Their residuals are A: \((1,1,0)\), B: \((0,1,1)\), and C: \((-1,-1,-2)\). Treat the lag-1 and lag-2 summaries as descriptive; with only three subjects, they are not precise estimates of a population correlation.
There are six within-subject pairs separated by one year. Their products are \(1\cdot1=1\), \(1\cdot0=0\), \(0\cdot1=0\), \(1\cdot1=1\), \((-1)\cdot(-1)=1\), and \((-1)\cdot(-2)=2\). Thus \(\widehat{\gamma}(1)=5/6=0.8333\).
The three pairs separated by two years have products \(1\cdot0=0\), \(0\cdot1=0\), and \((-1)\cdot(-2)=2\). Therefore, \(\widehat{\gamma}(2)=2/3=0.6667\). Across all nine measurements, the sum of squared residuals is \(2+2+6=10\), so \(\widehat{\gamma}(0)=10/9=1.111\).
The normalized estimates are \(\widehat{\rho}(1)=0.8333/1.111=0.750\) and \(\widehat{\rho}(2)=0.6667/1.111=0.600\). In this hypothetical set, products are positive at both gaps, suggesting similar-sign residuals. The small number of subjects and the reuse of each residual in multiple pairs mean that these values do not justify a formal claim of dependence by themselves.
Accounting for Irregular Gaps and Choosing a Summary
A continuous-time correlation model provides one way to describe how dependence changes with actual elapsed time. A common example is the exponential correlation function, \(\rho(\Delta)=\exp(-\phi\Delta)\), where \(\phi>0\) has units of inverse time. It describes correlation that decays as the gap grows; it is not a requirement that all residual dependence follow this shape. It is useful as a reference for understanding why equal observation-order lags can be misleading.
Worked Example: Comparing Short and Long Gaps
Suppose a hypothetical exponential correlation pattern has \(\phi=0.7\) per year. For measurements 0.25 years apart, the implied correlation is \(\exp(-0.7\times0.25)=\exp(-0.175)=0.8395\). For measurements two years apart, it is \(\exp(-0.7\times2)=\exp(-1.4)=0.2466\).
Thus the same model implies substantially stronger association at the shorter elapsed-time gap. A lag plot that labels both pairs simply as “consecutive visits” would hide this difference. These numbers illustrate a correlation pattern; they are not estimates from the residuals in the preceding example and do not show that an exponential model fits any particular data.
Pooled summaries give every eligible pair equal weight, so subjects with many visits can contribute much more than subjects with few visits. A complementary subject-balanced summary first calculates a lag-bin mean for each subject with eligible pairs and then averages those subject summaries. It gives subjects more nearly equal influence but can be unstable when many subjects have few pairs in a bin. Reporting the number of contributing pairs and subjects makes these choices visible.
A practical display pairs the correlogram with a lag plot or a plot of residual-pair products against elapsed time. Show how many pairs support each bin, and consider showing subject identity or using a subject-balanced summary when visit counts vary greatly. A pattern driven by one subject is different evidence from a similar pattern spread across many subjects. Do not attach conventional independent-pair confidence bands without accounting for clustering, repeated use of residuals, and estimation of the joint model.
Worked Example: Binning Actual Elapsed Times
A hypothetical subject has visits at 0, 1, 4, and 5 years, with standardized conditional residuals \(0.8, 0.6, -0.5,\) and \(-0.4\), respectively. The consecutive-visit gaps are 1, 3, and 1 years, not one common lag.
For the one-year bin, the two eligible products are \(0.8(0.6)=0.48\) and \((-0.5)(-0.4)=0.20\). Their mean is \((0.48+0.20)/2=0.34\). The pair at times 1 and 4 has a three-year gap and product \(0.6(-0.5)=-0.30\); it belongs in a three-year bin, not the one-year bin.
This small example cannot estimate a reliable correlogram, but it shows why grouping by visit order would mix unlike elapsed-time gaps. A plot should also retain the pair counts: the one-year summary here is based on only two pairs from one subject.
Justification and Interpretation
The basic justification for examining pair products follows directly from the conditional covariance. Suppose that, given the subject effects and covariates, the true longitudinal mean is correctly specified and the residuals have mean zero. For two distinct visit times in one subject:
The equality holds because the conditional means of both residuals are zero. Under conditional independence, this covariance is zero, so the expected pair product is zero. If residuals are scaled by a common standard deviation, their covariance is the corresponding correlation. Averaging products in a time-gap bin therefore estimates the average residual covariance pattern represented by the pairs in that bin.
This argument describes the target under the model, not the exact sampling distribution of a fitted correlogram. In practice, fitted means and subject effects are estimated from the same data. For a simple linear model with fixed-effect design matrix \(X\), hat matrix \(H=X(X^\mathsf{T}X)^{-1}X^\mathsf{T}\), and independent errors of variance \(\sigma^2\), fitted residuals have covariance \(\sigma^2(I-H)\). Their covariance is generally not zero off the diagonal, even though the original errors are independent. Mixed and joint models have more involved estimation effects, but the lesson remains: residual dependence can be affected by fitting. Small patterns should not be interpreted as a calibrated significance test unless the reference distribution accounts for the fitted model.
Diagnostics, Alternatives, and Limitations
Evidence of unexplained serial dependence is more persuasive when the pattern is coherent across subjects, appears across a reasonable range of lag-bin choices, and has adequate pair support. A few extreme residuals, one heavily observed subject, or an isolated bin with very few pairs can create a striking but fragile summary. Check the residual scale and the number of contributing subjects and pairs before interpreting the shape.
In a joint model, the event process matters to interpretation. Subjects may stop contributing marker measurements after an event, and observation schedules may differ with subject history. The available residual pairs therefore need not represent all time gaps or all subjects equally. A correlogram of observed pairs describes those pairs under the fitted analysis; it does not by itself separate residual dependence from selection, informative visit timing, or limitations of the event component. Consider the joint design and the observation process when deciding whether a pattern is plausibly a longitudinal residual feature.
The main alternative summaries answer related but different questions. A discrete-time autocorrelation function is appropriate when observations are on a common, equally spaced grid; using visit number as its lag for irregular visits can misstate the time scale. A residual variogram summarizes how squared residual differences change with elapsed time, rather than the sign concordance summarized by pair products. A fitted residual covariance model can describe dependence parametrically, but its adequacy still needs checking. Formal tests are possible in some settings, yet their null distributions must account for within-subject clustering, irregular times, and model fitting. A simple rule of thumb for independent observations is not automatically valid here.
Residual autocorrelation is also not a unique diagnosis. A misspecified mean trajectory can leave runs of positive and negative residuals that resemble serial dependence; apparent variation in residual spread can affect products as well. Conversely, conditioning on estimated subject effects can obscure low-frequency patterns. These diagnostics identify patterns requiring investigation, not the single explanation for them. A residual pattern should be assessed alongside the fitted longitudinal mean, the residual scale, subject-level summaries, and the joint model’s assumptions.
Common Pitfall
Correction: Lag must be defined on elapsed time when measurement times are irregular. Use time-gap bins or display products against actual gaps, and report pair support. Also distinguish conditional residuals from marginal residuals: shared random effects can induce marginal correlation without residual serial dependence.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- Why might marginal residuals show within-subject correlation even when conditional residual innovations are independent?
- Two consecutive-visit pairs are 0.2 years and 1.5 years apart. Should both be pooled as the same elapsed-time lag? Explain.
- A lag-bin estimate is positive, but nearly all of its pairs come from one subject. What should be checked before interpreting it?
- Under a correctly specified conditional mean with zero-mean residuals, what does the expected residual product at two distinct times equal?
Solutions. (1) Shared subject-level random effects induce marginal association; conditioning on those effects removes that source from the residual comparison. (2) No. They should be assigned according to actual elapsed-time gaps, since 0.2 and 1.5 years represent different temporal separations. (3) Check the pair and subject counts, examine whether the pattern occurs across other subjects, and compare with a subject-balanced summary; the pooled value may be dominated by that subject. (4) It equals the conditional covariance of the two residuals. Under conditional independence that covariance, and hence the expected product, is zero.