Tutorials › Pattern-Mixture and Selection Models › Random-Slope Links and Time-Varying Dropout Risk

Shared-Parameter Models · Tutorial 444 of 499

Random-Slope Links and Time-Varying Dropout Risk

Build a longitudinal outcome and dropout model that shares random slopes, and see how trajectory heterogeneity can create time-varying dropout risk.

Advanced 13 min read

What You'll Learn

  • Specify a longitudinal outcome model with subject-specific random intercepts and slopes.
  • Link a random slope to a subject-specific dropout hazard.
  • Derive conditional survival from the hazard and calculate dropout probabilities.
  • Distinguish a subject-specific hazard from the hazard averaged across subjects.
  • Identify assumptions, diagnostics, and limitations of a random-slope link.

Why Share a Random Slope?

A random-intercept link allows subjects with different underlying outcome levels to have different dropout risks. But subjects can also differ in how their outcomes change over time. If those trajectory differences are related to dropout, a random intercept alone may miss an important feature: dropout risk can depend on a subject’s rate of change, and that dependence can itself evolve over follow-up.

For example, suppose an outcome is declining for everyone on average, while some subjects decline faster than others. If faster decline is associated with a greater dropout hazard, then the contribution of that subject’s trajectory to the hazard can grow as time passes. A shared-random-slope model represents this link by putting the same subject-specific slope in both the longitudinal outcome model and the dropout model.

A Longitudinal Model and a Dropout Link

Let \(Y_{ij}\) be the continuous outcome for subject \(i\) at time \(t_{ij}\), measured in months, and let \(D_i\) be that subject’s dropout time. A basic linear mixed model for the outcome is

$$ Y_{ij}=\beta_0+\beta_1t_{ij}+b_{0i}+b_{1i}t_{ij}+\varepsilon_{ij}. $$

Here \(\beta_0\) and \(\beta_1\) describe the population-average intercept and slope. The random intercept \(b_{0i}\) and random slope \(b_{1i}\) describe subject-specific departures from those values. The residuals \(\varepsilon_{ij}\) are commonly modeled as independent \(N(0,\sigma^2)\) variables conditional on the random effects. A standard starting assumption is

$$ \begin{pmatrix}b_{0i}\\b_{1i}\end{pmatrix} \sim N\left[ \begin{pmatrix}0\\0\end{pmatrix}, \begin{pmatrix}\tau_{00}&\tau_{01}\\\tau_{01}&\tau_{11}\end{pmatrix} \right]. $$

The covariance \(\tau_{01}\) allows a subject’s starting level and trajectory slope to be associated. The distribution is across subjects; conditional on a subject’s random effects, the subject’s outcome trajectory has a specific intercept and slope.

Definition: A shared-random-slope link is a joint model in which a subject-specific random slope in the longitudinal outcome model also enters that subject’s dropout hazard. One illustrative continuous-time specification is $$ \lambda_i(t\mid b_{0i},b_{1i})=\lambda_0(t)\exp\{\gamma_0b_{0i}+\gamma_1b_{1i}t\}, $$ where \(\lambda_0(t)\) is a nonnegative baseline hazard and \(\gamma_0,\gamma_1\) are association parameters.

A hazard is an instantaneous event rate conditional on having remained under observation and event-free up to time \(t\). In this model, \(\gamma_1b_{1i}t\) is the time-evolving contribution of the subject’s random slope. If \(\gamma_1>0\), then, at a fixed \(t>0\), a larger \(b_{1i}\) raises the hazard relative to a subject with the same intercept and other modeled features but \(b_{1i}=0\). This is an association specified by the model, not a claim that the outcome trajectory causes dropout.

The time scale and units matter. If the outcome is measured in points, then \(b_{1i}\) is in points per month, and \(b_{1i}t\) is in points. The coefficient \(\gamma_1\) must therefore convert points into a dimensionless quantity in the exponent. The hazard itself has units of inverse months when time is measured in months. Time should be centered and scaled deliberately: the random intercept refers to the outcome at \(t=0\), and the slope contribution to the hazard is zero at that time in this particular parameterization.

Assumptions and Conditional Survival

The shared-random-slope construction relies on explicit assumptions. The outcome model must be an adequate description of the longitudinal mean pattern over the modeled time range, including its linear subject-specific slope. The random-effects distribution and covariance must be suitable for the population being represented. Conditional on the shared random effects and any included covariates, the outcome residual process and dropout process are assumed independent; this is the conditional-independence structure that lets the random effects link the two processes. The hazard form must also be plausible, and dropout times and observation times must be recorded on a scale compatible with it.

Given the random effects, the probability of remaining observed beyond time \(t\) is the conditional survival function. Its relation to the hazard is

$$ S_i(t\mid b_{0i},b_{1i}) =\exp\left\{-\int_0^t\lambda_i(u\mid b_{0i},b_{1i})\,du\right\}. $$

The integral is the cumulative hazard. It accumulates the instantaneous dropout rate over time; it is not itself a probability. Conditional dropout probability by time \(t\) is \(1-S_i(t\mid b_{0i},b_{1i})\). Since the hazard depends on \(b_{1i}u\), the slope’s contribution to the cumulative hazard changes throughout follow-up.

Worked Example: Comparing Two Outcome Trajectories

Consider a hypothetical outcome measured in points, with population mean trajectory \(50-0.5t\), where \(t\) is months. Subject A has \(b_{0A}=2\) points and \(b_{1A}=0.3\) points per month. Subject B has \(b_{0B}=-1\) point and \(b_{1B}=-0.2\) points per month. Ignore residual noise to compare their fitted trajectories.

For subject A, the fitted mean is \(50-0.5t+2+0.3t=52-0.2t\). At 8 months, this is \(52-0.2(8)=52-1.6=50.4\) points. For subject B, the fitted mean is \(50-0.5t-1-0.2t=49-0.7t\), giving \(49-0.7(8)=49-5.6=43.4\) points at 8 months.

The subjects differ in both their starting levels and their slopes. A random-intercept-only link could represent the difference in starting level, but not the fact that their trajectories diverge over time. A shared-slope hazard can represent an association between this slope difference and changing dropout risk.

How the Slope Changes Dropout Risk

The next example isolates the slope contribution. Suppose the baseline hazard is constant at \(0.04\) per month, \(b_{0i}=0\), \(\gamma_1=0.25\) per outcome point, and a subject’s random slope is \(b_{1i}=0.4\) point per month. With time in months, the hazard becomes

$$ \lambda_i(t\mid b_{1i}=0.4)=0.04\exp\{0.25(0.4)t\} =0.04\exp(0.1t). $$

The rate is \(0.04\) per month at month 0 and \(0.04e^1\approx0.1087\) per month at month 10. This increasing conditional hazard follows from the specified positive slope association; it is not a general consequence of having a random slope. The baseline hazard and the values and signs of the association parameters also matter.

Worked Example: Ten-Month Dropout Probability for a Positive Slope

Continue with the hypothetical hazard \(\lambda_i(t)=0.04\exp(0.1t)\), for \(0\leq t\leq10\) months. The assumptions for this calculation are the stated hazard form, constant baseline hazard, and fixed subject-specific slope \(b_{1i}=0.4\); it is a conditional calculation, not a population-average prediction.

The cumulative hazard through month 10 is

$$ H_i(10)=\int_0^{10}0.04e^{0.1u}\,du =\frac{0.04}{0.1}(e^1-1) =0.4(2.71828-1) \approx0.6873. $$

Thus the conditional probability of remaining free of dropout through month 10 is \(e^{-0.6873}\approx0.5029\). The conditional probability of dropout by month 10 is \(1-e^{-0.6873}\approx1-0.5029=0.4971\), or about 49.7%. This probability applies to a subject with the specified random effects under the assumed model.

Why the Population Risk Is Not the Risk at the Average Slope

A subject-specific hazard is conditional on that subject’s random effects. To obtain population survival, average the conditional survival probabilities over the random-effects distribution:

$$ S_{\mathrm{marg}}(t)=E_b\{S_i(t\mid b_{0i},b_{1i})\}. $$

It is generally incorrect to calculate the population survival by substituting the mean random effects into the conditional formula. The exponential transformation and subsequent averaging do not commute. Further, the marginal hazard among those still observed changes because the mix of random effects among survivors changes over time.

Derivation: Since \(S_{\mathrm{marg}}(t)=E_b\{S_i(t\mid b)\}\), differentiating gives $$ -\frac{d}{dt}S_{\mathrm{marg}}(t)=E_b\{\lambda_i(t\mid b)S_i(t\mid b)\}. $$ The marginal hazard is therefore $$ \lambda_{\mathrm{marg}}(t) =\frac{E_b\{\lambda_i(t\mid b)S_i(t\mid b)\}} {E_b\{S_i(t\mid b)\}}. $$ The weights in this ratio are proportional to conditional survival: subjects with random effects associated with earlier dropout contribute less among those who remain. Thus the population hazard is not simply the average of the individual hazards in the original population.

Worked Example: Marginalizing Over Two Slope Groups

For a transparent hypothetical calculation, suppose half the population has \(b_{1i}=0.4\) and half has \(b_{1i}=-0.4\) points per month; both groups have \(b_{0i}=0\). Keep \(\lambda_0=0.04\) per month and \(\gamma_1=0.25\) per point. This two-point distribution is used for arithmetic illustration rather than the normal random-effects assumption above.

For the positive-slope group, the cumulative hazard through month 10 is \(0.6873\), as calculated above, and survival is \(e^{-0.6873}\approx0.5029\). For the negative-slope group, the hazard is \(0.04e^{-0.1t}\). Its cumulative hazard is

$$ H_-(10)=\int_0^{10}0.04e^{-0.1u}\,du =\frac{0.04}{0.1}(1-e^{-1}) =0.4(1-0.36788) \approx0.2528. $$

The negative-slope group’s survival is \(e^{-0.2528}\approx0.7766\). Therefore marginal survival is \((0.5029+0.7766)/2=0.63975\), approximately \(0.6398\); marginal dropout probability is \(1-0.63975=0.36025\), approximately 36.0%.

The average slope in this constructed population is zero. Substituting that slope into the conditional hazard gives a constant hazard of \(0.04\) per month and survival \(e^{-0.04(10)}=e^{-0.4}\approx0.6703\), which is not the marginal survival \(0.6398\). This discrepancy illustrates why population risk requires averaging conditional survival over the distribution of random effects.

Diagnostics, Alternatives, and Limitations

The shared-slope link is useful when scientific reasoning suggests that trajectory rates, rather than only outcome levels, relate to dropout. It also imposes structure: the same latent slope that governs the outcome trajectory is assumed to help explain dropout. That structure may be wrong even if both component models appear individually plausible.

Useful checks include comparing observed dropout patterns across follow-up with model-implied patterns, examining whether fitted outcome trajectories capture curvature or important subgroup differences, and checking whether estimated slope variation is supported by repeated outcome measurements. In a fitted model, inspect whether the implied subject-specific hazards behave plausibly over the observed time range. Extreme hazards, strong dependence on a few subjects, or a pattern of observed dropout that the fitted model systematically misses are warnings. These checks cannot establish the untestable assumption that the chosen random-effects distribution adequately represents unobserved trajectories.

ApproachWhat it links to dropoutMain distinction
Shared random interceptSubject-specific outcome levelDoes not directly represent an association with trajectory rate
Shared random slopeSubject-specific rate of outcome change, possibly alongside the interceptAllows the slope contribution to risk to evolve over follow-up
Dropout model using observed historyPreviously observed outcome valuesUses recorded history directly rather than a shared latent trajectory effect

These approaches answer related but different modeling questions. A random-slope link may be hard to distinguish empirically from other explanations for dropout, especially with few outcome measurements per subject or little variation in follow-up. The chosen linear trajectory can also be inadequate when the outcome changes nonlinearly. A nonlinear or piecewise trajectory would require a corresponding, carefully defined link to dropout rather than assuming the linear-slope formula still applies.

Finally, a fitted association parameter is conditional on the model’s assumptions. It does not by itself establish a causal mechanism, and conditional dropout probabilities are not automatically population-average probabilities. Because dropout depends on unobserved random effects in this formulation, conclusions about unobserved outcomes can be sensitive to the assumed random-effects distribution and hazard link. Report that dependence as part of the interpretation.

Common Mistake

A common error is to conclude that a positive shared-slope coefficient means every subject with a positive outcome slope has a higher dropout risk at every time. The model says something narrower: holding the other modeled terms fixed, the slope contribution to the log hazard is \(\gamma_1b_{1i}t\). Its direction depends on the signs of both \(\gamma_1\) and \(b_{1i}\), and its size depends on time. The baseline hazard and random-intercept term also contribute to the total hazard. A second error is to average random effects first and then compute a dropout probability. As the marginal-survival derivation shows, survival must be averaged over conditional survival, not calculated solely at the mean random effects.

Key takeaway: A shared random slope connects a subject’s trajectory rate to dropout risk. Because the slope term changes with time, subjects can have different evolving conditional hazards; population risk must additionally average over the random-effects distribution.

Check Your Understanding

Answer each question, then compare with the brief solutions.

  1. In the outcome model, what does \(b_{1i}\) represent, and what are its units if the outcome is in millimeters and time is in months?
  2. If \(\gamma_1>0\) and \(b_{1i}<0\), does the slope term raise or lower the hazard relative to \(b_{1i}=0\) at \(t>0\), all else equal?
  3. Why is the population survival generally not the conditional survival evaluated at the mean random effects?
  4. For the hazard \(\lambda(t)=0.02e^{0.05t}\), calculate the cumulative hazard from 0 to 10 months and express the conditional dropout probability.
  5. Name one assumption whose failure could make the shared-random-slope link misleading.

Solutions. (1) It is subject \(i\)’s deviation in outcome change per month from the population slope; its units are millimeters per month. (2) It lowers the hazard contribution, because \(\gamma_1b_{1i}t<0\), so its exponential is below 1. (3) The survival transformation is nonlinear, so \(E_b\{S(t\mid b)\}\) generally differs from \(S(t\mid E_b[b])\). (4) \(H(10)=\int_0^{10}0.02e^{0.05u}du=(0.02/0.05)(e^{0.5}-1)\approx0.2595\). Thus dropout probability is \(1-e^{-0.2595}\approx0.2285\), or 22.9%. (5) Examples include an inadequate linear trajectory, a misspecified random-effects distribution, or residual dependence between outcome and dropout after conditioning on the shared effects.

Clinical Biostats