Why Preserve Change, Not Just Levels?
A time-varying covariate is not simply one value per participant. The sequence of values can describe both a participant’s typical level and how that participant’s level changes from occasion to occasion. Those are distinct sources of information. If an imputation procedure replaces every missing value with a participant’s mean, it may preserve a rough estimate of typical level while erasing the very fluctuations needed to study within-person change.
For example, a person’s blood pressure may generally be higher than another person’s, while also rising or falling over follow-up. A model of an outcome may distinguish the association with the person’s average blood pressure from the association with blood pressure being above that person’s own average at a particular time. Imputation should retain enough structure to estimate both associations. It should not collapse repeated observations into one summary value.
Write \(X_{ij}\) for a time-varying covariate measured for participant \(i\) at occasion \(j\), where \(i=1,\ldots,n\). Let \(t_{ij}\) denote the measurement time. In a completed imputed data set, define the participant mean and the occasion-specific deviation as
where \(m_i\) is the number of occasions represented for participant \(i\). The mean \(\bar{X}_i\) describes between-person level; \(X_{ij}^{W}\) describes within-person deviation. The deviations sum to zero across the occasions used to calculate the mean. When values are missing, these summaries must be formed from each completed data set, not treated as known constants.
Models That Represent Both Sources of Variation
A useful imputation model for a continuous repeated covariate is a multilevel model with participant-specific effects. A simple random-intercept and random-slope form is
Here, \(\beta_0+\beta_1t_{ij}\) describes the population-average time pattern; \(b_{0i}\) lets participant \(i\) have a different level; and \(b_{1i}\) lets that participant have a different time trend. A common model assumes the participant effects have a multivariate normal distribution with mean zero and covariance matrix \(G\), and that the residuals \(\epsilon_{ij}\) are independent normal errors with mean zero and variance \(\sigma^2\), conditional on the participant effects and included predictors. The covariance matrix \(G\) allows participant-specific levels and slopes to be associated.
These are modeling assumptions, not consequences of putting the data in long format. The time function should reflect plausible patterns; a straight-line trend may be inadequate if change is nonlinear. Additional predictors may be included when appropriate to the missingness and analysis models. If there is little information for estimating a participant’s slope, a random-slope model can be unstable; a random-intercept model or a simpler time structure may be more defensible.
In a MICE procedure, the conditional imputation model for \(X\) must account for repeated observations from the same participant. A multilevel conditional model can draw participant effects and residual variation as part of imputation. Drawing only fitted participant means, or inserting best linear predictions without uncertainty, understates variability. In addition, the conditional models used in chained equations need not automatically correspond to one coherent joint distribution. Their specifications should be checked for compatibility with the intended analysis and the repeated-measures structure.
A within-between outcome model often uses \(\bar{X}_i\) and \(X_{ij}^{W}\) as separate predictors:
In this model, \(\gamma_B\) describes the association between differences in participants’ average covariate levels and the outcome, while \(\gamma_W\) describes the association between an occasion-specific departure from a participant’s average and the outcome. These are associations, not necessarily causal effects. This decomposition is useful for understanding the analysis target, but it does not mean that \(\bar{X}_i\) and \(X_{ij}-\bar{X}_i\) should both be inserted as separate predictors when imputing \(X_{ij}\): they are algebraically constructed from \(X_{ij}\) itself. The imputation model must handle the repeated measurements coherently, for example through participant effects or carefully constructed summaries of other occasions.
A Conditional-Draw Derivation
A small random-intercept model shows why an imputation should combine a participant’s observed information with residual uncertainty. Suppose the time-adjusted covariate for a participant follows \(Z_{ij}=b_i+\epsilon_{ij}\), with \(b_i\sim N(0,\tau^2)\) and independent \(\epsilon_{ij}\sim N(0,\sigma^2)\). Assume these variances are known for this derivation. Given \(k\) observed adjusted values \(z_1,\ldots,z_k\), the conditional distribution of \(b_i\) is normal. Its precision is the prior precision plus the observed-data precision:
For a missing occasion with the same adjusted mean structure, the predictive distribution adds a new residual error. Thus its conditional mean is the posterior mean of \(b_i\), and its predictive variance is the posterior variance of \(b_i\) plus \(\sigma^2\). A draw from this distribution reflects the person’s observed level without pretending that the missing value is known exactly.
Worked Example: Drawing a Missing Occasion From Observed Repeats
Suppose a hypothetical participant has two observed time-adjusted covariate values, 4 and 6, and one missing value. Use the model above with \(\tau^2=4\) and \(\sigma^2=1\). Treat these variance values as known for this calculation.
There are \(k=2\) observations. The posterior variance of the participant effect is
The posterior mean is
The missing value therefore has predictive distribution \(N(4.444,\,0.4444+1)\), where the second argument is the variance. Its predictive standard deviation is \(\sqrt{1.444}=1.202\). If a hypothetical standard-normal draw is \(0.500\), one predictive draw is \(4.444+1.202(0.500)=5.045\). The imputed value is informed by the participant’s observed level but is not forced to equal their observed mean of 5. In an actual MICE procedure, model parameters and participant effects would also carry uncertainty rather than being known as they are here.
Separating Within-Person and Between-Person Information
The distinction matters because identical covariate values can have different meanings for different participants. An occasion value above one participant’s typical level may be below another participant’s typical level. A single population-wide regression term for \(X_{ij}\) can blend these two comparisons.
Worked Example: The Same Value, Different Deviations
Consider two hypothetical participants measured at three occasions. Participant A has values 2, 4, and 6, so \(\bar{X}_A=4\). Participant B has values 6, 8, and 10, so \(\bar{X}_B=8\). The grand mean of all six values is 6. At a particular occasion, each participant has \(X_{ij}=6\).
For participant A, the within-person deviation is \(6-4=2\), and the participant’s mean is \(4-6=-2\) relative to the grand mean. For participant B, the within-person deviation is \(6-8=-2\), and the participant’s mean is \(8-6=2\) relative to the grand mean. The same raw value of 6 is therefore above A’s typical level and below B’s.
For illustration, suppose a fitted outcome model assigns coefficient \(1.5\) per unit of within-person deviation and coefficient \(0.5\) per unit of participant mean relative to the grand mean. The covariate contribution for A is \(1.5(2)+0.5(-2)=3-1=2\). For B it is \(1.5(-2)+0.5(2)=-3+1=-2\). The difference in modeled contributions is \(2-(-2)=4\). These hypothetical coefficients illustrate the decomposition; they are not estimates from these six covariate values. If an occasion were missing, imputing a single value and then calculating these components would affect both the participant mean and the deviation.
Practical Imputation and Diagnostics
A sound workflow keeps the repeated measurements in their participant-and-occasion structure and uses an imputation model that reflects that structure. The participant mean and deviations used in the substantive analysis should be recalculated within every completed data set. If they are used as imputation predictors, their construction needs special care: a summary that includes the target value can create circularity. A multilevel model with latent participant effects avoids treating a target-containing mean as an independent predictor; alternative summary-based methods must specify how summaries are constructed and what happens when little observed data are available for a participant.
Identify the participant, occasion, measurement time, and the covariate values that may be missing. Choose a plausible time pattern and participant-level structure.
Include participant-level dependence, such as random intercepts and, when supported, random slopes. Include relevant observed predictors and represent time adequately.
Each imputation should reflect residual and parameter uncertainty, as well as uncertainty about participant effects. Repeat the chained-equation updates to create multiple completed data sets.
Compare observed and imputed values by occasion and missingness pattern, and assess whether between-person spread and within-person variation remain plausible.
Diagnostics should examine more than the overall distribution of the imputed covariate. Compare observed and imputed means, spreads, and ranges by time; inspect participant trajectories; and compare within-person variability and between-person variability. For continuous covariates, the intraclass correlation, the fraction of variation attributable to differences between participants under a specified model, can help reveal whether imputation has greatly changed the clustering structure. Also check whether fitted time trends and residual patterns are plausible. A narrow pile of imputed values, implausibly smooth trajectories, or almost no within-person variation can signal over-shrinkage or deterministic prediction.
Such diagnostics can reveal a poor model but cannot prove that missingness assumptions are true. As in other missing-data analyses, inference relies on assumptions about the relationship between missingness and observed or unobserved values. A common working assumption is that missingness is conditionally independent of the missing value given variables included in the imputation model. If that assumption is doubtful, sensitivity analysis may be needed; no trajectory diagnostic alone resolves the issue.
Worked Example: Detecting Over-Smoothing
In a hypothetical three-occasion study, suppose participant A has observed covariate values 2 and 6, with the middle occasion missing; participant B has observed values 8 and 12, also with the middle occasion missing. The observed endpoints suggest linear interpolated values of 4 for A and 10 for B. Linear interpolation is a deterministic reference, not a full imputation model.
Suppose a fitted multilevel imputation model gives predictive means of 4 and 10 at the missing occasions and predictive standard deviations of 1.0 for each. For illustrative standard-normal draws of \(0.60\) for A and \(-0.80\) for B, the imputed values are \(4+1.0(0.60)=4.60\) and \(10+1.0(-0.80)=9.20\). Both draws retain the overall difference in participant levels while allowing occasion-specific deviations. If instead both values were always set to their predictive means, the imputed occasions would contribute no residual variation. Reviewing the resulting trajectories and within-person spread would help identify this over-smoothing, although the appropriate amount of variation depends on the fitted model and observed data.
Common Pitfalls and Alternatives
A single-level imputation model that treats every row as independent ignores the dependence between measurements from the same participant. It can produce unrealistic combinations of within- and between-person variation, even if its overall mean looks reasonable. Conversely, imputing one participant mean and copying it into every missing occasion suppresses within-person change. Last observation carried forward is another deterministic substitution and does not represent the uncertainty or changing trajectories needed for valid inference.
Wide-format imputation, in which each occasion is a separate variable, can preserve occasion-specific distributions and associations, but it can become unwieldy with many occasions and may not represent participant-level trajectory structure well. A multilevel long-format model directly models clustering and time, but requires suitable model assumptions, adequate information, and implementation that draws uncertainty correctly. The choice is not simply between long and wide data: the conditional models must be appropriate to the analysis and the missingness structure.
- Do not equate prediction with imputation. A fitted mean or participant-specific best prediction omits residual uncertainty unless an appropriate stochastic draw is added.
- Do not use a target-containing summary as if it were external information. A person mean calculated from a value being imputed is mathematically dependent on that value.
- Do not assume that random slopes are always better. They may be weakly identified with few occasions or sparse observations; use a time structure supported by the data.
- Do not judge preservation from the pooled mean alone. Similar overall means can conceal collapsed within-person spread or distorted trajectories.
The central practical principle is that imputation should preserve the features the analysis needs. When the analysis separates participant averages from occasion-specific deviations, the imputation model must retain both sources of information and uncertainty. A model that only reproduces cross-sectional distributions can still be inadequate for longitudinal inference.
Check Your Understanding
Answer each question, then compare with the solutions below.
- For a participant with completed values 3, 5, and 7, calculate the participant mean and each occasion’s within-person deviation.
- Why is replacing a missing value by the participant’s observed mean not equivalent to a stochastic multilevel imputation?
- In the conditional-draw example, how would the predictive variance change if \(\sigma^2\) increased while the observed data and \(\tau^2\) stayed fixed?
- Explain why the same raw covariate value can represent different within-person information for two participants.
- Name two diagnostics that can reveal loss of within-person structure, and state one limitation of those diagnostics.
Solutions. (1) The mean is \((3+5+7)/3=5\); the deviations are \(3-5=-2\), \(5-5=0\), and \(7-5=2\). (2) Mean replacement gives a fixed value and does not represent residual or parameter uncertainty; it can also suppress within-person variation. A stochastic multilevel imputation draws a value from a conditional predictive distribution. (3) Predictive variance is the posterior variance of the participant effect plus \(\sigma^2\). Increasing \(\sigma^2\) increases the new-occasion residual component and also reduces the precision contributed by each observed value, so the total predictive variance increases. (4) Within-person information is the raw value minus that participant’s mean. Different participant means therefore give different deviations for the same raw value. (5) Comparing imputed and observed within-person spreads and inspecting participant trajectories are two options. These checks can identify implausible patterns but cannot establish that the missingness assumptions are true.