Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › A Worked Workshop on Association-Link Calculations

Association Structures · Tutorial 212 of 697

A Worked Workshop on Association-Link Calculations

Learn to compute and interpret conditional hazard ratios from fitted association links by evaluating latent trajectories and combining their current values, slopes, and cumulative exposures.

Advanced 11 min read

What You'll Learn

  • Calculate a hazard ratio from a current-value association coefficient and two latent marker values.
  • Evaluate and compare latent trajectory slopes at a specified follow-up time.
  • Integrate marker trajectories from a stated time origin and retain the correct exposure units.
  • Combine current-value, slope, and cumulative-exposure contrasts on the log-hazard scale.
  • Check calculation direction, coefficient units, and the assumptions behind a plug-in hazard ratio.

From an Association Link to a Hazard Ratio

An association coefficient in a joint model is not itself a hazard ratio. It describes how a specified feature of a subject’s latent longitudinal trajectory contributes to the log hazard. To obtain a hazard ratio, evaluate that feature at the time of interest, compare the two profiles, multiply each contrast by its fitted coefficient, and exponentiate the resulting log-hazard contrast.

This workshop carries out those calculations for current value, slope, cumulative exposure, and a link combining all three. Each example is hypothetical. The calculations concern the instantaneous hazard at a specified time, conditional on the latent trajectories and on the model covariates; they do not directly give a ratio of event probabilities over a follow-up interval.

Definition: Let \(m_i(t)\) denote subject \(i\)'s latent marker trajectory at time \(t\), and let \(m_i'(t)\) be its instantaneous slope. Define cumulative exposure from time origin 0 as \(C_i(t)=\int_0^t m_i(u)\,du\). A proportional-hazards association model with all three components can be written as $$ h_i(t)=h_0(t)\exp\{\gamma^\top X_i+\alpha_v m_i(t)+\alpha_s m_i'(t)+\alpha_C C_i(t)\}, $$ where \(h_0(t)\) is the baseline hazard, \(X_i\) is a vector of covariates, \(\gamma\) is its coefficient vector, and \(\alpha_v,\alpha_s,\alpha_C\) are fitted association coefficients. A model with just one association component omits the other terms.

The slope is the derivative of the latent trajectory, not the difference between two noisy observed measurements. The cumulative component is an integral of the latent trajectory, not a sum of recorded measurements. If time is measured in years and the marker in mg/L, then \(m_i(t)\) has units mg/L, \(m_i'(t)\) has units mg/L per year, and \(C_i(t)\) has units mg/L-years. The corresponding coefficients have reciprocal units so that every exponent term is dimensionless.

The Comparison Formula

Compare profiles \(i\) and \(j\) at the same time \(t\). If they have the same covariates, the baseline hazard and covariate contribution cancel in the hazard ratio. Subtracting their log hazards and exponentiating gives the calculation used throughout this workshop.

$$ \log\!\left\{\frac{h_i(t)}{h_j(t)}\right\} =\alpha_v\{m_i(t)-m_j(t)\} +\alpha_s\{m_i'(t)-m_j'(t)\} +\alpha_C\{C_i(t)-C_j(t)\}, \qquad HR_{i:j}(t)=\exp\!\left[\log\!\left\{\frac{h_i(t)}{h_j(t)}\right\}\right]. $$

For a current-value-only link, retain only the first term; for a slope-only or cumulative-only link, retain only its corresponding term. If the covariates differ, add \(\gamma^\top(X_i-X_j)\) to the log-hazard contrast. The order of the profiles matters: reversing \(i:j\) changes the sign of the log contrast and gives the reciprocal hazard ratio.

Assumptions for these calculations: The model specifies a proportional-hazards form with the stated association terms and coefficients; at the comparison time, the same baseline hazard applies to both profiles. The examples hold covariates equal and treat the supplied fitted coefficients and latent trajectories as given. Thus each result is a plug-in, conditional comparison. It does not account for uncertainty in the coefficient estimates or latent trajectories.

Worked Calculations for Individual Links

Worked Example: Current-Value Link

Suppose a current-value-only model has fitted coefficient \(\alpha_v=0.30\) per mg/L. At \(t=2\) years, two hypothetical latent trajectories have values \(m_A(2)=5.0\) mg/L and \(m_B(2)=3.4\) mg/L. Their covariates are equal. Calculate the hazard ratio for profile A relative to profile B.

The current-value contrast is \(5.0-3.4=1.6\) mg/L. The log-hazard contrast is therefore \(0.30\;(\text{mg/L})^{-1}\times1.6\;\text{mg/L}=0.48\), which is dimensionless.

$$ HR_{A:B}(2)=\exp\{0.30(5.0-3.4)\} =\exp(0.48)=1.616. $$

At year 2, the model-implied instantaneous hazard for profile A is 1.616 times that for profile B, conditional on the model and the equal covariates. This is a hazard comparison, not a statement that A has 1.616 times the probability of an event by year 2.

Worked Example: Slope-Only Link

Suppose the fitted slope coefficient is \(\alpha_s=0.50\) per (mg/L per year). Consider the hypothetical trajectories \(m_A(t)=2+0.4t+0.1t^2\) and \(m_B(t)=2.5+0.1t+0.05t^2\), where \(t\) is in years and marker values are in mg/L. Find the slope-link hazard ratio at \(t=3\) years, comparing A with B. Assume equal covariates and a slope-only link.

Differentiate each trajectory with respect to time: \(m_A'(t)=0.4+0.2t\) and \(m_B'(t)=0.1+0.1t\), in mg/L per year. At \(t=3\), these are \(1.0\) and \(0.4\) mg/L per year, respectively. The slope contrast is \(1.0-0.4=0.6\) mg/L per year.

$$ HR_{A:B}(3)=\exp\{0.50(1.0-0.4)\} =\exp(0.30)=1.350. $$

The model-implied instantaneous hazard for A is 1.350 times that for B at year 3 under this slope-only link. The calculation uses the instantaneous derivatives at year 3, not the trajectories’ average changes over the interval from year 0 to year 3.

Worked Example: Cumulative-Exposure Link

At \(t=2\) years, suppose the fitted cumulative-exposure coefficient is \(\alpha_C=0.25\) per (mg/L-year). Let the hypothetical trajectories be \(m_A(u)=1.9+0.4u+0.1u^2\) and \(m_B(u)=2\) mg/L, with cumulative exposure measured from the common time origin \(u=0\). Calculate the cumulative-link hazard ratio for A relative to B.

Integrate each trajectory from 0 to 2 years: \(C_A(2)=\int_0^2(1.9+0.4u+0.1u^2)\,du =1.9(2)+0.4(2^2/2)+0.1(2^3/3) =3.8+0.8+0.266666\ldots=4.866666\ldots\) mg/L-years. For B, \(C_B(2)=\int_0^2 2\,du=4\) mg/L-years. Using the unrounded integral, the contrast is \(\Delta C(2)=(4.866666\ldots)-4=0.866666\ldots\) mg/L-years, approximately \(0.8667\) mg/L-years.

$$ HR_{A:B}(2) =\exp\{0.25(0.866666\ldots)\} =\exp(0.216666\ldots) =1.242. $$

The cumulative-only model therefore gives a conditional instantaneous hazard for A about 1.242 times that for B at year 2. The cumulative coefficient multiplies exposure accumulated from the specified origin; changing that origin or the exposure window changes the quantity being compared.

Combining Association Components

For a combined link, calculate each component contrast separately and add the coefficient-weighted contrasts on the log-hazard scale. Do not calculate separate hazard ratios and add them: exponentiation is applied once, after the log contributions have been summed.

Worked Example: Combined Current, Slope, and Cumulative Link

Suppose a fitted model has \(\alpha_v=0.20\) per mg/L, \(\alpha_s=-0.30\) per (mg/L per year), and \(\alpha_C=0.10\) per (mg/L-year). For two hypothetical profiles, let \(m_A(u)=3+0.4u+0.05u^2\) and \(m_B(u)=2.5+0.1u\), with time in years and marker in mg/L. Compare A with B at \(t=2\), with equal covariates.

The current values are \(m_A(2)=3+0.8+0.2=4.0\) mg/L and \(m_B(2)=2.5+0.2=2.7\) mg/L, so \(\Delta m(2)=1.3\) mg/L. The slopes are \(m_A'(u)=0.4+0.1u\) and \(m_B'(u)=0.1\); at year 2, their difference is \(0.6-0.1=0.5\) mg/L per year.

The cumulative exposures are \(C_A(2)=3(2)+0.4(2^2/2)+0.05(2^3/3)=6+0.8+0.133333\ldots=6.933333\ldots\) mg/L-years and \(C_B(2)=2.5(2)+0.1(2^2/2)=5+0.2=5.2\) mg/L-years. Thus \(\Delta C(2)=1.733333\ldots\) mg/L-years.

$$ \begin{aligned} \log HR_{A:B}(2) &=0.20(1.3)-0.30(0.5)+0.10(1.733333\ldots)\\ &=0.260-0.150+0.173333\ldots\\ &=0.283333\ldots,\\ HR_{A:B}(2)&=\exp(0.283333\ldots)=1.328. \end{aligned} $$

The negative slope coefficient makes the slope contribution negative, but the current-value and cumulative contributions are positive and larger in combination. The net fitted hazard ratio is about 1.328. This result is consistent with the specified direction A relative to B and the sum of the three contributions.

Calculation Checks, Alternatives, and Limitations

Several checks help catch errors before interpreting a result. First, label the comparison direction and subtract in that order: \(\Delta m=m_A-m_B\), for example. Second, verify that every coefficient is paired with a contrast in its stated units, making each product dimensionless. Third, calculate derivatives and integrals from the specified latent trajectory rather than substituting observed measurements. For a cumulative link, also verify the integration limits and time origin. Finally, retain enough digits during intermediate calculations and round only the reported result.

A useful short justification for the calculation is that the model gives \(h_i(t)=h_0(t)\exp\{\eta_i(t)\}\), where \(\eta_i(t)\) is the covariate and association contribution to the linear predictor. With shared baseline hazard, \(h_i(t)/h_j(t)=\exp\{\eta_i(t)-\eta_j(t)\}\). The identity \(\exp(a-b)=\exp(a)/\exp(b)\) yields the comparison formula above. If the covariates are not equal, their linear-predictor difference remains; it cannot be silently discarded.

The main alternative is to use a different association structure, such as current value alone rather than slope alone or a combined link. Each structure answers a different modeling question: a current-value link associates hazard with level, a slope link with rate of change, and a cumulative link with accumulated marker exposure over its defined window. Their numerical hazard ratios are not directly comparable as measures of association strength when the marker components have different units or scales. The earlier material on association structures treats those distinctions; here the practical point is to calculate each specified structure correctly.

These plug-in calculations have important limits. They do not provide a confidence interval or propagate uncertainty in the fitted coefficients and latent trajectories. They also do not establish that an association is causal. A conditional hazard ratio is not a risk ratio, and it does not give absolute event probability without further information about the baseline hazard and follow-up. If a calculated slope is unstable, the trajectory is poorly supported near the time of interest, or an integral uses an inappropriate origin, the arithmetic can be correct while the scientific interpretation remains unreliable.

Common Mistakes

  • Reading a coefficient as the hazard ratio. A coefficient is on the log-hazard scale; multiply it by the relevant contrast and exponentiate.
  • Adding component hazard ratios. The weighted component contrasts add on the log scale. Sum them first, then exponentiate once.
  • Ignoring direction or sign. A hazard ratio for A relative to B is the reciprocal of the ratio for B relative to A. Negative coefficients can reduce one component’s contribution without necessarily making the combined log contrast negative.
  • Mixing units or exposure definitions. A slope coefficient depends on the time unit, while a cumulative coefficient depends on both marker units and the integration window. Check these before substituting values.
  • Calling a hazard ratio a probability ratio. The ratio compares instantaneous hazards at a time, conditional on the model; it does not compare event probabilities over a period.
Key takeaway: Evaluate each latent trajectory feature at the requested time, form contrasts in a stated direction, multiply by the corresponding fitted coefficients, add on the log-hazard scale, and exponentiate once. Units, time origin, and comparison direction are part of the calculation, not details to add afterward.

Check Your Understanding

For each problem, identify the relevant contrast before computing the hazard ratio. Full solutions follow the questions.

  1. A current-value-only model has \(\alpha_v=0.20\) per mg/L. At a specified time, profiles P and Q have latent marker values 6 and 4 mg/L. Find \(HR_{P:Q}\).
  2. A slope-only model has \(\alpha_s=-0.40\) per (mg/L per year). At a specified time the slopes for P and Q are 0.5 and 1.0 mg/L per year. Find \(HR_{P:Q}\).
  3. A cumulative-only model has \(\alpha_C=0.10\) per (mg/L-year), and the cumulative exposures from the same origin are 12 and 9 mg/L-years. Find \(HR_{P:Q}\).
  4. In a combined model, the coefficient-weighted current-value, slope, and cumulative contributions to the P-versus-Q log-hazard contrast are \(0.12\), \(-0.08\), and \(0.06\). Find the hazard ratio and state why the three contributions should not be exponentiated and added separately.

Solutions. (1) The value contrast is \(6-4=2\) mg/L, so \(\log HR=0.20(2)=0.40\) and \(HR=\exp(0.40)=1.492\). (2) The slope contrast is \(0.5-1.0=-0.5\) mg/L per year, giving \(\log HR=(-0.40)(-0.5)=0.20\) and \(HR=\exp(0.20)=1.221\). (3) The cumulative contrast is \(12-9=3\) mg/L-years, so \(\log HR=0.10(3)=0.30\) and \(HR=\exp(0.30)=1.350\). (4) The total log contrast is \(0.12-0.08+0.06=0.10\), hence \(HR=\exp(0.10)=1.105\). Contributions add on the log-hazard scale because they are terms in the linear predictor; exponentiating their sum gives the corresponding hazard ratio.

Clinical Biostats