Tutorials › Competing Risks and Multi-State Models › Constructing Risk Sets at Event Times

Cumulative Incidence Functions · Tutorial 48 of 699

Constructing Risk Sets at Event Times

You will learn to determine, verify, and interpret the people at risk immediately before each observed event time.

Intermediate 11 min read

What You'll Learn

  • Define the risk set immediately before an observed event time.
  • Distinguish removal before a time from removal at that time.
  • Track how prior events of any cause and prior censoring affect later risk sets.
  • Handle events and censoring recorded at the same time consistently.
  • Check risk-set counts for errors and recognize when the construction needs a different setup.

Why Risk Sets Need Careful Construction

At an observed event time, the relevant group is not everyone who began follow-up. It is the group still under observation and free of a prior event immediately before that time. Getting that group right matters because it determines which subjects could have experienced an event at that point in follow-up. In competing-risks data, a prior event of any cause removes a subject from later event-free risk sets. Censoring before the time does too.

The timing convention is easy to overlook: a subject whose event or censoring time is exactly \(t\) is included in the risk set immediately before \(t\). That subject leaves after \(t\), not before it. A subject whose follow-up ended strictly earlier than \(t\) is excluded.

Definition: Suppose subject \(i\) enters follow-up at the common time origin, has event time \(T_i\), and has censoring time \(C_i\). The observed follow-up time is \(U_i=\min(T_i,C_i)\). Let \(J_i=0\) indicate censoring and \(J_i=k\) indicate an observed event from cause \(k\). The risk set immediately before time \(t\) is $$ R(t)=\{i: U_i\geq t\}, $$ and its size is \(Y(t)=\sum_i I(U_i\geq t)\). Thus, subjects with \(U_i<t\) are excluded, while subjects with \(U_i=t\) are included immediately before \(t\).

This definition assumes a common time origin and no delayed entry, and that each subject is followed until a first event or censoring. The \(T_i\) and \(C_i\) values need not both be observed: the recorded endpoint is \(U_i\), together with the event cause or censoring code. Correct coding and time ordering are essential. The mechanical construction of \(R(t)\) does not itself require independent censoring; assumptions about censoring become important when using risk sets to estimate population quantities.

For an event time \(t\), this is the event-free risk set shared across causes: it contains people who have not yet had any event and have not been censored before \(t\). It is not a cause-specific group in which competing events are ignored. Once a competing event occurs, that subject is no longer event-free and cannot experience a later first event of another cause.

Constructing a Risk Set From Follow-Up Records

A reliable procedure is to start with the full cohort and move forward through distinct recorded endpoint times. At each event time, include everyone whose endpoint time is that time or later. Then, after making the before-time risk set, remove everyone whose event or censoring occurred at that time when moving to later times. The cause label does not change who is at risk just before an event time; it identifies the event that happens at that time.

1
Identify the time of interest.
Use a distinct observed event time \(t\). Do not treat a censoring time as an event time, though it affects risk sets at later times.
2
Compare every observed endpoint with \(t\).
Include subject \(i\) if \(U_i\geq t\); exclude the subject if \(U_i<t\).
3
Check exits at earlier times.
Any earlier event, whatever its cause, or earlier censoring removes that subject from the risk set.
4
Apply the before-time convention.
Include subjects with \(U_i=t\) in \(R(t)\), then remove them when forming risk sets at later times.

Worked Example: A Risk Set at Two Event Times

Consider seven hypothetical subjects followed from the same origin. Their records are: A, cause 1 event at time 2; B, censored at 3; C, cause 2 event at 4; D, cause 1 event at 4; E, censored at 5; F, cause 2 event at 7; and G, censored at 8. Find the risk sets immediately before times 4 and 7.

At time 4, A has had an event at 2 and B was censored at 3, so both have \(U_i<4\) and are excluded. C and D have endpoint time 4, so they are included immediately before 4. E, F, and G have later endpoint times and are also included. Therefore, $$ R(4)=\{C,D,E,F,G\},\qquad Y(4)=5. $$

At time 7, C and D have already experienced events at 4, and E was censored at 5. They are excluded, as are A and B, whose endpoints were earlier still. F has an event exactly at 7 and G is censored at 8, so both are included: $$ R(7)=\{F,G\},\qquad Y(7)=2. $$

The event type at 4 does not change the membership calculation at 7: both causes remove subjects from the event-free risk set. Likewise, G is in the risk set at 7 even though G is censored later.

Why the Endpoint Inequality Is Inclusive

The inequality \(U_i\geq t\) follows directly from the phrase “immediately before \(t\).” If \(U_i<t\), follow-up ended before \(t\), so the subject cannot be under observation just before \(t\). If \(U_i>t\), follow-up extends beyond \(t\), so the subject is still under observation just before it. If \(U_i=t\), the recorded event or censoring occurs at \(t\), not at a time strictly before \(t\); the subject is therefore included just before that endpoint.

$$ I(U_i\geq t)= \begin{cases} 1, & U_i<t \text{ is false, so subject }i\text{ remains under observation just before }t,\\ 0, & U_i<t \text{, so subject }i\text{ has already left follow-up.} \end{cases} $$

This also shows why a subject with an event at \(t\) is included in the risk set used to describe events at \(t\), even though that subject is no longer at risk after the event. If \(R(t+)\) denotes the set just after all endpoints recorded at \(t\) have occurred, then \(R(t+)=\{i:U_i>t\}\). In ordinary follow-up with no delayed entry, risk-set sizes cannot increase as time moves forward: subjects leave but do not re-enter.

Worked Example: Censoring Before the Event Time

Use this hypothetical cohort: A has a cause 1 event at 1; B is censored at 2; O is censored at 2.5; C has a cause 2 event at 3; D has a cause 1 event at 3; E is censored at 4; F has a cause 2 event at 5; G has a cause 1 event at 6; and H is censored at 7. Find the risk set immediately before time 3 and immediately before time 5.

For time 3, A, B, and O have endpoints strictly before 3, so they are excluded. C and D have events at 3 and are included; E, F, G, and H have later endpoints and are included. Thus, $$ R(3)=\{C,D,E,F,G,H\},\qquad Y(3)=6. $$ Censoring at 2.5 occurred before time 3, so O must be excluded.

For time 5, C and D have already had events at 3, and E was censored at 4. They are excluded, as are A, B, and O because their endpoints were earlier than 5. F has an event at 5, while G and H have later endpoints, giving $$ R(5)=\{F,G,H\},\qquad Y(5)=3. $$ This calculation illustrates both routes out of later risk sets: prior events of any cause and prior censoring.

Exact-Time Ties and Practical Checks

When several endpoints share an observed time, construct one risk set immediately before that time. Include every subject whose endpoint is that time, whether the endpoint is an event or censoring. Do not remove one tied subject and then use a smaller denominator for another subject recorded at the same time. With time recorded only to a particular precision, ties may reflect rounding rather than truly simultaneous underlying times; absent more precise ordering information, use the recorded-time convention consistently.

Worked Example: Events and Censoring at the Same Recorded Time

In a hypothetical cohort, P has a cause 1 event at 2; Q is censored at 4; R has a cause 2 event at 4; S has a cause 1 event at 4; T has a cause 2 event at 6; and V is censored at 7. Find the set just before time 4 and the risk set at time 6.

P is excluded at 4 because \(2<4\). Q, R, and S all have endpoints at 4 and are included just before that time. T and V have later endpoints and are included as well. Therefore, $$ R(4)=\{Q,R,S,T,V\},\qquad Y(4)=5. $$ For time 6, Q, R, and S have all left follow-up at 4, regardless of whether their endpoint was censoring or an event. P left at 2. Only T and V remain: $$ R(6)=\{T,V\},\qquad Y(6)=2. $$ The shared recorded time does not justify ordering Q, R, and S within time 4. All three belong to the pre-time risk set.

Several simple checks can reveal mistakes. Risk-set size should be nonincreasing across increasing times when everyone enters at the common origin. Every subject with a prior endpoint must be absent; every subject with a later endpoint must be present. At time \(t\), check \(U_i=t\) separately to avoid accidentally excluding the event subjects or censoring subjects at that time. A count that rises usually signals an arithmetic or membership error under these assumptions; delayed entry would require a different risk-set definition, but it is outside the setup here.

What Risk Sets Do—and Do Not—Represent

A fixed baseline denominator counts everyone who began follow-up, including people who could no longer experience a first event by the time of interest. A risk set instead counts only those still event-free and observed just before that time. In competing-risks analysis, removing a subject after a competing event is essential: that person cannot subsequently experience another first event. Treating that competing event as ordinary loss to follow-up would misrepresent what happened.

The event-free risk set used here is also distinct from a subdistribution risk set, which retains subjects with prior competing events for a different hazard interpretation. Choosing between these sets depends on the question; they are not interchangeable. For the current task—identifying who remains event-free and observed immediately before a recorded event time—the rule is \(U_i\geq t\).

Risk-set construction is a bookkeeping step, not a guarantee that an estimator is unbiased or that censoring is harmless. In particular, the definition alone does not establish that censoring is independent of future event experience. Nor does it resolve uncertainty about within-time ordering when records are rounded. It does provide the exact membership required before any subsequent event calculation is attempted.

Common Mistakes

  • Keeping someone censored earlier. If censoring occurred at 2.5, that person is not in \(R(3)\), since \(2.5<3\).
  • Excluding subjects whose endpoint equals the event time. They are in the risk set immediately before that time; remove them only for later times.
  • Removing only events of the cause currently being considered. A prior competing event also ends event-free follow-up and removes the subject from later event-free risk sets.
  • Using the original cohort size at every event time. Prior events and censoring change the number still at risk.
  • Ordering tied endpoints without evidence. When only a shared recorded time is known, include all those subjects in the pre-time risk set.
Key takeaway: Immediately before a recorded event time \(t\), include exactly those subjects with observed follow-up endpoint \(U_i\geq t\). Prior events of any cause and prior censoring exclude a subject; an endpoint exactly at \(t\) does not.

Check Your Understanding

For each question, first apply the endpoint-time rule, then check the explanation.

  1. A subject is censored at time 5. Is the subject in \(R(5)\)? What about \(R(5.1)\)?
  2. At time 3, A had a cause 1 event at 1, B had a cause 2 event at 3, C was censored at 3, and D has an event at 4. List \(R(3)\).
  3. At time 6, E had an event at 2, F was censored at 5, G has an event at 6, and H has an endpoint at 8. Find \(Y(6)\).
  4. Three subjects have endpoints recorded at time 4: one event, one competing event, and one censoring. Should they all be included in \(R(4)\)? Explain.

Solutions. (1) Yes, because \(U_i=5\geq5\), so the subject is included immediately before 5. No for \(R(5.1)\), because \(5<5.1\). (2) A is excluded because \(1<3\); B and C are included because their endpoints equal 3; D is included because \(4>3\). Thus \(R(3)=\{B,C,D\}\). (3) E and F are excluded because their endpoints are before 6; G and H are included. Therefore \(Y(6)=2\). (4) Yes. Each endpoint equals 4, so all three subjects are included immediately before 4; all leave when forming risk sets after time 4.

Clinical Biostats