Why Encoding Matters
Survival data do not always reveal the time at which an event occurs. A hypothetical insurer may observe a policyholder only until coverage ends, or a maintenance study may lose contact with a device before it fails. In either case, the record contains useful information, but it does not give an exact event time. Encoding the record correctly preserves that distinction.
For survival estimation, each usable observation is represented by two pieces of information: an observed time and an event indicator. Together, they state how long the subject was observed and whether a failure was confirmed by then. A censored time is not an observed failure time; treating it as one changes what the data say.
A record with \(\delta_i=1\) gives an exact observed event time: \(T_i=Y_i\). A record with \(\delta_i=0\) is right-censored at \(Y_i\): the subject is known to have remained event-free through the observed period, but the event time after that point is unknown. The censoring time is a limit on what was observed, not an estimate of when the event occurred.
In the usual continuous-time convention, an observed event at or before the censoring time is recorded with \(\delta_i=1\); when the event is not observed before follow-up ends, \(\delta_i=0\). If a record reports an event and censoring at the same recorded time, use the stated event status rather than guessing from the time alone. This tutorial concerns the encoding of records, not the later calculation of a survival estimator.
From the Observation Process to the Record
The representation follows directly from what can be seen. Observation continues only until either the event happens or observation stops. The earlier of those two times is therefore the observed time. If the event happens first, its time is known. If observation stops first, the only event-time information is that the event was not seen during follow-up.
To see why this encoding is sufficient for classifying an individual record, consider its two possible cases. If \(T_i\le C_i\) and the event is recorded, then \(Y_i=T_i\) and \(\delta_i=1\); the event time is known. If \(C_i<T_i\), then \(Y_i=C_i\) and \(\delta_i=0\); the record establishes that the event had not been observed by \(C_i\), but does not reveal \(T_i\). The second case cannot be replaced by an exact event at \(C_i\), because that would assert information the observation process did not provide.
A subject with no event during follow-up can still contribute a right-censored record if a usable time through which the subject was observed event-free is known. By contrast, a file with no reliable follow-up time or event status cannot be encoded as \((Y_i,0)\): the required \(Y_i\) has not been established. This distinction prevents missing information from being silently converted into censoring.
Worked Example: Encoding Equipment Follow-Up
A hypothetical reliability study follows eight identical sensors, with time measured in weeks from installation. The records report a confirmed failure time when a sensor fails; otherwise, they report the last week through which it was checked and known to be operating. Encode each record and list the distinct observed failure times.
| Sensor | Record | Observed time \(Y_i\) | Indicator \(\delta_i\) |
|---|---|---|---|
| A | Failed at week 1.5 | 1.5 | 1 |
| B | Operating at last check, week 2 | 2 | 0 |
| C | Failed at week 3 | 3 | 1 |
| D | Operating at last check, week 4 | 4 | 0 |
| E | Failed at week 5.5 | 5.5 | 1 |
| F | Operating at last check, week 6 | 6 | 0 |
| G | Failed at week 7 | 7 | 1 |
| H | Operating at final check, week 8 | 8 | 0 |
Step 1: Encode confirmed failures. Sensors A, C, E, and G have observed failures. Their records are \((1.5,1)\), \((3,1)\), \((5.5,1)\), and \((7,1)\).
Step 2: Encode observation ending without failure. Sensors B, D, F, and H were known to be operating through their last checks. Their records are \((2,0)\), \((4,0)\), \((6,0)\), and \((8,0)\).
Step 3: Extract the event times. Keep only observed times paired with indicator 1. The distinct observed event times are \(1.5,\ 3,\ 5.5,\ 7\) weeks. The censoring times \(2,\ 4,\ 6,\ 8\) are not event times.
Check. There are eight encoded records: four with \(\delta_i=1\) and four with \(\delta_i=0\). This matches the four reported failures and four operating-at-last-check records. The method avoids the mistake of treating the final check of sensor H as a failure at week 8.
Read the Record Before Assigning the Indicator
The phrase “observed until time \(t\)” does not by itself say whether an event occurred at \(t\). Look for the status information that accompanies the time. “Failed at \(t\)” gives an observed event; “known to be operating at \(t\), then lost to follow-up” gives censoring at \(t\). If the status cannot be determined, do not invent an indicator.
Confirm what starts the clock and whether the reported duration is in days, months, or another unit. Convert durations only when the problem requires a common unit.
A confirmed event gives an event indicator of 1. Follow-up ending without an observed event gives an indicator of 0, provided the observed duration is known.
Record the observed duration as \(Y_i\) and the event status as \(\delta_i\). Do not substitute a presumed later event time for a censored record.
Retain the \(Y_i\) values for records with \(\delta_i=1\). Keep censored records in the data, but do not label their observed times as failures.
Worked Example: Converting Follow-Up Records with Different Endings
A hypothetical portfolio study measures time in months from policy issue until a specified claim event. Six policy records are: (A) claim event confirmed at month 4.2; (B) no event through month 5.0, then contact is lost; (C) event confirmed at month 8.0; (D) coverage ends at month 3.5 with no event; (E) event confirmed at month 6.0; and (F) last known event-free at month 7.0, after which the study cannot obtain further information. Encode the records and identify the event times.
Step 1: Identify exact observed events. A, C, and E have confirmed events. Therefore their pairs are \((4.2,1)\), \((8.0,1)\), and \((6.0,1)\), respectively.
Step 2: Identify known event-free observation endings. For B, the record establishes no event through month 5.0, so its pair is \((5.0,0)\). For D, coverage ends at month 3.5 without an event, giving \((3.5,0)\). For F, event-free status is known through month 7.0, giving \((7.0,0)\).
Step 3: List distinct event times. The indicators equal to 1 occur at months 4.2, 8.0, and 6.0. In increasing order, the distinct observed event times are \(4.2,\ 6.0,\ 8.0\) months. The censoring times are \(3.5,\ 5.0,\ 7.0\) months.
Check. The six records divide into three observed events and three censorings. The order in which the records were described does not determine the chronological order of their times; sorting the event times only after checking their indicators avoids accidentally including month 5.0 or 7.0 as a claim event.
Incomplete Files Are Not Automatically Censored
A right-censored record contains a known observation time and a known event-free status through that time. A file that merely lacks a claim date, inspection date, or final status may not supply either fact. Assigning it an observed time without evidence creates data rather than encoding them.
Worked Example: Reconciling Event, Censoring, and Missing Counts
A hypothetical study begins with ten devices. Its usable records show two confirmed failures at week 2, one confirmed failure at week 6, one device known to be operating through week 3 before contact ends, and two devices known to be operating through the planned final week 8. The other four files contain no reliable observation time or status. Count the encodable failures and censorings, list distinct event times, and classify the four remaining files.
Step 1: Count confirmed failures. Two devices failed at week 2 and one at week 6, so there are \(2+1=3\) observed failures. Their event-time records include \((2,1)\) twice and \((6,1)\) once. The distinct observed event times are weeks 2 and 6.
Step 2: Count known censorings. One device was observed event-free through week 3 and two were observed event-free through week 8. Thus the number of known right-censored records is \(1+2=3\), with records \((3,0)\) once and \((8,0)\) twice.
Step 3: Classify the other files. The four remaining files have neither a reliable observation time nor event status. They cannot be encoded as right-censored at week 8, because the study has not established that they were observed and event-free through week 8. They are unusable or missing records for this encoding.
Check. The ten starting files are accounted for as three observed failures, three right-censored records, and four files without usable follow-up. The six encodable records are exactly the three failures plus the three censorings. The method avoids both the arithmetic error of calling three censorings five and the data error of assigning the four incomplete files an unsupported censoring time.
Common Exam Traps
- Turning censoring into an event. If a device is last known to work at month 9, the record is \((9,0)\), not \((9,1)\). The observed time is 9; the event time remains unknown.
- Using only the time and ignoring the status. Two records can have the same observed time, one an event and one a censoring. Their indicators distinguish what was learned.
- Confusing a censoring time with an event time. The distinct event-time set uses only records with \(\delta_i=1\). A later procedure may use censored records in other ways, but their recorded endpoints are not observed failures.
- Calling a record censored when its follow-up time is unknown. Censoring requires a known point through which the subject was observed without the event. Missing status or duration alone does not establish that point.
- Ignoring the time origin or units. A time measured from policy issue is not interchangeable with time measured from renewal. State the origin and use consistent units before comparing times.
Correct encoding is the necessary first step for Kaplan-Meier and Nelson-Aalen estimation: those methods distinguish observed failures from censoring, and the observed failure times determine where event-related calculations are made. The encoding itself does not calculate either estimator or justify how censoring affects its interpretation; those are separate questions.
Check Your Understanding
For each item, encode the records where possible and distinguish event times from censoring times.
- A hypothetical pump fails at month 9 while scheduled inspection would otherwise continue to month 14. State its observed pair and whether month 9 is an observed event time. (Answer: \((9,1)\); yes, month 9 is an observed event time.)
- A hypothetical contract has no event through month 12, when the covered asset is sold and observation ends. Give the record and state what is known about the event time. (Answer: \((12,0)\); the asset was event-free through month 12, but its later event time is unknown.)
- Six observations are \((2,1),(2,0),(4,1),(5,0),(7,1),(8,0)\). How many observed events and censorings are there, and what are the distinct event times? (Answer: 3 observed events, 3 censorings; distinct event times are 2, 4, and 7.)
- Four records are \((3,0),(4,1),(4,0),(6,1)\). Which records are events, and what are the distinct event times? (Answer: the events are \((4,1)\) and \((6,1)\); the distinct event times are 4 and 6. The record \((4,0)\) is censored, not an event.)
- A study file says a participant's status is unknown and gives no last-known event-free date. Can a right-censored pair be assigned from that information alone? (Answer: no; without a reliable observed time and known event-free status through that time, the file cannot be encoded as a right-censored observation.)