Tutorials › Competing Risks and Multi-State Models › Deriving PWP Event-Order Risk Sets

Recurrent-Event Estimands and Models · Tutorial 581 of 699

Deriving PWP Event-Order Risk Sets

Learn to construct and check PWP event-order risk sets, including delayed entry and the distinction between eligibility and the chosen time clock.

Advanced 11 min read

What You'll Learn

  • Define the event-order risk indicator from prior recurrence times, entry, and censoring
  • Determine eligibility for a subsequent event at a particular event time
  • Represent left truncation as delayed entry into the appropriate event-order risk interval
  • Translate the same eligibility interval between total-time and gap-time clocks
  • Diagnose common risk-set construction errors and distinguish PWP eligibility from Andersen–Gill risk sets

Why Event-Order Risk Sets Need Their Own Indicators

In a recurrent-event study, having follow-up does not by itself make a person eligible to experience every event order. A participant must first experience the required number of earlier recurrences. For example, someone cannot be at risk for a third recurrence until the second has occurred. The PWP approach makes this condition explicit by defining a separate risk process for each event order.

The same eligibility logic applies whether time is measured from study origin or reset after each recurrence. The clock changes the time scale used to describe a risk interval; it does not change which prior events are required to enter that interval. This tutorial derives that distinction and shows how delayed entry and censoring modify the interval.

Definition: For participant \(i\), let \(T_{ij}\) be the time of the \(j\)th recurrence, ordered so that \(T_{i1}<T_{i2}<\cdots\), and define \(T_{i0}=0\). Let \(L_i\) be the time observation begins and \(C_i\) the censoring time. The event-order-\(k\) risk indicator \(Y_{ik}(t)\) equals 1 when participant \(i\) is under observation at time \(t\), has experienced exactly \(k-1\) recurrences before \(t\), and has not yet experienced the \(k\)th recurrence. Otherwise, it equals 0.

Use the pre-event history convention: an individual experiencing an event at \(t\) is considered at risk immediately before that event. Assume initially that recurrence times are distinct and that entry and event times do not coincide. An explicit boundary convention is needed for ties in actual data. A participant with fewer than \(k-1\) recurrences before censoring never enters the order-\(k\) risk interval.

Deriving the Total-Time Risk Indicator

For event order \(k\), eligibility begins only after the \((k-1)\)th recurrence. Observation must also have begun. Therefore, the start of the interval is the later of study entry and the preceding recurrence, \(\max(L_i,T_{i,k-1})\). The interval ends at the earlier of the \(k\)th recurrence and censoring. With the convention that a subject is at risk just before an event at the interval's right endpoint, the indicator is

$$ Y_{ik}(t) = I\!\left\{ \max(L_i,T_{i,k-1})<t \leq \min(T_{ik},C_i) \right\}. $$

If the \(k\)th recurrence is not observed, take \(T_{ik}=\infty\), so censoring ends the interval. If the \((k-1)\)th recurrence occurs after censoring, the inequalities cannot both hold and the participant is never eligible for event order \(k\). For \(k=1\), \(T_{i0}=0\), so the indicator describes ordinary first-event follow-up, subject to entry and censoring.

Equivalently, just before \(t\), the participant must satisfy \(L_i<t\leq C_i\) and have exactly \(k-1\) recurrences. The interval form makes the entry and exit times especially easy to check. The event at \(T_{ik}\), if observed after entry and before censoring, has event indicator

$$ dN_{ik}(t) = I\{t=T_{ik},\ L_i<T_{ik}\leq C_i,\ T_{i,k-1}<T_{ik}\}. $$

Thus \(Y_{ik}(T_{ik})=1\) at an observed \(k\)th event: the participant was at risk immediately before it occurred. After that event, the participant leaves the order-\(k\) risk interval and may enter the order-\((k+1)\) interval. This separation of event-order intervals is the defining eligibility feature of PWP risk sets.

Justification: Before \(T_{i,k-1}\), fewer than \(k-1\) recurrences have occurred, so the \(k\)th event is not yet eligible. After \(T_{i,k-1}\), the participant is eligible until \(T_{ik}\). Observation limits that interval to times after \(L_i\) and no later than \(C_i\). Intersecting these conditions gives the displayed indicator; its strict lower bound and inclusive event endpoint implement the pre-event risk convention.

The indicator is the eligibility part of a PWP event-specific hazard specification. For example, the order-\(k\) hazard is zero whenever \(Y_{ik}(t)=0\); its nonzero form may depend on the chosen clock and covariates. The risk indicator does not, by itself, specify a covariate effect or determine whether effects are shared across event orders.

Worked Example: Building Total-Time Risk Sets by Event Order

Consider four hypothetical participants, all observed from time 0. Their recurrence times and censoring times (in months) are: A: events at 2, 5, and 9, censored at 12; B: an event at 3, censored at 7; C: events at 1 and 4, censored at 6; and D: events at 2 and 8, censored at 10. Assume no ties.

For order 2, a participant enters after the first event and leaves at the second event or censoring. The risk intervals are A: \((2,5]\), B: \((3,7]\), C: \((1,4]\), and D: \((2,8]\), in months. At the second event at month 4, for C, the indicator values are \(Y_{A2}(4)=1\), \(Y_{B2}(4)=1\), \(Y_{C2}(4)=1\), and \(Y_{D2}(4)=1\). Each has had a first recurrence and has not yet had a second. C is included at month 4 because it is at risk immediately before its event.

At A's second event at month 5, \(Y_{A2}(5)=1\), \(Y_{B2}(5)=1\), \(Y_{C2}(5)=0\), and \(Y_{D2}(5)=1\). C has already experienced its second event at month 4, so it is no longer in the order-2 risk set. B remains eligible because its censoring time is month 7.

For order 3, the intervals are A: \((5,9]\) and D: \((8,10]\). B never reaches order 3 before censoring, and C is censored at month 6 after only two events. At month 9, when A experiences its third event, A and D are both at risk for order 3: \(Y_{A3}(9)=Y_{D3}(9)=1\). The other two indicators are 0. This example shows why the risk set must be rebuilt for each order, rather than treating all observed follow-up as eligibility for every recurrence.

Delayed Entry: Eligibility Begins When Both Conditions Hold

With delayed entry, the participant may have already experienced recurrences before observation begins. If that history is known, it determines the event order for which the participant is eligible at entry. The total-time interval still starts at \(\max(L_i,T_{i,k-1})\). If \(T_{i,k-1}<L_i\), entry—not the prior recurrence—is the start of observed risk time for event order \(k\). If the prior recurrence occurs after entry, eligibility starts at that recurrence instead.

A key distinction is whether the earlier event itself was observed. A recurrence before \(L_i\) can establish prior event order when the history is known, but it contributes no observed risk time or event to the study after entry. If pre-entry event history is unknown, the correct order at entry cannot simply be assumed from incomplete records; the PWP risk classification would require additional data or a different design assumption.

Worked Example: Delayed Entry into the Third-Event Risk Set

Suppose hypothetical participant B enters observation at month 4. The known history is that the first two events occurred at months 1 and 3. The third event occurs at month 6, and censoring occurs at month 8. For order 3, the total-time start is \(\max(4,3)=4\), and the end is \(\min(6,8)=6\). Thus \(Y_{B3}(t)=1\) for \(4<t\leq6\). At month 6, B is included in the order-3 risk set immediately before the event.

For order 2, the second event occurred at month 3, before observation began. Its event indicator in the observed follow-up is 0, and B has no observed order-2 risk interval: the proposed interval would require both \(t>4\) and \(t\leq3\), which is impossible. The known pre-entry history makes B eligible for order 3 at entry, but it does not turn the pre-entry second event into an observed study event.

Now suppose a second hypothetical participant, C, enters at month 2, experiences the first event at month 4, the second at month 7, and is censored at month 9. For order 2, the risk interval is \((4,7]\); for order 3, it is \((7,9]\). At month 6, C is not yet eligible for order 3, even though C is under observation. C enters that risk set only after the second event at month 7.

Translating Eligibility to the Gap-Time Clock

The PWP gap-time clock measures time since the preceding recurrence. For order \(k\), define gap time \(u=t-T_{i,k-1}\). Transforming the total-time interval gives an order-\(k\) gap-time interval that starts after both the prior recurrence and any delayed-entry restriction, and ends at the earlier of the next recurrence and censoring.

$$ Y^{G}_{ik}(u) = I\!\left\{ \max(0,L_i-T_{i,k-1})<u \leq \min(T_{ik}-T_{i,k-1},\,C_i-T_{i,k-1}) \right\}. $$

The formula applies when the preceding recurrence is known and the participant can reach order \(k\). If censoring occurs before that recurrence, there is no eligible order-\(k\) interval. When the preceding recurrence occurred before entry, the gap-time clock has already advanced at entry: the left endpoint is \(L_i-T_{i,k-1}>0\). When entry precedes the preceding recurrence, the participant starts at gap time zero after that recurrence.

Worked Example: Delayed Entry on the Gap-Time Scale

Use participant B from the previous example: entry at month 4, second event at month 3, third event at month 6, and censoring at month 8. For order 3, the elapsed times from the second event are \(L_i-T_{i2}=4-3=1\), \(T_{i3}-T_{i2}=6-3=3\), and \(C_i-T_{i2}=8-3=5\) months. Therefore,

$$ Y^{G}_{B3}(u) = I\{1<u\leq\min(3,5)\} = I\{1<u\leq3\}. $$

At the third event, the gap time is \(u=3\), so B is included immediately before that event. Starting B at gap time 0 would incorrectly add the unobserved interval from month 3 to month 4. Starting B at calendar time 4 but labelling that as gap time 4 would also be wrong: the gap clock was already one month old at entry.

Checks, Comparisons, and Limits

A practical construction check is to write the interval endpoints for each person and event order before assembling event-time risk sets. At an observed \(k\)th event, confirm that the event subject has \(Y_{ik}(T_{ik})=1\), and that its order-\((k-1)\) interval has already ended. At an event time \(t\), a subject belongs to the order-\(k\) risk set only if \(Y_{ik}(t)=1\). These checks catch errors that are hard to see in a long start-stop data table.

  • Eligibility is not the same as being observed. A person under follow-up but with fewer than \(k-1\) prior events is not at risk for event order \(k\).
  • Do not carry a person forward after the \(k\)th event. That event ends the order-\(k\) interval; eligibility for order \(k+1\) begins only after it.
  • Do not erase known pre-entry history. It may determine the event order at entry, even though pre-entry events are not observed outcomes in the study.
  • Check censoring before eligibility. A participant censored before the \((k-1)\)th event contributes no order-\(k\) risk time.

The Andersen–Gill model uses a recurrent-event risk process based on being under observation and not censored, without requiring the participant to have completed exactly \(k-1\) events before entering a particular event-order interval. PWP adds that sequential eligibility restriction. The total-time and gap-time PWP constructions share the same event-order eligibility but place intervals on different clocks; the clock choice should not be confused with the rule for who qualifies to enter.

Risk indicators also do not settle every design issue. The analysis must have correctly ordered event histories, a defined entry time, and an appropriate treatment of censoring and any terminal event. In particular, censoring or entry that depends on unaccounted event history can invalidate the intended hazard analysis. Tied events, ties between entry and an event, and events recorded only to coarse time units require a stated convention and software implementation consistent with it. The indicator is a bookkeeping and modeling device, not a remedy for incomplete histories or unsuitable observation assumptions.

Key takeaway: The order-\(k\) PWP risk interval begins only after the \((k-1)\)th recurrence and observation entry have both occurred, and ends at the \(k\)th recurrence or censoring. Delayed entry truncates observed risk time; changing from total time to gap time changes the clock, not the eligibility rule.

Check Your Understanding

For each question, first determine eligibility, then apply entry and censoring.

  1. A participant enters at month 0, has events at months 2 and 6, and is censored at month 10. Give the order-3 total-time risk interval.
  2. A participant enters at month 5 with known first and second events at months 1 and 4, then has a third event at month 7 and is censored at month 9. What is the order-3 gap-time interval?
  3. A participant has one event at month 3 and is censored at month 5. Is this person at risk for event order 3 at month 4?
  4. At the exact time of an observed third event, should the event subject be included in the order-3 risk set under the pre-event convention?

Solutions. (1) The third-event interval starts after the second event at month 6 and ends at censoring, so it is \((6,10]\). (2) The gap-time entry is \(5-4=1\), the third event is at \(7-4=3\), and censoring is at \(9-4=5\), so the interval is \((1,3]\). (3) No. The participant has not experienced the required two prior events; censoring occurs before order 3 eligibility can begin. (4) Yes. The participant is at risk immediately before the event, so the risk indicator equals 1 at the event time under the stated convention.

Clinical Biostats