Tutorials › Competing Risks and Multi-State Models › Diagnosing Recurrent-Event Model Sensitivity to Time Scale

Software and Applied Examples · Tutorial 679 of 699

Diagnosing Recurrent-Event Model Sensitivity to Time Scale

You will compare total-time and gap-time recurrent-event fits, inspect the risk sets behind each, and assess whether differences in estimated effects are important.

Intermediate 12 min read

What You'll Learn

  • Define total-time and gap-time clocks for recurrent events.
  • Identify who is at risk for an event under each clock.
  • Separate the effect of a time-scale change from changes in model structure.
  • Interpret and compare covariate estimates from alternative fits.
  • Diagnose influential risk-set changes, sparse data, and unsupported comparisons.
  • Choose and report a time scale that matches the scientific question.

Why the Time Origin Matters

For recurrent events, a person can experience more than one event before follow-up ends. The time variable used in a model determines not only how event times are represented but also which people contribute to a given risk set. A model using time since study entry asks how event intensity changes over follow-up. A model using time since the previous event asks how it changes as the current event-free interval lengthens. Those clocks need not produce the same risk sets or covariate estimates.

A sensitivity analysis should therefore do more than fit two models and compare their p-values. It should check that the models represent the intended risk process, identify which event times have different comparison sets, and determine whether the changed estimates affect the substantive conclusion.

Definition: Total time (or clock-forward time) measures time from a common origin, such as study entry. Gap time (or clock-reset time) measures time elapsed since the preceding event. For a person with event times \(t_{i1}, t_{i2}, \ldots\), the \(k\)th gap is \(t_{ik}-t_{i,k-1}\), with the first interval measured from study entry.

Specify Comparable Models Before Comparing Clocks

A useful comparison holds the event-order structure, covariates, censoring rules, and study population fixed while changing the clock. For example, a Prentice-Williams-Peterson (PWP) model conditions on event order: a person becomes eligible for the \(k\)th event only after experiencing \(k-1\) events. Its risk set is also restricted to people still under observation and currently at risk for that event. The comparison can use the same PWP structure with a total-time clock in one fit and a gap-time clock in the other.

Write \(i\) for a person, \(k\) for event order, and \(X_i\) for a covariate. A proportional hazards model with a separate baseline hazard for each event order can be written schematically as:

$$ \lambda_{ik}(v \mid X_i) = \lambda_{0k}(v)\exp(\beta X_i), $$

Here \(v\) is the chosen clock: \(t\) for total time or elapsed time since the previous event for gap time. The \(k\) subscript allows the baseline hazard to differ by event order. A common \(\beta\) assumes the covariate has the same multiplicative effect across those orders; order-specific effects can instead be fit if the data support them.

The interpretation of \(\exp(\beta)\) is conditional on the model and clock: it is the hazard ratio for the \(k\)th event comparing people whose covariate values differ by one unit, at the same value of the chosen clock and within the specified risk set. It is not an absolute event probability.

Both fits require correctly recorded event times, a well-defined origin and event order, and censoring that is non-informative conditional on the modeled covariates and event history. The proportional-hazards interpretation requires the covariate hazard ratio to be constant over the selected clock unless time-varying effects are modeled. People are generally assumed independent of one another; a subject-level robust variance can accommodate dependence among repeated event contributions from the same person, but does not repair a wrongly defined risk set, informative censoring, or an unsuitable clock.

How the Risk Sets Change

In a PWP total-time fit, a person eligible for event order \(k\) enters that order's risk set after the \((k-1)\)th event, at the corresponding study time. In a PWP gap-time fit, that person's \(k\)th interval starts at gap time zero immediately after the \((k-1)\)th event. The two clocks can therefore compare people at different points in their event histories at the same modeled time.

This difference matters directly to the partial likelihood. At an event time, the event person's covariate contribution is compared with the covariates of people in that event's risk set. If the clock changes who is at risk, the denominator of that comparison changes too. Thus a changed coefficient can reflect a changed set of comparisons, not merely a different labeling of the horizontal axis.

The following small hypothetical history shows how that happens. Assume both people enter at study time zero. Person A has events at times 2 and 7 and is censored at 9. Person B has an event at time 5 and is censored at 9. There are no tied event times.

Worked Example: Finding the Second-Event Risk Set

At study time 7, A experiences a second event. Under a PWP total-time model, A is eligible because A has had one previous event. B is also eligible: B experienced a first event at time 5 and remains under observation at time 7. The second-event total-time risk set is therefore \(\{A,B\}\).

For the gap-time fit, A's second-event interval began at time 2. A's second event occurs \(7-2=5\) time units into that interval. B's second-event interval began at time 5, and B is censored at time 9, so B contributes only \(9-5=4\) time units to that gap. At gap time 5, B has not reached that point and is not in the gap-time risk set. That risk set contains A alone.

Suppose, just for this risk-set calculation, that A has covariate value \(X_A=1\) and B has \(X_B=0\). The total-time partial-likelihood contribution for A's event, ignoring other risk-set members, is:

$$ \frac{\exp(\beta X_A)}{\exp(\beta X_A)+\exp(\beta X_B)} = \frac{\exp(\beta)}{\exp(\beta)+1}. $$

In the gap-time risk set, A is the only person at risk at gap time 5, so the corresponding contribution is \(\exp(\beta)/\exp(\beta)=1\). That event provides no comparison between covariate values in this risk set. This example shows why a time-scale change can alter the information available about \(\beta\), even when the observed event history is unchanged.

A Practical Sensitivity Analysis

Begin with a stated scientific question. If the aim is to compare event intensity by time since enrollment, total time is a natural clock. If the aim concerns the length of the current event-free interval after a recurrence, gap time may be more relevant. Neither clock is automatically correct for every recurrent-event question.

Then fit models that are comparable in all other important respects. In particular, do not treat an Andersen-Gill total-time fit and a PWP gap-time fit as a pure clock comparison: those models also differ in their risk-set structure. The Andersen-Gill approach generally allows all observed recurrences to contribute to a common event process, whereas PWP conditions eligibility on prior event order. Such a comparison can be useful, but it cannot attribute a difference solely to the time scale.

1
Define the time origin.
State whether time starts at study entry or resets after each event, and state how the first event interval is defined.
2
Fix the event process.
Use the same event-order structure, covariates, censoring rules, and analysis population for both fits when isolating time-scale sensitivity.
3
Inspect who is at risk.
For each event order, compare the numbers and covariate distributions in representative risk sets, especially where the fitted coefficients differ.
4
Compare estimates and uncertainty.
Report effect estimates, confidence intervals, and the scale-specific interpretation. If formally testing the difference between estimates, account for their dependence because both fits use the same people.
5
Check model adequacy and relevance.
Look for sparse event-order risk sets, influential subjects, time-varying effects, and whether the chosen clock addresses the scientific question.

Worked Comparisons and Diagnostics

Worked Example: Comparing Hypothetical Covariate Estimates

Consider a hypothetical cohort of 180 people with a binary exposure. Two PWP models use the same event-order structure, covariates, follow-up, and censoring rules, but one uses total time and the other gap time. Suppose their software output is as follows; the standard errors are subject-level robust standard errors.

ClockEstimate \(\hat{\beta}\)Robust \(SE\)Hazard ratio
Total time0.550.201.73
Gap time0.100.181.11

For total time, the estimated hazard ratio is \(\exp(0.55)=1.73\). A 95% Wald confidence interval on the coefficient scale is \(0.55\pm1.96(0.20)=[0.158,0.942]\). Exponentiating the endpoints gives an approximate hazard-ratio interval of \([1.17,2.57]\). The Wald statistic is \(0.55/0.20=2.75\), corresponding to a two-sided p-value of about 0.006.

For gap time, the estimated hazard ratio is \(\exp(0.10)=1.11\). Its coefficient interval is \(0.10\pm1.96(0.18)=[-0.253,0.453]\), giving a hazard-ratio interval of approximately \([0.777,1.57]\). The Wald statistic is \(0.10/0.18=0.56\), with a two-sided p-value of about 0.58.

Under the total-time specification, the data provide evidence of a positive exposure association with the conditional event hazard at a 5% significance level. Under the gap-time specification, the interval includes a hazard ratio of 1, so the estimate is not statistically distinguishable from no association at that level. This contrast warrants investigation; it does not by itself establish that the coefficients differ statistically. The estimates are dependent, and a formal test of their difference needs to account for that dependence. The risk-set audit should identify whether particular event orders or people drive the contrast.

Worked Example: A Risk-Set Audit Reveals a Sparse Comparison

Suppose that, at a selected second-event total-time event, the risk set contains 12 people: 3 exposed and 9 unexposed. At the corresponding gap-time event, only 2 people have reached that gap duration while remaining under observation: 1 exposed and 1 unexposed. The event person is exposed.

The total-time event compares the exposed event person with 2 exposed and 9 unexposed people in the risk set, while the gap-time event compares that person with only 1 unexposed person. The gap-time comparison may be more sensitive to the outcome of this small risk set. If many second-event comparisons are similarly sparse, a gap-time coefficient may be unstable even when the total-time fit is not.

The appropriate diagnostic is to tabulate risk-set size and exposure distribution across event orders and times, then examine whether removing a single influential subject materially changes the estimate. A smaller risk set is not automatically a model failure: it can be the correct representation of the gap-time question. It does, however, limit the information available and should be reported as a limitation.

Worked Example: Choosing a Clock for the Question

A hypothetical clinic records repeated symptom flares after patients enter follow-up. The investigator asks whether a treatment is associated with the instantaneous rate of another flare as follow-up progresses from enrollment. A total-time clock directly indexes time since enrollment, so it aligns with that question. If instead the question is whether treatment is associated with how quickly a new flare occurs after the most recent flare, a gap-time clock aligns more directly.

The decision does not follow from which fitted p-value is smaller. It follows from the time origin that gives the effect its intended meaning, together with whether the corresponding risk sets and model assumptions are defensible. If both questions matter, report both analyses as distinct estimands and explain any sensitivity rather than selecting the more favorable result.

Interpretation, Alternatives, and Failure Modes

A useful report gives the clock, the event-order structure, the risk-set rule, and the covariate effect with uncertainty. It should also say whether the effect is common across event orders or allowed to vary. When total-time and gap-time estimates differ, inspect the event histories and risk sets before attributing the difference to biology or treatment effect.

ApproachWhat it emphasizesKey caution
PWP total timeTime since a common origin, conditional on prior event orderLater-event risk sets begin at different study times.
PWP gap timeElapsed time since the preceding event, conditional on prior event orderPeople with shorter observed gaps may leave the risk set before longer gap times.
Andersen-Gill total timeA common recurrent-event process over study timeIts risk-set structure differs from PWP, so it does not isolate the clock change.

Several checks help detect a problematic comparison:

  • Unexpected risk-set membership: verify event order, interval start and stop times, and censoring boundaries. A person must not contribute after censoring or before becoming eligible for the modeled event order.
  • Very sparse later-event sets: tabulate the number at risk and covariate distribution by event order. A coefficient driven by a few comparisons may be imprecise or unstable.
  • Time-varying effects: assess whether a single proportional-hazards coefficient is adequate on each clock. A constant effect on time since entry need not be constant on time since the last event.
  • Influential subjects or events: compare estimates under carefully justified influence diagnostics or subject-level resampling. Large changes indicate that the sensitivity may be driven by a small number of histories.
  • Misleading fit comparisons: partial likelihoods formed from different risk sets are not automatically comparable as measures of model fit. Do not choose a clock simply because its partial likelihood or p-value looks more favorable.

Robust variance estimation is useful when repeated event contributions from the same subject are dependent, but it changes uncertainty estimation, not the fitted risk sets or the meaning of the coefficient. Likewise, the clock comparison does not address all sources of heterogeneity across people; it is not a substitute for considering other model structures.

Common Mistake

Common mistake: “The total-time model is significant and the gap-time model is not, so the treatment effect must be different under the two clocks.” This does not follow. A difference in significance is not a test of the difference between estimates, and the models may compare different risk sets. First confirm that the structures are comparable, inspect the affected risk sets, and use an appropriate paired procedure if testing the coefficient difference is important.
Key takeaway: A recurrent-event time scale defines the time origin and helps determine who is compared with whom. Choose the clock to match the scientific question, hold other modeling choices fixed for a sensitivity analysis, and interpret differences through the risk sets as well as the estimates.

Check Your Understanding

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

  1. A person has events at study times 3 and 8. What is the gap time for the second event?
  2. In a PWP gap-time fit, a person has a first event at time 4 and is censored at time 10. How much second-event gap-time follow-up do they contribute?
  3. Why is comparing an Andersen-Gill total-time fit with a PWP gap-time fit not a pure sensitivity analysis of the clock?
  4. A total-time fit has \(HR=1.5\) with a 95% confidence interval \([1.1,2.0]\), while a gap-time fit has \(HR=1.2\) with interval \([0.9,1.6]\). Does this show that the two hazard ratios differ statistically?

Solutions. (1) The second gap is \(8-3=5\) time units. (2) The person contributes \(10-4=6\) time units to the second-event gap-time interval, assuming no earlier second event. (3) The models differ in event-order risk-set structure as well as clock, so differences cannot be attributed to time scale alone. (4) No. The intervals show different levels of evidence against a hazard ratio of 1, but they do not test whether the two dependent estimates differ; a paired comparison is needed for that claim.

Clinical Biostats