From a Latent Trajectory to a Slope
A slope-based association uses the rate of change in a subject’s underlying marker trajectory, not the change between two raw measurements. Deriving that rate begins with the trajectory specified by the longitudinal model. In a linear mixed-effects model, the fixed time coefficient gives the average linear trend, while a subject-specific random time coefficient allows that subject’s trend to differ.
Let \(Y_{ij}\) be the marker measured for subject \(i\) at time \(t_{ij}\). A simple linear mixed-effects model is
Here \(m_i(t)\) is the subject’s latent, or underlying, marker trajectory; \(\beta_0\) and \(\beta_1\) are fixed effects; and \(b_{0i}\) and \(b_{1i}\) are subject-specific random effects for the intercept and time coefficient. The residual \(\epsilon_{ij}\) describes measurement-level variation around the latent trajectory. The time variable and marker must have defined units: for example, if \(t\) is in years and the marker is measured in points, a trajectory slope is in points per year.
This distinction is central: differentiating the trajectory is not the same as differentiating an individual observed value. The residual \(\epsilon_{ij}\) is measurement-level noise and is not part of the latent slope used in the association. The introductory material on slope association establishes the role of a marker’s rate of change in the hazard; here the objective is to derive that rate from the specified mixed trajectory.
Deriving the Subject-Specific Slope
For the linear trajectory, collect the intercept and time terms:
The derivative can be verified directly from its difference quotient. For any nonzero increment \(h\),
This expression does not depend on \(h\) or \(t\), so its limit as \(h\) approaches zero is also \(\beta_1+b_{1i}\). The fixed slope \(\beta_1\) describes the population-level linear trend in the model, while the subject-specific slope adds the subject’s random deviation \(b_{1i}\). The intercept terms disappear because a constant has derivative zero.
This calculation presumes that a linear trajectory is an adequate representation over the time range where the slope is used. It also presumes that the model’s time variable and scale are the intended ones. If the trajectory is not linear, its derivative may vary with time; the constant-slope result above would then not apply.
Worked Example: Differentiating a Subject’s Trajectory
Suppose a hypothetical marker is measured in points and time is measured in years. For a subject, the fitted trajectory is
The fixed time coefficient is \(0.8\) points per year, and this subject’s random time coefficient is \(-0.3\) points per year. Differentiate the fixed and random terms:
Equivalently, the trajectory simplifies to \(m_i(t)=12+0.5t\). Its intercept is 12 points, but that level does not affect the slope. The subject’s latent marker level is increasing at 0.5 points per year at every time in the modeled range.
Linking the Slope to the Event Hazard
A slope-based shared-random-effects hazard model puts the latent slope into the log hazard. One form is
where \(h_i(t\mid b_i,\mathbf{w}_i)\) is subject \(i\)’s hazard at time \(t\), conditional on the subject-specific random effects and covariates; \(h_0(t)\) is the baseline hazard; \(\mathbf{w}_i\) is a vector of other covariates; \(\boldsymbol{\gamma}\) is its coefficient vector; and \(\alpha_s\) is the slope-association parameter. The hazard is an instantaneous event rate among subjects still event-free at time \(t\), conditional on the specified information. This model assumes a proportional-hazards link for the included terms and uses the latent trajectory slope, not the observed marker.
For a linear trajectory, substitution gives
To compare two subjects at the same event time, hold their other covariates equal and compare their latent slopes \(s_A\) and \(s_B\). Dividing their hazards cancels the common baseline hazard and covariate contribution:
Thus the hazard ratio is determined by the slope difference and its coefficient. A positive \(\alpha_s\) means that, for otherwise equal covariates, a subject with a higher latent slope has a higher hazard than a subject with a lower slope. The comparison is conditional and associational; it does not establish that changing a subject’s marker slope would cause a change in event risk.
Worked Example: Hazard Ratio for Two Different Slopes
Suppose a hypothetical marker is measured in units and time is measured in months. The fitted slopes are \(s_A=0.6\) units per month and \(s_B=0.1\) units per month. Suppose the slope coefficient is \(\alpha_s=0.7\) per unit of slope, and the two subjects have the same other covariates.
The slope difference is
The slope-based hazard ratio is
At the same event time and with equal other covariates, the model therefore assigns subject A about 1.42 times the instantaneous hazard of subject B. This is a conditional hazard comparison, not a statement that A has a 42% higher event probability over a fixed follow-up period.
What the Slope Contribution Does—and Does Not—Vary With
In a linear trajectory, \(m_i'(t)=\beta_1+b_{1i}\) is constant in time. The slope contribution to the hazard is therefore constant for a given subject, even though the baseline hazard \(h_0(t)\) may vary over time. A subject’s hazard can change over follow-up because the baseline hazard changes; the slope-based multiplier itself does not change under this linear specification.
The subject-specific part of the slope is \(b_{1i}\). If subjects differ in slopes, contrasts between their slopes can produce different slope-related hazard multipliers. If the fitted model has no subject-specific time coefficient, then every subject has slope \(\beta_1\), and there is no between-subject slope contrast. In that case a shared term \(\alpha_s\beta_1\) multiplies every hazard by the same factor and can be absorbed into the baseline hazard; it does not distinguish subjects by their slopes.
Worked Example: No Between-Subject Slope Contrast
Consider the hypothetical model \(m_i(t)=5+b_{0i}+0.4t\), with a marker measured in points and time in years. There is a subject-specific random intercept but no subject-specific random time coefficient. For every subject,
For any two subjects \(A\) and \(B\), the slope difference is \(0.4-0.4=0\). Their slope-based hazard ratio, if their other covariates are equal, is
The random intercepts can give the subjects different marker levels, but they do not create different slopes. Consequently, this model’s slope term cannot rank these subjects by slope-related hazard. A fitted model that claims a subject-varying slope association needs meaningful slope variation in the modeled trajectories to support that interpretation.
Assumptions, Diagnostics, and Alternatives
The derivation and hazard-ratio interpretation require several conditions. The longitudinal trajectory must be differentiable and suitably specified over the relevant follow-up; for the formula \(\beta_1+b_{1i}\), it must be linear in time. The hazard model must use that latent derivative in the stated log-linear form. The hazard ratio comparison also holds the event time and other covariates fixed. In a joint analysis, the event model is interpreted conditional on the shared subject-specific effects and covariates; censoring must be handled under assumptions appropriate to the analysis.
Useful checks focus on whether the fitted model supplies a meaningful derivative and contrast:
- Check trajectory shape. Systematic curvature or time-patterned residuals can indicate that a straight line is inadequate. A constant derivative from a poor trajectory fit may not describe the marker’s actual rate of change.
- Check individual information. Sparse or uneven marker measurements can make subject-specific trajectories imprecise. The latent slope is model-based and should not be presented as though it were directly observed without uncertainty.
- Check slope variation. If estimated subject-specific slopes barely vary, there may be little information for comparing hazards by slope. A random-intercept-only model has no between-subject slope contrast.
- Check the meaning of units. The numerical slope and the numerical value of its coefficient depend on the units used. Report the marker and time units when interpreting a slope or its hazard ratio.
The main alternatives answer related but different questions. A current-value association relates the hazard to the latent marker level at time \(t\), whereas a slope association relates it to the rate of change. A slope computed from observed measurements is a different quantity: it can be strongly affected by measurement error and by which observations happen to be available. The latent derivative uses the trajectory model to separate the underlying trend from measurement-level noise. These approaches are not interchangeable; the choice should follow the scientific question and the adequacy of the data and model.
A further limitation is that a linear trajectory forces the slope to be constant over time. If the scientific question concerns a rate that changes over follow-up, this model’s derivative cannot represent that changing rate. The slope-based hazard ratio also describes a conditional comparison under the specified model, not a causal effect or a direct comparison of cumulative event probabilities.
Common Mistake
A frequent error is to use \(b_{0i}\), or the subject’s marker level, as if it were the slope. For \(m_i(t)=\beta_0+\beta_1t+b_{0i}+b_{1i}t\), the intercept terms \(\beta_0+b_{0i}\) describe level, while differentiation gives \(\beta_1+b_{1i}\). Another error is to insert a raw observed change into the hazard model without recognizing that measurement noise can distort it. The correction is to differentiate the fitted latent trajectory first, then use that derivative in the hazard-ratio contrast.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A fitted trajectory is \(m_i(t)=7+1.1t-2+0.2t\), with marker units and time in years. What is the subject-specific latent slope?
- Two otherwise comparable subjects have slopes of \(-0.2\) and \(0.3\) marker units per year. If \(\alpha_s=0.5\) per unit of slope, what is the hazard ratio for the second subject relative to the first?
- Why does a random intercept not change the derivative of a linear trajectory?
- A model has a random intercept but a common fixed time coefficient only. Can its slope term distinguish subjects’ hazards? Explain.
- Why is a noisy difference between two observed marker measurements not automatically the latent slope for the hazard model?
Solutions. (1) Differentiate the time terms: \(1.1+0.2=1.3\) marker units per year. The intercept terms \(7-2\) have derivative zero. (2) The slope difference is \(0.3-(-0.2)=0.5\) units per year, so the ratio is \(\exp(0.5\times0.5)=\exp(0.25)\approx1.284\). The second subject has about 1.28 times the conditional hazard. (3) A random intercept is constant in time, and the derivative of a constant is zero. (4) No. Every subject has the same slope, so the slope contrast is zero and the term cannot distinguish their hazards by slope. (5) The observed difference includes measurement-level noise and depends on the observations available; the latent slope is derived from the modeled underlying trajectory.