Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Windowed Cumulative Marker Effects

Association Structures · Tutorial 201 of 697

Windowed Cumulative Marker Effects

Define and calculate baseline-adjusted marker exposure over a moving time window, then translate exposure changes into conditional hazard contributions.

Advanced 11 min read

What You'll Learn

  • Define a baseline-adjusted cumulative marker exposure over a window of fixed width.
  • Derive the exact change in exposure as the window advances.
  • Use the endpoint formula for the exposure derivative, including the right derivative at the domain boundary.
  • Convert exposure differences into hazard-contribution ratios under a proportional hazards link.
  • Check trajectory, time-origin, and window-boundary assumptions that affect the calculation.
  • Distinguish a windowed cumulative association from current-value and full-history cumulative associations.

Why Use a Moving Window?

A cumulative marker association allows a subject’s event hazard to depend on marker history rather than only on the marker value at the current time. A moving window makes that history local: at time \(t\), it includes marker deviations from the preceding \(L\) time units and excludes earlier values. As time advances, recent marker exposure enters the window while equally old exposure leaves it. The resulting hazard contribution can therefore rise, fall, or remain unchanged even when the window width stays fixed.

Here the marker trajectory is the latent longitudinal trajectory used in the joint model, not a sum of noisy measurements. The definition below uses baseline-adjusted exposure, continuing the convention that the relevant marker quantity is its deviation from its value at the time origin.

Definition: Let \(m_i(s)\) be subject \(i\)'s marker trajectory at time \(s\), and let \(m_i(0)\) be its baseline value. Define the baseline-adjusted marker deviation by \(z_i(s)=m_i(s)-m_i(0)\). For a fixed window width \(L>0\), define the windowed cumulative exposure $$ A_{i,L}(t)=\int_{t-L}^{t} z_i(s)\,ds,\qquad t\geq L. $$ It is the signed area between the trajectory and its baseline level over the interval \([t-L,t]\). If \(z_i(s)\) is measured in marker units and time in years, \(A_{i,L}(t)\) has units of marker-years.

The restriction \(t\geq L\) means that the entire window lies at or after the time origin. This tutorial uses a full-width window; it does not replace the unavailable part of an early window with an assumed value. For the integral to exist, \(z_i\) must be integrable over each window considered. Continuity is not required for the exposure itself, though it is needed at the window endpoints for the derivative formula below.

Association With the Event Hazard

A proportional hazards association can include this exposure through the model

$$ h_i(t\mid b_i)=h_0(t)\exp\left\{\boldsymbol{\gamma}^{\mathsf T}\mathbf{w}_i+\alpha A_{i,L}(t)\right\},\qquad t\geq L. $$

Here \(h_i(t\mid b_i)\) is the hazard conditional on the subject’s latent trajectory (represented by \(b_i\)) and the included covariates; \(h_0(t)\) is the baseline hazard; \(\mathbf{w}_i\) is a vector of covariates with coefficient vector \(\boldsymbol{\gamma}\); and \(\alpha\) is the windowed cumulative association parameter. This specification assumes a proportional-hazards link, a fixed window width, and a constant \(\alpha\) over the times and subjects being modeled. It also assumes the marker history relevant to the event hazard is adequately summarized by this windowed exposure, conditional on the other model terms. These are modeling assumptions, not consequences of defining the integral.

At a given time \(t\), a one-unit difference in \(A_{i,L}(t)\), holding the other terms fixed, corresponds to a conditional hazard ratio of \(\exp(\alpha)\). The unit is one marker-time unit, such as one marker-year. The factor \(\exp\{\alpha A_{i,L}(t)\}\) is the marker’s hazard multiplier relative to the same model’s zero-exposure reference. It is not, by itself, the ratio of hazards at two different times: the baseline hazard may also change with time.

Worked Example: Calculating a Window Exposure From Segments

Suppose a hypothetical subject’s baseline-adjusted deviation \(z_i(s)\), in marker units, is 0 for \(0\leq s<2\), 1 for \(2\leq s<4\), and 2 for \(4\leq s\leq6\). Take a window width of \(L=3\) years. Calculate the exposure at \(t=5\) and \(t=6\), then find the change in its hazard contribution if \(\alpha=0.15\) per marker-year.

At \(t=5\), the window is \([2,5]\). The deviation is 1 for two years and 2 for one year, so

$$ A_{i,3}(5)=1(4-2)+2(5-4)=2+2=4\text{ marker-years}. $$

At \(t=6\), the window is \([3,6]\). The deviation is 1 for one year and 2 for two years:

$$ A_{i,3}(6)=1(4-3)+2(6-4)=1+4=5\text{ marker-years}. $$

The exposure has increased by \(5-4=1\) marker-year. At each time, the hazard contribution from this association is the exponential of \(\alpha A\). The ratio of these contributions is

$$ \frac{\exp\{0.15(5)\}}{\exp\{0.15(4)\}} =\exp\{0.15(5-4)\} =\exp(0.15) \approx 1.162. $$

Thus, holding the other hazard terms fixed, the marker-associated contribution at year 6 is about 1.162 times its value at year 5. This is not necessarily the ratio of the subjects’ full hazards at those two times, because \(h_0(t)\) can differ. The piecewise-constant trajectory is integrable, so the exposure calculations are valid; its jumps mean the endpoint-continuity condition for a derivative need not hold at the jump times.

How Exposure Changes as the Window Advances

The change from one window to a later one can be calculated exactly by separating the newly included part from the part that has left. For an advance of \(\delta>0\), with \(t\geq L\),

$$ A_{i,L}(t+\delta)-A_{i,L}(t) = \int_t^{t+\delta}z_i(s)\,ds - \int_{t-L}^{t-L+\delta}z_i(s)\,ds. $$

The first integral is the exposure entering at the recent end; the second is the exposure departing at the older end. The identity follows by writing \(A_{i,L}(t+\delta)\) as the integral over \([t-L+\delta,t+\delta]\) and subtracting the integral over \([t-L,t]\). The intervals that overlap cancel, leaving precisely the two endpoint pieces. This identity is often the safest way to calculate a finite change, especially when the trajectory is piecewise-defined.

If \(z_i\) is continuous at both endpoints \(t-L\) and \(t\), then for \(t>L\) the derivative is

$$ \frac{d}{dt}A_{i,L}(t)=z_i(t)-z_i(t-L) =m_i(t)-m_i(t-L). $$

To justify the result, write the exposure difference for a small positive increment \(h\) as

$$ \frac{A_{i,L}(t+h)-A_{i,L}(t)}{h} = \frac{1}{h}\int_t^{t+h}z_i(s)\,ds - \frac{1}{h}\int_{t-L}^{t-L+h}z_i(s)\,ds. $$

As \(h\) tends to zero, continuity makes the first average tend to \(z_i(t)\) and the second tend to \(z_i(t-L)\). The same limit from negative increments gives the two-sided derivative when \(t>L\), where the exposure is defined on both sides in a neighborhood of \(t\).

At the boundary \(t=L\), the definition only covers \(t\geq L\). Therefore a two-sided derivative is not asserted there. If \(z_i\) is continuous at 0 and \(L\), the right derivative is

$$ \left.\frac{d}{dt}A_{i,L}(t)\right|_{t=L+} =z_i(L)-z_i(0) =m_i(L)-m_i(0). $$

The derivative describes the instantaneous rate of change in exposure as the window moves. Under the stated hazard model, the instantaneous rate of change in the log hazard contribution is \(\alpha\{z_i(t)-z_i(t-L)\}\). A positive endpoint difference does not guarantee a positive change over every finite advance if the trajectory varies substantially within that advance; use the finite-change identity for that calculation.

Worked Example: A Linear Trajectory and the Boundary Derivative

Suppose a hypothetical subject has \(z_i(s)=0.4s\) marker units, with \(s\) measured in years, and use \(L=2\) years. At \(t=5\), calculate the exposure and its derivative. Also calculate the exposure’s right derivative at the boundary \(t=L\).

The exposure at year 5 is the integral from year 3 to year 5:

$$ A_{i,2}(5)=\int_3^5 0.4s\,ds =0.2(5^2-3^2) =0.2(25-9) =3.2\text{ marker-years}. $$

Because the trajectory is continuous and \(5>L\), the derivative formula applies:

$$ \frac{d}{dt}A_{i,2}(5)=z_i(5)-z_i(3) =0.4(5)-0.4(3) =0.8\text{ marker units}. $$

At the boundary, \(z_i(2)=0.8\) marker units and \(z_i(0)=0\). The right derivative is therefore \(0.8-0=0.8\) marker units per year of window advancement. It is a right derivative because this exposure definition has no values for \(t<2\). If \(\alpha=0.25\) per marker-year, the derivative of the log hazard contribution at year 5 is \(0.25(0.8)=0.20\) per year. This is a local rate, not a finite-time hazard ratio.

Comparing Subjects at the Same Time

For two subjects evaluated at the same time and with the same covariates, the common baseline hazard cancels in their conditional hazard ratio. Their ratio due to the windowed association is

$$ \frac{h_i(t\mid b_i)}{h_j(t\mid b_j)} = \exp\left\{\alpha\left[A_{i,L}(t)-A_{j,L}(t)\right]\right\}, $$

provided other covariate contributions are equal. This comparison concerns their difference in windowed exposure, not a difference in current marker values alone.

Worked Example: A Same-Time Hazard Ratio

Consider two hypothetical subjects with linear baseline-adjusted trajectories \(z_i(s)=0.3s\) and \(z_j(s)=0.1s\), measured in marker units with time in years. Let \(L=3\) years, evaluate at \(t=6\), and set \(\alpha=0.20\) per marker-year. Assume their other covariates are equal.

For a trajectory \(z(s)=bs\), integrate over the window:

$$ A_L(t)=\int_{t-L}^{t}bs\,ds =\frac{b}{2}\left\{t^2-(t-L)^2\right\}. $$

For subject \(i\), \(b=0.3\), so \(A_{i,3}(6)=0.15(36-9)=4.05\) marker-years. For subject \(j\), \(b=0.1\), so \(A_{j,3}(6)=0.05(36-9)=1.35\) marker-years. Their exposure difference is \(4.05-1.35=2.70\) marker-years. The conditional hazard ratio is

$$ \exp\{0.20(2.70)\}=\exp(0.54)\approx 1.716. $$

At year 6, subject \(i\)'s conditional hazard is about 1.716 times subject \(j\)'s, under the model and equal-covariate comparison. This is an association implied by the specified hazard model; the calculation alone does not establish that changing a marker trajectory would cause the hazard to change.

Choosing and Checking the Window

A moving-window association differs from other common association structures in the history it summarizes. A current-value association uses the marker at \(t\) and responds to the marker level at that instant. A full-history cumulative association includes deviations over the entire period from the time origin to \(t\). A fixed-width window instead gives no direct contribution to \(A_{i,L}(t)\) from times earlier than \(t-L\). Each structure encodes a different substantive assumption about how marker history relates to the hazard.

Association structureHistory representedQuestion it encodes
Current valueMarker at the current timeDoes the current marker level relate to the hazard?
Full-history cumulativeMarker deviations from the origin through the current timeDoes accumulated history from the origin relate to the hazard?
Fixed-width windowMarker deviations over the preceding \(L\) time unitsDoes recent accumulated history over this duration relate to the hazard?

A window width should therefore be chosen to match a defensible time scale for the scientific question. Changing \(L\) changes which history is represented and usually changes the numerical scale of the exposure; estimates from different widths should not be treated as directly comparable without considering that change. The window also imposes a sharp cutoff: a marker deviation just before \(t-L\) has no direct contribution, while one just after it is included.

Before interpreting a calculation or fitted association, check that the time origin and baseline adjustment are consistent, \(L\) is expressed in the intended time units, and each evaluated time satisfies \(t\geq L\). For derivative calculations, check continuity at both endpoints; for exposure calculations, check that the trajectory is integrable over the window. In fitted joint models, also examine whether the longitudinal data support the latent trajectory throughout the window. Sparse measurements, extrapolation near event times, or a poorly supported trajectory can make \(A_{i,L}(t)\) uncertain even when the integral is easy to write down.

A common mistake is to say that the windowed exposure must increase whenever the current marker deviation is positive. That reasoning ignores what leaves the older end. For example, if \(z_i(t)=1\) but \(z_i(t-L)=2\), then the instantaneous derivative is \(1-2=-1\), so the exposure is decreasing at that instant. The correction is to compare incoming and outgoing endpoint values for an instantaneous rate, or to calculate both entering and departing areas for a finite advance. A second mistake is to claim a two-sided derivative at \(t=L\); the defined exposure exists only for \(t\geq L\), so continuity gives a right derivative there, not a two-sided one.

Key takeaway: A fixed-width moving window updates cumulative exposure by adding the newest marker area and subtracting the oldest. The corresponding hazard contribution changes by the exponential of \(\alpha\) times the exposure change, conditional on the model’s other terms.

Check Your Understanding

Try each calculation before reading its solution.

  1. Let \(z_i(s)=0.3s\) marker units, with time in years, \(L=3\) years, and \(t=5\) years. Calculate \(A_{i,L}(t)\), its derivative at \(t\), and the association-contribution ratio for an advance of one year if \(\alpha=-0.20\) per marker-year.
  2. Suppose \(z_i(s)=0\) on \([0,1)\), \(2\) on \([1,3)\), and \(1\) on \([3,5]\). With \(L=2\), calculate the exposures at \(t=4\) and \(t=5\). If \(\alpha=0.40\), what is the ratio of the association contributions at year 5 versus year 4?
  3. For a continuous trajectory and \(L=2\), what derivative statement is justified at \(t=2\), and why is a two-sided derivative not asserted?
  4. Explain why a positive current deviation \(z_i(t)\) alone does not establish that \(A_{i,L}(t)\) is increasing.

Solutions. (1) Integrating gives \(A_{i,3}(5)=0.15(5^2-2^2)=0.15(21)=3.15\) marker-years. The derivative is \(z_i(5)-z_i(2)=1.5-0.6=0.9\) marker units. For a one-year advance, the linear trajectory gives an exact exposure increase of \(0.9\) marker-years, so the ratio is \(\exp\{-0.20(0.9)\}=\exp(-0.18)\approx0.8353\). (2) At year 4, the window is \([2,4]\), giving \(2(3-2)+1(4-3)=3\) marker-years. At year 5, the window is \([3,5]\), giving \(1(5-3)=2\) marker-years. The contribution ratio is \(\exp\{0.40(2-3)\}=\exp(-0.40)\approx0.6703\). (3) The right derivative at \(t=2\) is \(z_i(2)-z_i(0)\), assuming continuity at both endpoints. The exposure is defined only for \(t\geq2\), so values to the left needed for a two-sided derivative are not supplied by this definition. (4) The instantaneous rate is \(z_i(t)-z_i(t-L)\); a larger deviation at the departing endpoint can outweigh a positive current deviation and make the exposure decrease.

Clinical Biostats