Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Time-Varying Effects in Cause-Specific Hazards

Competing Risks and Recurrent Events · Tutorial 420 of 697

Time-Varying Effects in Cause-Specific Hazards

Learn to specify and interpret time-varying marker effects in cause-specific hazards, and distinguish a changing hazard ratio from a changing longitudinal marker.

Advanced 12 min read

What You'll Learn

  • Define a time-varying association function for a cause-specific hazard.
  • Interpret the hazard ratio for a marker contrast at a specified event time.
  • Separate changes in the marker trajectory from changes in its hazard association.
  • Specify piecewise and smooth time-varying effects.
  • Identify assumptions, diagnostics, and limitations of these models.

Why Let a Marker Association Change Over Time?

A longitudinal marker can have a different association with different event causes, and its association with a particular cause need not remain constant over follow-up. For example, a one-unit increase in a marker might be weakly associated with one cause early in follow-up but more strongly associated later. A model with a constant marker coefficient cannot express that pattern.

Here the time-varying effect is a change in the marker’s association with the hazard as event time advances. It is not the same as a marker whose expected value changes over time. Both may occur, and the model must keep them distinct.

Definition: Let \(T_i\) be subject \(i\)'s event time, \(D_i\in\{1,\ldots,K\}\) its event cause, and \(m_i(t)\) the subject's latent longitudinal marker value at time \(t\). The cause-specific hazard for cause \(k\), conditional on being event-free just before \(t\), is the instantaneous rate of cause-\(k\) events at \(t\). A time-varying marker association represents its log-hazard coefficient by a function \(\alpha_k(t)\), rather than a constant.

Model and Interpretation

A common current-value specification is

$$ \lambda_{ik}(t\mid b_i,\mathbf{w}_i) = \lambda_{0k}(t) \exp\left\{ \boldsymbol{\gamma}_k^\mathsf{T}\mathbf{w}_i + \alpha_k(t)m_i(t) \right\}, \qquad k=1,\ldots,K. $$

Here \(\lambda_{0k}(t)\) is the cause-specific baseline hazard, \(\mathbf{w}_i\) contains covariates with coefficients \(\boldsymbol{\gamma}_k\), and \(b_i\) denotes the random effects used to describe subject-specific longitudinal trajectories and any modeled dependence. The function \(m_i(t)\) is the latent marker trajectory implied by the longitudinal model, not simply a noisy measurement taken at time \(t\). The association function \(\alpha_k(t)\) may differ by cause.

For two otherwise identical subjects whose latent marker values at time \(t\) differ by \(\Delta\), the conditional cause-\(k\) hazard ratio at that time is

$$ \operatorname{HR}_k(t;\Delta)=\exp\{\alpha_k(t)\Delta\}. $$

Thus, \(\alpha_k(t)\) is the conditional change in log hazard per one-unit difference in the marker at time \(t\). If the marker is measured in milligrams per litre, the one-unit contrast is one milligram per litre. A positive coefficient indicates a higher cause-specific hazard for the higher marker value at that time, conditional on the model. It is not, by itself, a causal effect.

The longitudinal trajectory and association function have different roles. A subject’s \(m_i(t)\) may rise even when \(\alpha_k(t)\) is constant. Conversely, \(\alpha_k(t)\) may vary while the trajectory for a particular subject is flat. In the model’s marker contribution to the log hazard, the product \(\alpha_k(t)m_i(t)\) can change because of either component or both.

Assumptions and Ways to Represent the Time Pattern

Interpretation and estimation require a coherent joint specification. The longitudinal model must describe the latent marker trajectory adequately, including its measurement scale and within-subject variability. The hazard model must use the intended marker feature and an appropriate form for \(\alpha_k(t)\). Conditional on the modeled covariates, latent trajectory or random effects, and event-free status, the cause-specific hazard must be correctly specified. If the joint model assumes longitudinal measurement errors and event times are conditionally independent given the shared random effects and covariates, that conditional-independence assumption must also be plausible. Censoring must be noninformative conditional on the variables included in the model, or its dependence must be modeled.

The analysis also needs sufficient event information across time to estimate the chosen function. In portions of follow-up with few cause-\(k\) events, the shape of \(\alpha_k(t)\) may be weakly identified. The function should be defined over the follow-up interval with meaningful data support; extrapolating its behavior well beyond that support is generally not justified. As in competing-risks analyses generally, an event from another cause removes a subject from the event-free risk set for cause \(k\).

A constant association, \(\alpha_k(t)=\alpha_k\), is the proportional-association special case. More flexible choices include a piecewise-constant function, a linear function of time, or a spline basis:

$$ \alpha_k(t)=\sum_{r=1}^{R}\theta_{kr}B_r(t), $$

where \(B_r(t)\) are specified basis functions and \(\theta_{kr}\) are estimated coefficients. Flexibility comes at a cost: too many parameters relative to the number and timing of events can produce unstable estimates, while an overly restrictive function can hide important variation. The time scale, knot locations or intervals, and any centering or scaling of the marker should be stated so the coefficient’s meaning is clear.

Worked Example: A Piecewise Effect for One Cause

Suppose a hypothetical joint model uses a marker measured in milligrams per litre and gives the cause-1 association function \(\alpha_1(t)=0.20\) per marker unit before 2 years and \(\alpha_1(t)=0.55\) per marker unit from 2 years onward. Compare two otherwise identical subjects whose latent marker values differ by 2 milligrams per litre.

At \(t=1.5\) years, the applicable coefficient is \(0.20\). Therefore

$$ \operatorname{HR}_1(1.5;2)=\exp(0.20\times 2)=\exp(0.40)=1.492. $$

At \(t=3\) years, the coefficient is \(0.55\), so

$$ \operatorname{HR}_1(3;2)=\exp(0.55\times 2)=\exp(1.10)=3.004. $$

At these times, the model associates the 2-milligram-per-litre contrast with cause-1 hazards about 1.49 and 3.00 times as large, respectively, conditional on the model. The contrast is the same at both times; the association function changes. These are cause-specific hazard comparisons, not comparisons of the probability of eventually experiencing cause 1.

Separating Trajectory Change from Association Change

For a given subject, the marker term in the log hazard is \(\alpha_k(t)m_i(t)\). Inspecting that product alone can make the two sources of change hard to separate. A useful interpretation reports both the predicted marker trajectory and the hazard ratio for a fixed marker contrast at selected event times. The fixed-contrast hazard ratio isolates the association function because \(\Delta\) is held constant.

Worked Example: A Rising Marker Is Not Necessarily a Rising Effect

Consider a hypothetical model for cause 2 in which one subject’s latent marker trajectory is \(m_i(t)=1+0.4t\), measured in milligrams per litre, and the association function is \(\alpha_2(t)=0.20\) per marker unit from 0 through 2 years and \(0.50\) per marker unit after 2 years. The trajectory rises steadily, while the association also changes at 2 years.

At \(t=1\), the marker value is \(1+0.4(1)=1.4\) milligrams per litre. The marker contribution to the log hazard, relative to marker value zero at the same time, is \(0.20(1.4)=0.28\); its hazard multiplier is

$$ \exp\{0.20(1.4)\}=\exp(0.28)=1.323. $$

At \(t=4\), the marker value is \(1+0.4(4)=2.6\) milligrams per litre. The corresponding multiplier is

$$ \exp\{0.50(2.6)\}=\exp(1.30)=3.669. $$

This comparison changes both the marker value and its coefficient. To isolate the time-varying association, compare a fixed one-unit marker contrast instead. Its hazard ratio is \(\exp(0.20)=1.221\) at 1 year and \(\exp(0.50)=1.649\) at 4 years. The trajectory rises at both times; the stronger fixed-contrast association after 2 years comes from the change in \(\alpha_2(t)\), not from the trajectory.

Inference, Diagnostics, and Alternatives

At a specified time \(t\), uncertainty in \(\alpha_k(t)\) should be propagated from the estimated parameters of its chosen representation. For example, for a spline representation, its estimated variance depends on the covariance matrix of the spline coefficients. Exponentiating an estimate gives a hazard ratio; exponentiating the endpoints of a confidence interval for \(\alpha_k(t)\Delta\) gives the corresponding interval for that contrast. Such an interval is usually pointwise: it addresses uncertainty at the selected time, not simultaneous coverage of the entire function over time.

Worked Example: A Time-Specific Hazard Ratio and Interval

Suppose a hypothetical linear association function for cause 1 is \(\alpha_1(t)=\theta_0+\theta_1t\), with estimated coefficients \(\hat{\theta}_0=0.30\) and \(\hat{\theta}_1=0.10\) per year. Suppose their estimated variances are \(0.0100\) and \(0.000400\), and their covariance is \(-0.00100\). The marker is measured in milligrams per litre.

At \(t=3\) years, the estimated coefficient per one-unit marker difference is

$$ \widehat{\alpha}_1(3)=0.30+0.10(3)=0.600. $$

Its estimated variance, using the variance of a linear combination, is

$$ \widehat{\operatorname{Var}}\{\widehat{\alpha}_1(3)\} =0.0100+3^2(0.000400)+2(3)(-0.00100)=0.007600, $$

so its standard error is \(\sqrt{0.007600}=0.08718\). A pointwise 95% Wald interval for the log hazard coefficient is \(0.600\pm1.96(0.08718)\), or \((0.4291,0.7709)\). Exponentiating gives the estimated hazard ratio and interval for a one-milligram-per-litre difference:

$$ \exp(0.600)=1.822, \qquad \left(\exp(0.4291),\exp(0.7709)\right)=(1.536,2.162). $$

At 3 years, the model therefore estimates a cause-1 hazard about 1.82 times as large for a one-milligram-per-litre higher latent marker value, with a pointwise 95% interval from about 1.54 to 2.16, conditional on the model. This is not a 95% probability statement about the fixed parameter.

Diagnostics should examine whether the estimated function is driven by a few events, whether its shape is sensitive to reasonable choices of time basis or knot placement, and whether estimates become erratic near the ends of follow-up. Plotting the estimated \(\alpha_k(t)\) with pointwise uncertainty alongside the event-time distribution for cause \(k\) helps reveal unsupported regions. Also check that the longitudinal model yields plausible trajectories; a misspecified latent trajectory can distort the estimated association function. A smooth-looking curve does not prove that the model assumptions hold.

The main alternative is a constant association. It is simpler and often more stable, but it can average over time-specific patterns. A piecewise function is easy to interpret within intervals but has abrupt jumps at cut points. A spline can represent gradual changes but depends on its basis and complexity. A time interaction written directly as marker-by-time terms is another parameterization of a time-varying effect; it does not remove the need to define the time scale and interpret the resulting function. A time-varying baseline hazard alone is not an alternative to a time-varying marker coefficient: \(\lambda_{0k}(t)\) permits the underlying hazard to vary over time, while \(\alpha_k(t)\) permits the marker contrast to vary.

A cause-specific hazard ratio is conditional on remaining event-free at the time being considered. It is not a cumulative-incidence ratio, and a time-varying hazard association does not by itself determine the direction or size of a change in cumulative incidence. Other causes’ hazards also affect who remains at risk. Further, estimates from an observational joint model describe conditional associations under its assumptions; they do not establish that changing the marker would change event risk.

Common Pitfall

Wrong reasoning: “The marker’s average value increases over follow-up, so its effect on the cause-specific hazard must also increase.” This confuses \(m_i(t)\) with \(\alpha_k(t)\). The marker can rise under a constant association, or the association can change while a marker trajectory remains flat. Correction: state which component changes, and interpret a fixed marker contrast using \(\exp\{\alpha_k(t)\Delta\}\) at a specified time. Also avoid describing the result as an effect on the probability of the event without accounting for the competing causes.

Key takeaway: A time-varying cause-specific association is a function \(\alpha_k(t)\) multiplying a specified longitudinal marker feature in the cause-\(k\) hazard. Report its time scale, marker contrast, cause, and uncertainty, and distinguish it from changes in the marker trajectory and from cumulative-incidence comparisons.

Check Your Understanding

Answer each question, then check the concise solutions below.

  1. If \(\alpha_k(2)=0.25\) per marker unit, what is the conditional cause-\(k\) hazard ratio at 2 years for a 3-unit marker contrast?
  2. Can a rising marker trajectory establish that \(\alpha_k(t)\) is increasing? Explain.
  3. Suppose the baseline hazard varies over time but \(\alpha_k(t)=0.40\) throughout. Is the marker association time-varying?
  4. Name one advantage and one limitation of a piecewise-constant association function compared with a spline.

Solutions. (1) \(\exp\{0.25(3)\}=\exp(0.75)=2.117\), so the modeled cause-specific hazard is about 2.12 times as large for the higher marker value at 2 years. (2) No. A rising trajectory concerns \(m_i(t)\); the association changes only if \(\alpha_k(t)\) changes. (3) No. A time-varying baseline hazard changes the baseline rate, not the marker coefficient. (4) A piecewise function is straightforward to interpret within intervals, but it imposes abrupt changes at its cut points; a spline can represent smoother variation but depends on its basis and complexity.

Clinical Biostats