Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Weighted Cumulative Associations

Association Structures · Tutorial 202 of 697

Weighted Cumulative Associations

Learn to define a weighted integral of a latent marker trajectory, calculate it for specified weights, and interpret its contribution to the conditional event hazard.

Advanced 10 min read

What You'll Learn

  • Define a weighted cumulative association using a latent marker trajectory and a time-dependent weight function.
  • State the conditions needed to use the weighted integral in a hazard model.
  • Calculate weighted exposure for linear and piecewise trajectories.
  • Derive a conditional hazard ratio from the difference in weighted exposures.
  • Diagnose problems with weight specification, trajectory estimates, and interpretation.
  • Compare weighted cumulative links with uniform cumulative, windowed, current-value, and slope links.

Why Weight a Cumulative Association?

A cumulative association allows the event hazard to depend on a marker’s history, rather than only its value at the event time. The ordinary cumulative exposure gives equal weight to each instant in the history. A weighted cumulative association makes that contribution depend on a specified weighting function: some parts of the latent trajectory can contribute more to the association than others.

The weighting function is part of the model, not a feature discovered automatically by integrating the data. It must be defined on the time interval of interest, and its shape determines how the trajectory enters the hazard. This tutorial focuses on that construction and its consequences for interpreting the association parameter.

Definition: Let \(m_i(s)\) denote the latent marker trajectory for individual \(i\), and let \(w(t,s)\) be a specified weight at event time \(t\) for marker time \(s\), where \(0\leq s\leq t\). The weighted cumulative exposure at time \(t\) is $$ A_i^w(t)=\int_0^t w(t,s)m_i(s)\,ds. $$ If \(w(t,s)=1\) throughout the interval, this reduces to the unweighted cumulative exposure \(\int_0^t m_i(s)\,ds\).

A common joint-model association link puts this quantity into the event hazard:

$$ h_i(t\mid b_i)=h_0(t)\exp\{\gamma^\top X_i+\alpha A_i^w(t)\}. $$

Here \(h_i(t\mid b_i)\) is the hazard conditional on the individual’s latent trajectory (represented by random effects \(b_i\)) and covariates \(X_i\); \(h_0(t)\) is the baseline hazard; \(\gamma\) is the covariate coefficient vector; and \(\alpha\) is the weighted cumulative association parameter. The hazard is instantaneous event rate among individuals still event-free at \(t\), conditional on the stated information. The latent marker is used because observed longitudinal measurements include measurement error.

Conditions for a Meaningful Weighted Integral

For the integral to be well-defined, the product \(w(t,s)m_i(s)\) must be integrable over \([0,t]\). The trajectory must be specified over the full interval, not only at the observed visit times. In a joint model, a longitudinal submodel supplies the latent trajectory between visits; the weighted exposure is calculated from that trajectory rather than by treating the observed measurements as error-free values.

For the direct interpretation that larger marker values add more exposure, use a nonnegative weight function. A weight of zero means that marker values at that time make no contribution; a larger weight means they contribute more per unit of marker and time. A signed weight is mathematically possible, but then positive and negative contributions can cancel, so the result is not a conventional accumulated exposure.

The weight should be specified in a way that is scientifically interpretable and consistent across individuals. It may depend on \(t\) as well as \(s\), but it should not be selected after inspecting which shape yields the preferred event association without accounting for that selection. The hazard model also assumes the stated log-linear association: holding the covariates and other model components fixed, a one-unit increase in \(A_i^w(t)\) multiplies the hazard by \(\exp(\alpha)\). This is a conditional association, not evidence that changing the marker would cause that hazard change.

How a Weight Changes the Trajectory’s Contribution

Suppose the weight depends only on marker time over a fixed interval \([0,T]\), and is \(w(s)=1+s/T\). Then it increases linearly from 1 at the start of the interval to 2 at its end. If the latent trajectory is linear, \(m(s)=\beta_0+\beta_1s\), multiplying the two functions before integration gives

$$ \begin{aligned} A^w(T) &=\int_0^T(1+s/T)(\beta_0+\beta_1s)\,ds\\ &=\beta_0\left(T+\frac{T}{2}\right) +\beta_1\left(\frac{T^2}{2}+\frac{T^2}{3}\right)\\ &=\frac{3}{2}\beta_0T+\frac{5}{6}\beta_1T^2. \end{aligned} $$

The first term comes from the trajectory’s level and the second from its linear change. The extra terms arise from multiplying the trajectory by the time-varying part of the weight. This derivation also shows why the weighted integral is generally not the unweighted area multiplied by one constant: the weight interacts with the trajectory’s shape.

Worked Example: A Linearly Increasing Weight

Consider two hypothetical latent trajectories over \(0\leq s\leq4\). Let \(m_1(s)=2+s\), \(m_2(s)=2+1.125s\), and use \(w(s)=1+s/4\). Calculate their weighted exposures and the conditional hazard ratio for trajectory 2 relative to trajectory 1 when \(\alpha=0.02\), holding covariates and other hazard components fixed.

For trajectory 1, the product is \((1+s/4)(2+s)=2+1.5s+0.25s^2\). Thus

$$ A_1^w(4)=8+1.5\left(\frac{4^2}{2}\right)+0.25\left(\frac{4^3}{3}\right) =8+12+5.333=25.33. $$

For trajectory 2, the product is \((1+s/4)(2+1.125s)=2+1.625s+0.28125s^2\). Therefore

$$ A_2^w(4)=8+1.625(8)+0.28125\left(\frac{64}{3}\right) =8+13+6=27. $$

The exact weighted-exposure difference is \(27-76/3=5/3\), approximately 1.667. The shared covariates and baseline hazard cancel in the hazard ratio:

$$ \frac{h_2(4)}{h_1(4)} =\exp\{\alpha(A_2^w(4)-A_1^w(4))\} =\exp\{0.02(5/3)\} =\exp(1/30)\approx1.034. $$

Under this model, trajectory 2 has a conditional hazard about 1.034 times that of trajectory 1 at time 4, given the same covariates and other hazard components. This calculation does not establish a causal effect.

Comparing Trajectories With Different Timing

Two trajectories can have the same unweighted cumulative exposure but different weighted exposures. The following simplified piecewise-constant paths make the arithmetic transparent. Such paths are illustrations of the integral, not a claim that an individual’s biological marker changes abruptly.

Worked Example: Same Total, Different Weighted Exposure

Over \(0\leq s\leq4\), let trajectory A equal 2 on \([0,2)\) and 5 on \([2,4]\). Let trajectory B equal 5 on \([0,2)\) and 2 on \([2,4]\). Both have unweighted exposure \(2(2)+5(2)=14\). Use \(w(s)=1+s/4\).

The integral of the weight over the first interval is \(2+0.5=2.5\), and over the second it is \(2+1.5=3.5\). Hence

$$ A_A^w(4)=2(2.5)+5(3.5)=22.5,\qquad A_B^w(4)=5(2.5)+2(3.5)=19.5. $$

The weighted-exposure difference is 3 even though the unweighted totals match. With \(\alpha=0.1\), the conditional hazard ratio for A relative to B is \(\exp\{0.1(3)\}=\exp(0.3)\approx1.350\), holding other components fixed. The difference arises because the increasing weight assigns greater contribution to the second interval.

Worked Example: A Quadratic Weight

Let a hypothetical latent trajectory be \(m(s)=1+2s\) on \(0\leq s\leq3\), with weight \(w(s)=(s/3)^2\). This weight ranges from zero at the start to one at the end. The unweighted exposure is \(\int_0^3(1+2s)\,ds=12\). For the weighted exposure,

$$ \begin{aligned} A^w(3) &=\int_0^3\frac{s^2}{9}(1+2s)\,ds\\ &=\left[\frac{s^3}{27}+\frac{s^4}{18}\right]_0^3 =1+4.5=5.5. \end{aligned} $$

The weighted value is smaller than the unweighted total here because the weight is between zero and one. If \(\alpha=0.1\), the hazard ratio for this trajectory relative to a trajectory with \(m(s)=0\) throughout is \(\exp\{0.1(5.5)\}=\exp(0.55)\approx1.733\), conditional on equal covariates and other hazard components. This comparison illustrates the model’s association for the specified weight; it is not a comparison of observed event probabilities.

Interpreting the Association and Checking the Specification

For two individuals with the same covariates and other hazard components, the model implies

$$ \frac{h_i(t\mid b_i)}{h_j(t\mid b_j)} =\exp\{\alpha[A_i^w(t)-A_j^w(t)]\}. $$

Thus it is the difference in weighted exposures that determines the conditional hazard ratio. If \(\alpha>0\), a larger weighted exposure corresponds to a higher conditional hazard; if \(\alpha<0\), it corresponds to a lower one. The interpretation depends on the chosen weight and on the exposure’s units. Multiplying the entire weight by a constant multiplies every weighted exposure by that constant, so the numerical value of \(\alpha\) changes inversely to preserve the same linear predictor.

Useful checks include plotting the weight over the interval and checking that its values match the intended contribution pattern; calculating the integral for simple constant or linear trajectories as a sanity check; and checking that the fitted latent trajectories are supported by the longitudinal measurements over the relevant times. Large weights over periods with little data support can make the association depend heavily on extrapolation. Sensitivity to plausible prespecified weights is also informative, but it does not prove that one weighting shape is correct.

Association linkWhat enters the event hazardWhat weighting adds
Uniform cumulativeIntegral of the latent marker over timeEqual contribution per unit time
Weighted cumulativeIntegral of the latent marker multiplied by a weightContribution varies according to the specified function
Windowed cumulativeIntegral restricted to a chosen time intervalExcludes times outside the window; does not by itself vary weights within it
Current-value or slope linkMarker value at a time, or its rate of changeUses a pointwise trajectory feature rather than its weighted history

These links answer different scientific questions and should not be treated as interchangeable ways to estimate one universal association. Weighted cumulative links can represent gradual, time-distributed contributions, but they also introduce dependence on the chosen weight. They can be difficult to interpret if the weight is arbitrary, if the trajectory is poorly estimated where weights are large, or if a single coefficient cannot capture the true association. A badly specified weight can give a precise estimate for a model that does not describe the relevant history.

Common Pitfall

Wrong reasoning: “The weight is larger near the end, so the weighted exposure is just the unweighted total multiplied by the final weight.” This is generally false: the weight varies throughout the interval, and its product with the marker must be integrated over the whole history.

Correction: Form the product \(w(t,s)m_i(s)\), then integrate it over the stated limits. For example, with \(m(s)=2+1.125s\) and \(w(s)=1+s/4\) on \([0,4]\), the product is \(2+1.625s+0.28125s^2\), so the integral is \(8+13+6=27\), not the unweighted total multiplied by 2. Check the product before integrating; cross-terms are easy to omit.

Key takeaway: A weighted cumulative association is the integral of a latent marker trajectory multiplied by a specified weight. The weight determines how the trajectory’s times contribute; the coefficient \(\alpha\) then links differences in that weighted exposure to conditional hazard ratios.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. If \(w(t,s)=1\), what quantity does \(A_i^w(t)\) reduce to?
  2. For \(m(s)=3\) on \(0\leq s\leq2\) and \(w(s)=1+s/2\), calculate the weighted exposure.
  3. Two trajectories have the same weighted exposure at time \(t\). What is their conditional hazard ratio under the stated link if their covariates and other hazard components are equal?
  4. Why can multiplying the weight function by a positive constant change the numerical value of \(\alpha\) without changing the fitted linear predictor?

Solutions. (1) It reduces to the unweighted cumulative exposure \(\int_0^t m_i(s)\,ds\). (2) The product is \(3+1.5s\), so \(A^w(2)=\int_0^2(3+1.5s)\,ds=6+3=9\). (3) The exposure difference is zero, so the hazard ratio is \(\exp(\alpha\cdot0)=1\). (4) If the weight is multiplied by \(c>0\), the exposure is multiplied by \(c\); replacing \(\alpha\) by \(\alpha/c\) leaves \(\alpha A_i^w(t)\) unchanged.

Clinical Biostats