Why Reconstruct Risk Sets?
When records include right-censored observations, a list of times alone does not tell us which observations represent events. A risk set answers a different question: which records are still under observation immediately before a particular time? Reconstructing that set carefully is an essential bookkeeping step in empirical survival summaries.
The task in this tutorial is limited to sorting records, identifying distinct event times, and finding the risk-set size and event count at each one. No interest rate, mortality law, or parametric distribution is assumed; all calculations use only the observed times and event indicators.
The inequality \(Z_i\ge t\) is important. A record ending at exactly \(t\), whether by event or censoring, is in the risk set immediately before \(t\). A record with \(Z_i<t\) has already ended and is not in that set. To find the event times, take the distinct observed times for which at least one record has \(\delta_i=1\); a time with only censored records is not an event time.
A Reliable Reconstruction Method
Begin by sorting all records by observed time, not just the event records. Then inspect the complete sorted list to identify event times. At each such time, count every record whose observed time is at least that time, and count as events only records at that exact time with indicator 1.
Keep each time paired with its event indicator and, if useful, its record label. Do not discard censoring records.
Include a time if one or more records at that time have indicator 1. A tied event time appears only once in this list.
For each event time \(t\), count records with \(Z_i\ge t\) to get \(Y(t)\), then count records with \(Z_i=t\) and \(\delta_i=1\) to get \(d(t)\).
Subtract every record with an observed time strictly less than the event time. This catches the common error of carrying an earlier censoring or event record into a later risk set.
Worked Reconstructions
Worked Example: Events Tied with Censoring
A hypothetical warranty study follows eight units. Their observed times and indicators are: A, time 1, censored; B, time 2, event; C, time 2, censored; D, time 4, event; E, time 4, event; F, time 5, censored; G, time 7, event; H, time 7, censored. Find the risk-set size and event count at every event time. This is a reconstruction from observed data; no interest, mortality assumption, or parametric distribution is used.
Method: sort, identify the event times, and count records with \(Z_i\ge t\). The distinct event times are 2, 4, and 7. Time 1 and time 5 are censoring times only, so neither is an event time.
At time 2, A has already ended at time 1. The records still at risk are B, C, D, E, F, G, and H, so \(Y(2)=7\). Only B is an event at time 2; C is censored at that time. Therefore \(d(2)=1\).
At time 4, A, B, and C have all ended before time 4. The risk set is D, E, F, G, and H, so \(Y(4)=5\). D and E are events at time 4, giving \(d(4)=2\).
At time 7, A through F have all ended before time 7. The risk set is G and H, so \(Y(7)=2\). G is an event and H is censored at time 7, giving \(d(7)=1\).
| Event time \(t\) | Records in \(R(t)\) | Risk-set size \(Y(t)\) | Event count \(d(t)\) |
|---|---|---|---|
| 2 | B, C, D, E, F, G, H | 7 | 1 |
| 4 | D, E, F, G, H | 5 | 2 |
| 7 | G, H | 2 | 1 |
Check. The risk-set sizes decrease from 7 to 5 to 2 as records end. The records censored at times 2 and 7 are included in their respective risk sets, but not in the event counts. The method avoids the mistake of treating a tied censoring as an event.
Worked Example: Reconstructing Risk Sets from a Full Sorted List
A hypothetical equipment study records ten units: A, time 1.5, event; B, time 2, censored; C, time 3, event; D, time 3, censored; E, time 3, event; F, time 4, event; G, time 4, censored; H, time 6, censored; I, time 6, event; J, time 8, event. Find the risk-set sizes and event counts. As in the preceding example, no interest, mortality assumption, or parametric distribution is part of this calculation.
The records are already listed in time order. The event times are 1.5, 3, 4, 6, and 8. The time-2 observation is censored, but it still affects which records remain at risk later.
At time 1.5, all ten records have observed times at least 1.5. Thus \(Y(1.5)=10\), and A is the only event, so \(d(1.5)=1\).
At time 3, A and B ended earlier: A had an event at 1.5, and B was censored at 2. The risk set is C, D, E, F, G, H, I, and J. Hence \(Y(3)=8\). C and E are events at time 3, while D is censored there, so \(d(3)=2\).
At time 4, the records with observed times at least 4 are F, G, H, I, and J. Therefore \(Y(4)=5\). F is the only event at time 4, giving \(d(4)=1\).
At time 6, only H, I, and J have observed times at least 6, so \(Y(6)=3\). H is censored and I is an event at time 6; therefore \(d(6)=1\). At time 8, only J remains in the risk set, giving \(Y(8)=1\) and \(d(8)=1\).
| Event time \(t\) | Records in \(R(t)\) | \(Y(t)\) | \(d(t)\) |
|---|---|---|---|
| 1.5 | A, B, C, D, E, F, G, H, I, J | 10 | 1 |
| 3 | C, D, E, F, G, H, I, J | 8 | 2 |
| 4 | F, G, H, I, J | 5 | 1 |
| 6 | H, I, J | 3 | 1 |
| 8 | J | 1 | 1 |
Check. The risk set at time 3 excludes both records that ended before 3, not just the earlier event. At times 3, 4, and 6, tied censorings are included in the risk-set membership but excluded from \(d(t)\). This separates the two counts correctly.
Worked Example: Tracking Intermediate Censoring Times
A hypothetical portfolio follows eleven policies. A, time 0.5, is censored; B, time 1, has an event; C, time 1, is censored; D, time 2, is censored; E, time 2.5, has an event; F, time 2.5, has an event; G, time 3, is censored; H, time 4, has an event; I, time 4, is censored; J, time 6, has an event; K, time 7, is censored. Determine \(Y(t)\) and \(d(t)\) at every event time. These are observed-time counts only, with no interest, mortality assumption, or parametric distribution.
The event times are 1, 2.5, 4, and 6. The censoring at time 0.5 occurs before the first event time; the censorings at 1, 2, 3, 4, and 7 are retained in the sorted records, even though they do not create event times themselves.
At time 1, A has ended at 0.5, leaving ten records in the risk set. B is the only event at time 1, so \(Y(1)=10\) and \(d(1)=1\).
At time 2.5, B ended at 1 and C ended at 1; D was censored at 2. These three records are excluded. The remaining records are E, F, G, H, I, J, and K, so \(Y(2.5)=7\). E and F are both events at 2.5, hence \(d(2.5)=2\).
At time 4, E and F have ended at 2.5 and G was censored at 3. The risk set is H, I, J, and K, giving \(Y(4)=4\). H is an event at 4, while I is censored at 4, so \(d(4)=1\).
At time 6, H and I have both ended at 4. Only J and K remain, so \(Y(6)=2\), and J is the sole event at 6: \(d(6)=1\).
| Event time \(t\) | Records in \(R(t)\) | Risk-set size \(Y(t)\) | Event count \(d(t)\) |
|---|---|---|---|
| 1 | B, C, D, E, F, G, H, I, J, K | 10 | 1 |
| 2.5 | E, F, G, H, I, J, K | 7 | 2 |
| 4 | H, I, J, K | 4 | 1 |
| 6 | J, K | 2 | 1 |
Check. From time 1 to time 2.5, B and C have ended at 1 and D at 2, so the risk set falls from 10 to 7. From 2.5 to 4, E and F end at 2.5 and G at 3, so it falls from 7 to 4. The intermediate censoring times matter even though they are not event times.
Common Mistake: Counting Records That Ended Earlier
A tempting shortcut is to begin with the total number of records and subtract only earlier events. That is incorrect: an earlier censored record has also left observation and cannot be in a later risk set. For example, in the first worked example, counting all eight records at time 2 is wrong because A ended at time 1. The correct calculation is \(8-1=7\). At time 4, three records—A, B, and C—ended before 4, so the correct risk-set size is \(8-3=5\), not 6.
A second error is to count everyone at the event time as an event. At time 4 in that example, D, E, and no others have records ending exactly then; both D and E are events, so \(d(4)=2\). At time 7, G is an event and H is censored: both belong to the risk set, but only G contributes to the event count. The general check is to calculate \(Y(t)\) from all records with \(Z_i\ge t\), then calculate \(d(t)\) only from records with \(Z_i=t\) and \(\delta_i=1\).
Check Your Understanding
For each problem, identify the distinct event times and reconstruct the risk-set size and event count at each one. Treat each record ending exactly at an event time as in the risk set, whether it is an event or a censoring.
- A study has six records: A, time 1, censored; B, time 2, event; C, time 2, event; D, time 3, censored; E, time 4, event; F, time 4, censored. State the risk-set size and event count at every event time. (Answer: time 2: \(Y=5,d=2\); time 4: \(Y=2,d=1\).)
- Seven records have times and indicators: A, 1, event; B, 2, censored; C, 3, event; D, 3, censored; E, 5, event; F, 5, censored; G, 6, event. Give the event-time risk-set sizes and event counts. (Answer: time 1: \(Y=7,d=1\); time 3: \(Y=5,d=1\); time 5: \(Y=3,d=1\); time 6: \(Y=1,d=1\).)
- Eight records are: A, 1, censored; B, 2, event; C, 2, censored; D, 3, event; E, 4, censored; F, 4, event; G, 6, event; H, 7, censored. Find the risk-set size and event count at each event time. (Answer: time 2: \(Y=7,d=1\); time 3: \(Y=5,d=1\); time 4: \(Y=4,d=1\); time 6: \(Y=2,d=1\).)
- Nine records end as follows: A, 0, censored; B, 1, event; C, 2, censored; D, 2, censored; E, 3, event; F, 4, censored; G, 5, event; H, 5, censored; I, 8, event. Find \(Y(t)\) and \(d(t)\) at every event time. (Answer: time 1: \(Y=8,d=1\); time 3: \(Y=5,d=1\); time 5: \(Y=3,d=1\); time 8: \(Y=1,d=1\).)
- Nine records are: A, 1, event; B, 2, event; C, 2, censored; D, 3, event; E, 3, censored; F, 4, censored; G, 5, event; H, 5, censored; I, 6, event. Determine the risk-set size and event count at each event time. (Answer: time 1: \(Y=9,d=1\); time 2: \(Y=8,d=1\); time 3: \(Y=6,d=1\); time 5: \(Y=3,d=1\); time 6: \(Y=1,d=1\).)