Tutorials › Competing Risks and Multi-State Models › PWP Total-Time Model

Recurrent-Event Estimands and Models · Tutorial 579 of 699

PWP Total-Time Model

Specify a PWP total-time model, construct its event-order risk sets, and assess when its conditional recurrent-event analysis is appropriate.

Advanced 12 min read

What You'll Learn

  • Define eligibility for the \(k\)th event using the subject’s prior event history.
  • Specify the PWP total-time intensity model and its event-order-specific baseline hazards.
  • Distinguish the total-time clock from a clock reset at each recurrence.
  • Calculate a risk set and an event-time partial-likelihood contribution.
  • Check key model assumptions and recognize common risk-set and interpretation errors.

Why condition on event order?

Recurrent-event analyses must decide not only how to measure time, but also who is eligible to experience each event. The Prentice-Williams-Peterson (PWP) total-time model makes eligibility depend on event order: a subject can enter the risk set for event \(k\) only after experiencing event \(k-1\). At the same time, its clock continues to run from the study’s time origin rather than restarting after each recurrence.

This is useful when reaching the next event is meaningful only after reaching the previous one. For example, an analysis of time to a second hospitalization should not treat a person with no first hospitalization as currently at risk for a second. The model therefore describes event-order-specific, history-conditional intensities; it is not simply a model for an undifferentiated count of all events.

Definition: In a PWP total-time model, subjects are considered at risk for their \(k\)th recurrent event only after they have experienced their \((k-1)\)th event and while they remain under observation without having experienced event \(k\). The time variable is elapsed time since the study’s chosen origin, not elapsed time since the previous event.

Model specification and assumptions

Let \(i=1,\ldots,n\) index independent subjects and \(k=1,2,\ldots\) index event order. Write \(T_{ik}\) for the time of subject \(i\)'s \(k\)th event, and let \(C_i\) be the censoring time. Set \(T_{i0}=0\), where time zero is the chosen origin for follow-up. For a subject observed from time zero, define the at-risk indicator

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

This expression uses the history just before time \(t\): the prior event must already have occurred, and event \(k\) must not yet have occurred. At an event time \(T_{ik}\), the subject is included in the risk set immediately before that event. If observation starts after time zero at \(L_i\), include the additional condition \(L_i\leq t\). The indicator \(I\{\cdot\}\) equals 1 when the condition in braces is true and 0 otherwise.

Let \(N_{ik}(t)=I(T_{ik}\leq t)\) indicate that event \(k\) has occurred by time \(t\), and let \(X_i(t)\) be a covariate vector whose values at \(t\) are known just before \(t\). A standard stratified PWP total-time specification is

$$ \lambda_{ik}(t\mid\mathcal H_i(t-)) = Y_{ik}(t)\lambda_{0k}(t) \exp\{\beta^{\mathsf T}X_i(t)\}. $$

Here \(\mathcal H_i(t-)\) is the subject’s observed event and covariate history before \(t\); \(\lambda_{0k}(t)\) is the unspecified baseline intensity for event order \(k\); and \(\beta\) is a regression coefficient vector shared across event orders in this version of the model. The factor \(Y_{ik}(t)\) sets the intensity to zero when the subject is not eligible or no longer observed. Event-order-specific baselines allow the underlying intensity to differ between, for example, first and second events. A model with order-specific regression coefficients is possible, but it is a different, more flexible specification.

The model requires correctly recorded event times and event order, an appropriate time origin, and covariates that are measured on the intended scale. Time-varying covariates must be predictable: their value used at \(t\) cannot depend on information from after \(t\). Within each event order, the proportional-intensities assumption says that covariates act multiplicatively through \(\exp\{\beta^{\mathsf T}X_i(t)\}\). Censoring must be non-informative for the event process conditional on the modeled covariates and observed history; otherwise, the observed risk sets can be selectively depleted. Subjects are treated as independent clusters for the usual model-based analysis. Dependence among a subject’s own recurrences is accommodated through the event history and risk-set construction, not by pretending that each recurrence came from a new independent subject.

How eligibility follows from the event history

The defining condition can be checked directly. For a \(k\)th event to occur at time \(t\), event \(k-1\) must have occurred before \(t\). If event \(k\) has already occurred, or observation has ended, the subject cannot contribute further time at risk for that event order. Thus the risk set just before \(t\) is

$$ \mathcal R_k(t)=\{i:T_{i,k-1}<t\leq \min(T_{ik},C_i)\}. $$

This is an event-order-specific risk set on the original time axis. The total-time clock does not imply that every subject is at risk from time zero: eligibility still begins only after the preceding event. In a Cox implementation with order-specific baselines, an event at time \(t\) in stratum \(k\) contributes a partial-likelihood factor comparing its covariates with those of the subjects in \(\mathcal R_k(t)\). For a single event and no tied event times, the factor is

$$ \frac{\exp\{\beta^{\mathsf T}X_i(t)\}} {\displaystyle\sum_{j\in\mathcal R_k(t)}\exp\{\beta^{\mathsf T}X_j(t)\}}, $$

where \(i\) is the subject with the event. The event-order-specific baseline cancels from this conditional comparison. This expression is a likelihood contribution, not a probability that the subject will ever experience the event.

Worked Example: Constructing the Second-Event Risk Set

Consider a hypothetical cohort followed from time zero. Subject A has events at times 2 and 5 and is observed through time 8; B has events at 3 and 7 and is observed through 8; C has an event at 4, no second event, and is censored at 6; D has no event and is censored at 5. Determine the risk set for a second event immediately before time 5.

For \(k=2\), eligibility requires a first event before time 5 and no second event before time 5, with continued observation at time 5. A meets these conditions: \(2<5\), and the second event occurs at 5. B also meets them: \(3<5<7\). C meets them because \(4<5\leq6\). D has not experienced a first event, so D is not eligible.

Therefore, \(\mathcal R_2(5)=\{A,B,C\}\), and A is the event subject. C is still included even though C is censored later, at time 6. D is excluded even though D remains under observation at time 5. The distinction is event-history eligibility, not simply whether a subject is being followed.

Worked calculations under the model

Worked Example: An Event-Time Partial-Likelihood Contribution

Use the same hypothetical histories at time 5. Suppose the treatment indicator is \(X=1\) for A and C, and \(X=0\) for B. Under the shared coefficient model, suppose for illustration that \(\beta=\log(2)\). Calculate the partial-likelihood contribution for A’s second event at time 5.

The relevant risk set is \(\{A,B,C\}\). Their relative weights are \(\exp(\beta X)\): A has \(\exp\{\log(2)\}=2\), B has \(\exp(0)=1\), and C has \(\exp\{\log(2)\}=2\). Since A experiences the event, the contribution is

$$ \frac{2}{2+1+2}=\frac{2}{5}=0.400. $$

This calculation illustrates how the model compares the event subject with eligible subjects at that time. The value 0.400 is not an estimated treatment effect, nor is it the probability that A will have a second event by time 5. It is one likelihood contribution at a particular coefficient value; estimating \(\beta\) requires combining contributions across event times.

Worked Example: Keeping the Total-Time Clock

A hypothetical subject experiences events at study times 2 and 5, then remains under observation until time 8. For the second-event model, identify the subject’s eligible interval and the time value used at the second event.

The subject becomes eligible for event 2 immediately after event 1, at time 2, and remains at risk until event 2 at time 5. In the total-time model, the event-2 observation is recorded at study time \(t=5\). It is not recoded as time \(5-2=3\). If an event-2 covariate value \(X(5)\) is used, it must be the value known just before time 5.

The risk interval is therefore from just after time 2 through time 5, located on the original study-time axis. The model uses the event-order-specific baseline \(\lambda_{02}(t)\) evaluated at \(t=5\). A model that instead uses 3 as the event time has reset the clock and is a gap-time specification, not the total-time specification.

Worked Example: Choosing a Shared or Event-Specific Effect

Suppose treatment is the only covariate. A scientist wants one treatment coefficient for first and later events, while allowing their baseline intensities to differ. Write the model and calculate the treatment-to-control intensity ratio at an eligible time.

The shared-effect specification is

$$ \lambda_{ik}(t\mid\mathcal H_i(t-)) = Y_{ik}(t)\lambda_{0k}(t)\exp(\beta X_i), \qquad k=1,2,\ldots. $$

If \(\beta=\log(1.5)\), then for two subjects in the same event-order risk set at the same time, one treated (\(X=1\)) and one control (\(X=0\)), the model-based intensity ratio is

$$ \frac{\lambda_{ik}(t\mid X_i=1)} {\lambda_{jk}(t\mid X_j=0)} = \frac{\lambda_{0k}(t)\exp\{\log(1.5)\}} {\lambda_{0k}(t)\exp(0)} =1.5. $$

This ratio follows from the chosen shared coefficient; the baseline cancels because both subjects are compared at the same time and event order. If the scientific question calls for treatment effects that differ by event order, a single shared \(\beta\) does not encode that question. The event-specific coefficient version would need to be specified and supported by adequate data.

Diagnostics, alternatives, and limitations

Before fitting the model, tabulate how many subjects reach each event order and how many events and censorings occur in each order. Sparse later-event risk sets can make estimates unstable or make an event-order effect impossible to estimate. Check that the recorded event sequence really represents ordered recurrences, and verify that time-dependent covariates are updated without using future information. After fitting, assess whether covariate effects appear proportional within event orders, using appropriate residual and time-interaction checks. Also examine whether censoring differs in ways that could be related to unobserved recurrence risk. These checks can reveal problems; they cannot prove the assumptions.

A frequent error is to include everyone under observation in every event-order risk set. That would put D in the second-event risk set in the first example, despite D never having a first event. The correction is to apply the event-history condition \(T_{i,k-1}<t\) before considering censoring or treatment values. A second error is to subtract the previous event time from each later event time while still calling the result total time. That changes the clock and hence the model.

The earlier material on the Andersen-Gill model uses a recurrent-event risk process that does not impose this same event-order entry condition. PWP total time is appropriate when the estimand is tied to the intensity of the next event among subjects who have reached the preceding event order. It may be inappropriate when the scientific target is a marginal population event rate or mean cumulative number of events; those targets call for different estimands and models. The PWP gap-time model also conditions eligibility on event order but resets the clock after each recurrence, so it represents a different time-scale choice. Neither model is universally preferable: the event history and the scientific meaning of time should determine the choice.

Key takeaway: A PWP total-time model combines two distinct choices: event-order-dependent eligibility and a clock measured from the original time origin. State both explicitly, along with whether regression effects are shared across event orders.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A subject has a first event at time 4, is censored at time 9, and has no second event. At what times is this subject eligible for the second-event risk set?
  2. At time 6, a subject has not yet had a first event but is still observed. Is the subject in the second-event risk set? Why?
  3. In a total-time model, a subject’s first and second events occur at times 3 and 8. What is the time value for the second event?
  4. What does a shared coefficient \(\beta\) with order-specific baselines allow to differ, and what does it constrain to be shared?

Solutions. (1) The subject enters just after time 4 and remains eligible through censoring at time 9, provided the second event has not occurred; in the indicator convention, \(4<t\leq9\). (2) No. Eligibility for event 2 requires a first event before time 6, so continued observation alone is insufficient. (3) The second event is at total time \(t=8\), not at gap time \(8-3=5\). (4) The baseline intensity may differ by event order through \(\lambda_{0k}(t)\), while the covariate coefficient vector \(\beta\) is common across orders.

Clinical Biostats