Tutorials › Competing Risks and Multi-State Models › At-Risk Indicators and Observation Windows

Counting Processes and Martingale Theory · Tutorial 433 of 699

At-Risk Indicators and Observation Windows

Learn to construct at-risk indicators that match each subject’s entry, exit, observation windows, and pre-event state, and to check which recorded event increments they include.

Advanced 9 min read

What You'll Learn

  • Define an at-risk indicator using entry time, exit time, and the observation window.
  • Apply a consistent convention for whether an event at an endpoint is included.
  • Construct an observed counting process by retaining only increments in observed periods.
  • Form a state-specific risk set using the state immediately before the event time.
  • Diagnose errors caused by delayed entry, gaps in observation, or incorrect state assignment.
  • Distinguish descriptive risk-set construction from the assumptions needed for population inference.

Why At-Risk Indicators Matter

An event-history analysis does not use every event that could have happened to every subject. A subject contributes an event increment only when the subject is under observation and eligible for that event at the relevant time. Delayed entry, censoring, administrative study end, and temporary gaps in observation all restrict the times at which an event can be counted. In a multi-state setting, the subject’s state immediately before the event further determines which transition can contribute.

An at-risk indicator makes these restrictions explicit. It is not an estimate of risk or a probability. It records, at each time, whether a particular subject belongs in the risk set for the event process being analyzed. A risk set constructed incorrectly can count unobserved time, omit eligible event times, or assign a transition to the wrong origin state.

Definition: Let \(L_i\) be subject \(i\)'s entry time, \(X_i\) the end of the subject’s observed follow-up, and \(N_i(t)\) the subject’s event counting process. Under the convention that the observed interval is \((L_i,X_i]\), define the at-risk indicator $$ Y_i(t)=I(L_i<t\leq X_i). $$ Here \(I(\cdot)\) equals 1 when its condition is true and 0 otherwise. A subject is at risk at time \(t\) only if the subject has entered observation before \(t\) and has not exited before \(t\).

The interval convention has a practical consequence: an event at the exit time is included if it is recorded as an observed event, while an event exactly at the entry time is not included. This convention is useful for delayed entry and right-censored follow-up; in continuous-time models, exact ties with entry or censoring are often negligible. When times are recorded on a coarser scale and ties occur, the analysis must state and apply a consistent tie convention.

For ordinary right censoring, \(X_i\) is the observed follow-up endpoint: the earlier of the event time, censoring time, and any administrative study end. A subject whose event occurs at \(X_i\) has an event increment there; a subject censored at \(X_i\) has no event increment there. The indicator alone identifies whether the subject is under observation through that time; it does not say why follow-up ended.

Restricting Event Increments

The at-risk indicator restricts the increments of an event counting process. Write \(\Delta N_i(s)=N_i(s)-N_i(s-)\) for the jump at time \(s\). The observed count through time \(t\) is the sum of the increments that fall within the observed interval:

$$ N_i^{\mathrm{obs}}(t) = \sum_{s\leq t} I(L_i<s\leq X_i)\,\Delta N_i(s). $$

Thus a latent or otherwise defined event increment contributes only when \(Y_i(s)=1\). If a subject was not yet enrolled, had already left follow-up, or was in a period when events were not observed, that increment does not enter the observed count. This is a bookkeeping rule for the event history; by itself, it does not establish that an analysis based on the observed subjects gives unbiased population estimates.

Worked Example: Delayed Entry and Right Censoring

Consider five hypothetical subjects followed on a common time scale. Entry times are \(L_i\); observed endpoints are \(X_i\). “Event” means an observed event at the endpoint, and “censor” means follow-up ended without an event there.

SubjectEntry \(L_i\)Endpoint \(X_i\)Endpoint status
A05Event
B27Censor
C58Event
D15Censor
E34Event

At time \(t=5\), apply \(Y_i(5)=I(L_i<5\leq X_i)\) separately to each subject. A is included because \(0<5\leq5\); B is included because \(2<5\leq7\); C is excluded because its entry time is exactly 5; D is included because \(1<5\leq5\); and E is excluded because its endpoint is before 5. The risk set at time 5 is therefore \(\{A,B,D\}\), containing 3 subjects.

Only A has an observed event increment at time 5, so the number of events at that time is 1. D is in the risk set through time 5 but has no event increment there because D is censored. This distinction between being at risk at an endpoint and having an event at that endpoint is essential.

Intermittent Observation Windows

A single entry-to-exit interval is insufficient when a subject has periods outside observation. Let \(W_i\) be the union of the subject’s observed windows. The appropriate indicator is \(Y_i(t)=I(t\in W_i)\), with the endpoint convention specified for each window. For example, if the observed periods are \((a_{i1},b_{i1}]\) and \((a_{i2},b_{i2}]\), then

$$ Y_i(t)=I(a_{i1}<t\leq b_{i1}\ \text{or}\ a_{i2}<t\leq b_{i2}). $$

The observed event count retains increments in either window and excludes increments in the gap. The presence of a gap does not establish that no event occurred during it; it means the event process was not observed there. If the event history depends on unobserved events during the gap—for example, if an unrecorded transition changes a subject’s subsequent state—then simply resuming follow-up later may not recover the true state history.

Worked Example: Two Observation Windows

Suppose a hypothetical subject’s recurrent event process is observed in windows \((0,4]\) and \((6,8]\). The event times in the underlying process are 2.5, 5, and 6.5 time units. The at-risk indicator is 1 in either observed window and 0 in the gap.

At 2.5, the subject is observed because \(0<2.5\leq4\), so this increment is counted. At 5, the subject is in the gap, so this increment is excluded. At 6.5, the subject is observed because \(6<6.5\leq8\), so this increment is counted. The observed count by time 8 is therefore \(1+0+1=2\), even though the underlying process has three event increments by that time.

An event exactly at time 6 would not be included under the stated convention, because the second window is open at 6. Stating the window endpoints is therefore important when event times are tied to recorded observation boundaries.

At Risk for a Particular Transition

In a multi-state model, being observed is not sufficient for being at risk for every transition. For a transition from state \(k\) to state \(l\), the subject must be observed and must occupy state \(k\) immediately before the event time. Let \(Z_i(t-)\) denote subject \(i\)'s state just before \(t\), and let \(N_{i,kl}(t)\) count observed transitions from \(k\) to \(l\). Define

Definition: The transition-specific at-risk indicator is $$ Y_{i,k}(t)=I(t\in W_i)\,I\{Z_i(t-)=k\}. $$ The corresponding transition count can have an increment at \(t\) only for a subject with \(Y_{i,k}(t)=1\). The state is evaluated immediately before the event, so a transition out of state \(k\) is assigned to the risk set for origin state \(k\), not to the state occupied after the transition.

For example, a subject in state 2 can be under observation but is not at risk for a transition whose origin is state 1. If the subject moves from state 1 to state 2 at time \(t\), the event is a \(1\to2\) increment at \(t\); after that jump, the subject is no longer at risk for transitions out of state 1. This use of the pre-event state avoids counting the same transition as though it started from its destination.

Worked Example: Constructing a State-Specific Risk Set

At time \(t=3\), consider five hypothetical subjects. A and B are observed through time 3 and are in state 1 immediately before time 3. A makes a \(1\to2\) transition at time 3; B does not transition then. C is observed but is in state 2 immediately before time 3. D’s observation ended at time 2.5. E enters observation at time 3.

For the \(1\to2\) transition, A and B satisfy both conditions: they are observed at time 3 and are in origin state 1 immediately before the event time. Thus \(Y_{A,1}(3)=Y_{B,1}(3)=1\). C is excluded from this transition-specific risk set because \(Z_C(3-)=2\); D is excluded because follow-up ended before 3; and E is excluded because entry exactly at 3 does not satisfy the chosen entry convention.

The risk set for the \(1\to2\) transition is \(\{A,B\}\), so its size is 2. A contributes one \(1\to2\) event increment and B contributes none. C may be relevant to transitions out of state 2, but is not part of this origin-state-1 risk set. The event count and risk-set size answer different questions: one counts observed jumps; the other identifies eligible subjects at that time.

A Direct Justification and Practical Checks

The restriction follows from how the observed history is defined. Consider any event increment \(\Delta N_i(s)\). If \(s\notin W_i\), the subject was not observed at \(s\), so the increment cannot be recorded as an observed event. If the event process is restricted to subjects who have entered and not exited, then \(s\) must satisfy \(L_i<s\leq X_i\). Multiplying the increment by the indicator retains it exactly when both conditions hold:

$$ I(L_i<s\leq X_i)\Delta N_i(s) = \begin{cases} \Delta N_i(s), & L_i<s\leq X_i,\\ 0, & \text{otherwise}. \end{cases} $$

For a transition-specific count, the same argument adds the origin-state condition. If \(Z_i(s-)\ne k\), the subject is not eligible for a transition out of \(k\), and the \(k\to l\) increment is excluded from that risk set. These indicators therefore encode observation and event eligibility; they do not supply a model for the frequency or probability of events.

Before analysis, check that entry and exit dates use the same time scale as event times, that gaps are represented rather than silently treated as event-free time, and that state histories agree with the recorded transitions. At each observed transition time, verify that the subject was in the stated origin state just before the transition. If a computed risk set includes a subject before entry, after exit, during a gap, or in the wrong state, the indicator or the underlying data coding needs correction.

What the Indicator Does Not Guarantee

Correct risk-set construction is necessary, but it is not sufficient for valid population inference. The risk set describes who was observed and eligible under the stated rules. It does not, by itself, make people who enter late representative of people who entered earlier, or make censoring unrelated to event risk. In particular, delayed entry can induce selection if entry depends on a subject’s event history or prognosis. Censoring and intermittent observation can also be informative. Analyses that aim to estimate population quantities need assumptions appropriate to those mechanisms, in addition to correctly constructed indicators.

The choice of time scale also matters. If event rates are indexed by time since a common origin, delayed entry must be recorded on that scale; resetting each subject’s time to zero at their own entry answers a different question. Nor can observation windows alone reconstruct transitions that occurred in a gap. When later state assignment depends on what happened during that gap, the state history may be ambiguous and requires an explicit data or modeling strategy.

A common mistake is to treat every subject enrolled at any point in a study as at risk from the study’s calendar start. That incorrectly counts pre-entry time and may include events that could not have been observed. The correction is to evaluate the entry condition at each event time: under the convention here, include subject \(i\) only when \(L_i<t\leq X_i\). A related mistake is to count an event observed during a gap as though it were part of the observed process. The correction is to exclude it from the observed count and recognize that the gap may leave uncertainty about the subsequent history.

Compared with a simple total of recorded events, the at-risk formulation preserves the distinction between event counts and the subjects eligible to contribute at each time. Compared with treating everyone as continuously observed from a common origin, it accommodates delayed entry and gaps. Its limitation is equally important: an indicator can represent the observation design faithfully, but cannot repair missing histories or justify assumptions about selection, censoring, or unobserved events.

Check Your Understanding

Work through each question, then compare your reasoning with the solutions.

  1. A subject enters at time 2 and is censored at time 6. Under the interval convention \((L_i,X_i]\), is the subject at risk at times 2, 4, and 6?
  2. A subject is observed in windows \((0,3]\) and \((5,7]\), with events at 2, 4, and 5.5. How many event increments contribute to the observed count?
  3. At time \(t\), a subject is observed and in state 3 immediately before an event. Is the subject in the risk set for a \(1\to3\) transition?
  4. Explain why a subject censored at time \(c\) can be at risk at \(c\) without contributing an event increment at \(c\).

Solutions. (1) At time 2, no: the condition \(2<2\) is false. At time 4, yes, because \(2<4\leq6\). At time 6, yes, because the interval includes its right endpoint. (2) Two increments contribute: the event at 2 is in the first window and the event at 5.5 is in the second; the event at 4 occurs in the gap. (3) No. The subject is not in origin state 1 immediately before \(t\), so the state-specific indicator for transitions out of state 1 is zero. (4) The at-risk condition includes the endpoint \(c\), but censoring means no event increment is recorded there. Risk-set membership and event occurrence are distinct.

Clinical Biostats