Why Event-Order Records Need Their Own Risk Sets
A recurrent-event history may contain several event times for each person, but a WLW analysis organizes the data around the time to each event order. It creates one marginal time-to-event outcome for the first recurrence, another for the second, and so on. The risk set for a given order is not restricted to people who have already experienced all earlier events: a person who has not yet had a first recurrence can still contribute to the marginal analysis of the second recurrence.
This construction differs from the conditional event-order risk sets used in PWP models. The distinction is consequential: it changes who is compared at an event time, and therefore the analysis answers a different question. Here the focus is how to define the WLW records and determine membership in those risk sets.
The latent times are ordered within a subject: \(T_{i1}\le T_{i2}\le T_{i3}\le\cdots\), with the possibility that one or more times equal infinity. The order is by recurrence number, not by a separate clock reset after each event. The WLW construction uses a common origin for these event-order outcomes. If an event and censoring are recorded at the same time, the convention above treats the event as observed; the data protocol must use a consistent convention.
For a fixed order \(k\), the usual WLW risk set immediately before time \(t\) is $$ R_k(t)=\{i:Y_{ik}\ge t\}. $$ Subjects with \(Y_{ik}=t\) are included just before that time, whether an event or censoring occurs at \(t\). Equivalently, a subject is in this risk set if their \(k\)th-event outcome has not ended before \(t\). With delayed entry at \(L_i\), membership also requires \(L_i\le t\); the examples below assume entry at the common origin.
Constructing the Event-Order Outcomes
For each subject, first place their observed recurrence times in chronological order. Then, for each order \(k\), record the time to the \(k\)th event if observed; otherwise record the censoring time. The event indicator is one only when that ordered recurrence occurred by the end of observable follow-up. An absent recurrence is not assigned an event time of zero, and a subject with fewer observed events than the order being considered is not dropped.
Worked Example: Building Records for Three Event Orders
Suppose five hypothetical subjects share a common time origin. Their observable follow-up ends at the times shown, and their recurrence times are measured from that origin. The table gives the resulting \((Y_{ik},\Delta_{ik})\) pair for each order.
| Subject | End of follow-up \(C_i\) | Order 1: \((Y,\Delta)\) | Order 2: \((Y,\Delta)\) | Order 3: \((Y,\Delta)\) |
|---|---|---|---|---|
| A | 8 | (2, 1) | (5, 1) | (8, 0) |
| B | 6 | (3, 1) | (6, 0) | (6, 0) |
| C | 9 | (1, 1) | (4, 1) | (7, 1) |
| D | 5 | (5, 0) | (5, 0) | (5, 0) |
| E | 7 | (2, 1) | (6, 1) | (7, 0) |
For subject C, the second recurrence occurs at time 4 before follow-up ends at 9, so \(Y_{C2}=\min(4,9)=4\) and \(\Delta_{C2}=I(4\le9)=1\). Their third recurrence occurs at time 7, giving \(Y_{C3}=\min(7,9)=7\) and \(\Delta_{C3}=I(7\le9)=1\).
Subject B has only one observed recurrence before follow-up ends at 6. Their latent second-event time is later than 6 (or infinity), so \(Y_{B2}=\min(T_{B2},6)=6\) and \(\Delta_{B2}=I(T_{B2}\le6)=0\). The same reasoning gives \((Y_{B3},\Delta_{B3})=(6,0)\). Subject D has no observed recurrence before time 5, so all three records are censored at 5. These are valid event-order records, not missing rows.
The displayed table contains observed outcomes; it does not claim that the exact latent event times for censored records are known. For instance, the data establish \(T_{B2}>6\), not its value after time 6.
A common marginal model gives each event order its own baseline hazard, for example \(\lambda_{ik}(t)=\lambda_{0k}(t)\exp(\beta_k^\mathsf{T}Z_i)\) for a time-fixed covariate vector \(Z_i\). The record \((Y_{ik},\Delta_{ik})\) determines whether subject \(i\) is at risk for, and has an observed event of, order \(k\) at each time. This tutorial concerns that construction, not the interpretation of the resulting coefficients.
Why Earlier Recurrences Do Not Define WLW Entry
For each \(k\), the marginal outcome is \(T_{ik}\), the time from the common origin to the \(k\)th recurrence. At time \(t\), being at risk for that outcome means that \(T_{ik}\) has not yet occurred and that the subject remains observed. It does not require that the subject has already experienced event \(k-1\). Indeed, a person with fewer than \(k\) recurrences by \(t\) necessarily has \(T_{ik}\ge t\), so that person is a member of the risk set if still under observation.
This can be seen directly from the definition of the event-order risk set. Since \(Y_{ik}=\min(T_{ik},C_i)\), the condition \(Y_{ik}\ge t\) says both \(T_{ik}\ge t\) and \(C_i\ge t\). It imposes no separate condition on the count of earlier recurrences:
A PWP risk set for order \(k\), by contrast, requires a subject to have experienced event \(k-1\) before entering the analysis of event \(k\). That conditional eligibility rule is central to PWP, not WLW. The WLW records are marginal and correlated across orders because the same person can contribute several records; they must not be treated as independent people merely because they occupy separate rows.
Worked Example: Finding Risk Sets at an Event Time
Use the hypothetical records in the table above. Find the risk sets immediately before time 4 for event orders 1, 2, and 3. Use \(R_k(4)=\{i:Y_{ik}\ge4\}\).
For order 1, the observed times are 2, 3, 1, 5, and 2. Only subject D has \(Y_{i1}\ge4\), so \(R_1(4)=\{D\}\). There is no order-1 event at time 4 in this cohort.
For order 2, the observed times are 5, 6, 4, 5, and 6. Each is at least 4, so \(R_2(4)=\{A,B,C,D,E\}\). Subject C has an order-2 event at time 4 because \(Y_{C2}=4\) and \(\Delta_{C2}=1\). Subject D is included despite having no observed first recurrence: their order-2 record is censored at 5, so they remain under observation and at risk at time 4.
For order 3, the observed times are 8, 6, 7, 5, and 7. Again, each is at least 4, giving \(R_3(4)=\{A,B,C,D,E\}\). None has an order-3 event at time 4. In particular, the records for B and D are not discarded because they have not experienced three events; their order-3 outcomes are simply censored.
At time 6 for order 2, \(R_2(6)=\{B,E\}\), since their order-2 observed times equal 6. Subject E has an event at 6 (\(\Delta_{E2}=1\)); subject B is censored at 6 (\(\Delta_{B2}=0\)). Both are in the risk set immediately before time 6 under the stated boundary convention. A software implementation must handle tied event and censoring times consistently with its stated convention.
Assumptions, Checks, and Failure Modes
The risk-set rule is a data construction, but valid inference from the marginal survival model also requires assumptions. The event order and common time origin must be well defined, recurrence times must be correctly ordered and recorded, and each subject's observable follow-up must be represented accurately. For ordinary right-censored analysis, censoring must be independent of the relevant event time conditional on the modeled covariates, or handled by an appropriate method when that condition is not plausible. In particular, death that prevents further recurrence is not automatically an independent censoring event; treating it as ordinary censoring may change the estimand or introduce bias.
For event-order-specific Cox models, proportional hazards and the model's covariate specification are additional assumptions. Those assumptions are not guaranteed by constructing correct records. Ties in recurrence times require an explicit and consistently applied tie-handling method. Dependence among the event-order records from the same subject also matters for standard errors; the records do not become independent simply because each order has a separate risk set.
Useful checks before fitting include comparing each subject's event-order times, confirming that \(Y_{i1}\le Y_{i2}\le\cdots\) for the constructed records, and verifying that every observed event has \(\Delta_{ik}=1\) at its actual event time. For a censored order, check that the recorded time is \(C_i\) and the indicator is zero. Then inspect risk-set membership at selected event times: a person censored earlier must be absent, while a person still followed and not yet at the specified event order must remain eligible.
- Dropping people with fewer than \(k\) observed events. This conditions the order-\(k\) analysis on prior event history and removes the marginal WLW inclusion rule. Keep their censored order-\(k\) records.
- Starting an order-\(k\) clock at event \(k-1\). That is a gap-time or conditional construction, not the WLW common-origin outcome described here.
- Entering a subject only after event \(k-1\). This produces a PWP-style risk set. For WLW, entry is from the common origin, subject to being under observation.
- Using an observed event time where the event was not observed. For a censored order, use \(Y_{ik}=C_i\) and \(\Delta_{ik}=0\); do not treat an unknown latent time as recorded data.
A further limitation is interpretive: marginal event-order records represent distinct outcomes from the same cohort, not independent replicated cohorts. Their risk sets can include people with very different earlier histories. This is appropriate for the WLW marginal construction, but it is not a claim that the hazard is conditional on having completed all earlier recurrences. If the scientific question specifically concerns the next event among those who reached a given order, the conditional PWP approach is the natural contrast.
A Practical Construction Sequence
The following sequence makes the data transformation auditable. It also separates the recording of outcomes from the later fitting of a model.
For each subject, sort observed recurrences from the common origin and label them \(1,2,\ldots\).
For each \(k\), use the observed time of recurrence \(k\), if it occurred by \(C_i\); otherwise use \(C_i\) as the censoring time.
Set \(\Delta_{ik}=1\) for an observed \(k\)th recurrence and zero when that order is censored. The latent-time definition makes \(Y_{ik}=\min(T_{ik},C_i)\) and \(\Delta_{ik}=I(T_{ik}\le C_i)\) well defined even when \(T_{ik}\) is not observed.
At time \(t\), include every subject with \(Y_{ik}\ge t\) (and who has entered observation by \(t\), if delayed entry applies). Do not impose a prior-event requirement.
Worked Example: Auditing a Long-Format Data Set
Suppose the five-subject cohort above is stored in long format with one row per subject and event order. At time 4, the order-2 risk-set indicator for subject D is \(I(Y_{D2}\ge4)=I(5\ge4)=1\). Their event indicator is \(\Delta_{D2}=0\), so D contributes as a non-event member of the order-2 risk set. For subject A, \(I(Y_{A2}\ge4)=I(5\ge4)=1\) and \(\Delta_{A2}=1\) at time 5, not 4. For subject C, \(I(Y_{C2}\ge4)=I(4\ge4)=1\) and \(\Delta_{C2}=1\), identifying the event at time 4.
Thus the order-2 risk-set size immediately before time 4 is \(1+1+1+1+1=5\), and the event at that time belongs to C alone. If a data table instead omitted D because D had no first recurrence, its computed risk-set size would be 4 and it would no longer implement the WLW marginal risk set. If it marked B as an event at time 6, it would confuse censoring with recurrence: B has \(Y_{B2}=6\) but \(\Delta_{B2}=0\).
Common Mistake and Key Takeaway
The most tempting mistake is to reason, “A subject cannot be at risk for recurrence \(k\) until recurrence \(k-1\) has happened.” That statement is the eligibility logic of a conditional event-order analysis, not the WLW marginal construction. WLW assigns each subject an outcome \(T_{ik}\) measured from the common origin and includes the subject in \(R_k(t)\) while that outcome has not occurred and follow-up continues. If fewer than \(k\) events have occurred by \(t\), the subject remains at risk for the \(k\)th-event outcome; if follow-up ends first, the record is censored.
Check Your Understanding
Answer each question using the common-origin WLW construction and the event-before-censoring boundary convention.
- A subject's second recurrence occurs at time 7, and follow-up ends at time 9. What are \(Y_{i2}\) and \(\Delta_{i2}\)?
- A subject has one observed recurrence by time 4, remains under follow-up until time 8, and has no second recurrence by then. What is the order-2 record?
- At time 5, a subject has \(Y_{i3}=5\) and \(\Delta_{i3}=0\). Are they in \(R_3(5)\), and did an order-3 event occur at time 5?
- Explain why a person with no observed first recurrence can still be in the WLW risk set for order 2 at time \(t\).
- What risk-set change would result if an analyst excluded all subjects until they had experienced event \(k-1\)?
Solutions. (1) \(Y_{i2}=\min(7,9)=7\), and \(\Delta_{i2}=I(7\le9)=1\). (2) The second event is censored at follow-up end, so \((Y_{i2},\Delta_{i2})=(8,0)\); its unknown latent time is not substituted as an observed event time. (3) Yes: \(Y_{i3}=5\ge5\), so the subject is in the risk set immediately before time 5. No order-3 event occurred there because \(\Delta_{i3}=0\). (4) If still under observation, the subject's second-event time has not occurred by \(t\); WLW uses the common origin and does not require a prior-event entry condition. (5) The analyst would impose conditional eligibility based on prior recurrence and remove people who have not reached event \(k-1\), thereby producing a PWP-style rather than WLW risk set.