Tutorials › Competing Risks and Multi-State Models › Handling Delayed Entry in Competing-Risk Cox Fits

Software and Applied Examples · Tutorial 683 of 699

Handling Delayed Entry in Competing-Risk Cox Fits

You will learn to build and check start-stop data for left-truncated competing-risk Cox fits, and understand the bias that can arise when entry times are ignored.

Intermediate 11 min read

What You'll Learn

  • Define delayed-entry risk sets using the open-left, closed-right start-stop convention.
  • Encode competing events and right-censoring correctly for a cause-specific Cox model.
  • Split follow-up into multiple rows when covariates change, without confusing row ends with follow-up ends.
  • Verify risk-set membership at event times before fitting the model.
  • Compare a delayed-entry fit with an incorrectly origin-only fit.
  • Recognize assumptions and data checks that matter for valid estimates.

Why Entry Time Belongs in the Risk Set

In a delayed-entry study, people begin to be observed at different times after a shared time origin. A person who enters at time 4 cannot contribute to the risk set at time 2: they were not under observation then, and their presence in the study may itself depend on remaining event-free until entry. Treating everyone as at risk from the origin can therefore change the Cox partial likelihood, not merely the presentation of the data.

For a cause-specific Cox fit, this issue is handled by giving each observed interval a start and stop time. The model then uses only people who have entered observation and have not yet had any event or censoring at each event time. If covariates change during follow-up, a person can contribute multiple consecutive rows. Follow-up ends at the first event of any cause or at censoring; row boundaries may also mark covariate changes or other interval boundaries.

Definition: Let \(L_i\) be person \(i\)'s delayed-entry time and \(T_i\) their time of first event or censoring, measured from the shared origin. With the usual counting-process convention, person \(i\) is in the risk set at time \(t\) exactly when \(L_i < t \leq T_i\). In start-stop data, a row covering \((a,b]\) contributes at \(t\) when \(a < t \leq b\). Thus the interval's left endpoint is excluded and its right endpoint is included.

The strict inequality at the start means a person entering exactly at an event time is not counted as at risk for that event under this convention. In practice, entry generally precedes events. If recorded times can coincide and the ordering is clinically meaningful, define and document a suitable time-resolution or ordering rule rather than silently changing the risk set.

Cause-Specific Cox Model With Start-Stop Data

For cause \(k\), define the cause-specific hazard among people who are still event-free and under observation at time \(t\). A Cox model with covariate vector \(X_i(t)\) specifies

$$ \lambda_k(t\mid X_i(t))=\lambda_{k0}(t)\exp\{\beta_k^\mathsf{T}X_i(t)\}. $$

Here \(\lambda_{k0}(t)\) is an unspecified baseline hazard and \(\beta_k\) is the cause-specific regression coefficient. To fit this model, code an event of cause \(k\) as 1 and code a competing event or right-censoring as 0 for that cause-specific event indicator. A competing event ends follow-up and removes the person from later risk sets, even though its indicator for cause \(k\) is zero.

Assumptions and data conditions: The cause-specific Cox interpretation requires correctly recorded event causes, times, entry, and censoring; a suitable proportional-hazards model for the specified covariates; and censoring and delayed entry that are independent of the event process conditional on the modeled information (or otherwise appropriately accounted for by the study design). The model also needs informative covariate variation within risk sets to estimate effects. A fitted cause-specific hazard describes the instantaneous rate of cause \(k\) among those still event-free; it is not by itself a cumulative incidence probability.

With start-stop notation, the partial-likelihood contribution at a distinct cause-\(k\) event time \(t_j\), for the person \(i(j)\) who has that event, is

$$ \frac{\exp\{\beta_k^\mathsf{T}X_{i(j)}(t_j)\}} {\displaystyle\sum_{r:\,L_r<t_j\leq T_r} \exp\{\beta_k^\mathsf{T}X_r(t_j)\}}. $$

The denominator contains the people in the delayed-entry risk set, not everyone who will eventually appear in the data. When covariates vary over time, their values at \(t_j\) are the values used in the event contribution. Tied event times require the chosen tie-handling method, such as Efron's approximation; that choice does not repair an incorrectly specified risk set.

Building and Auditing the Data

In R, a typical fit uses the counting-process form of Surv, with one row per interval and a cause-specific event indicator:

$$ \texttt{coxph(Surv(start, stop, event\_k) \textasciitilde\ x, data = dat)} $$

In actual R code, the formula is written as coxph(Surv(start, stop, event_k) ~ x, data = dat). The formula above represents start-stop data: an interval contributes from just after start through stop, inclusive. Rows for a person should normally be ordered, non-overlapping, and contiguous over observed follow-up unless a genuine gap in observation is intended. Only the final row ends in an event or censoring; if that terminal event is cause \(k\), its event_k value is 1. A competing event has event_k equal to 0 but still ends that person’s observed follow-up.

Before fitting, check that every start is earlier than its stop, that entry precedes the terminal time, that only the correct terminal row has an event indicator of 1, and that each cause-specific event agrees with the recorded event type. For time-varying covariates, confirm that the value on each row applies throughout that interval. Most importantly, inspect the risk set at selected event times by checking \(start < t \leq stop\). A fit can run without errors even when start times have been accidentally set to zero.

Worked Example: Checking Who Is at Risk

Suppose a hypothetical cohort has the following observed intervals. Times are measured in years from a common origin; “cause 1” and “cause 2” are competing first events.

PersonStartStopOutcome at stop
A03Cause 1
B14Cause 2
C25Censored

At the cause-1 event time \(t=3\), include a person when \(start < 3 \leq stop\). A qualifies because \(0 < 3 \leq 3\); B qualifies because \(1 < 3 \leq 4\); and C qualifies because \(2 < 3 \leq 5\). Thus the cause-1 event contribution has all three people in its risk-set denominator. At time 4, B is still included at its competing event time, since \(1 < 4 \leq 4\), but it leaves immediately afterward. C remains at risk at time 4; A does not, since its follow-up ended at 3.

If the analyst incorrectly resets every start time to zero, this particular event time happens to retain the same three people. That coincidence does not validate the reset: a person whose true entry was after time 3 would then be incorrectly included at this event. Risk-set checks must use the actual entry times.

Worked Example: Splitting a Record for a Covariate Change

A hypothetical patient enters observation at year 2, has a treatment indicator of 0 until year 4, then a value of 1 until a cause-2 event at year 6. The patient has no event at year 4; it is only a covariate-change boundary. For a cause-1 fit, the rows can be encoded as follows.

StartStopTreatmentCause-1 indicator
2400
4610

The first row covers \((2,4]\), and the second covers \((4,6]\). At a cause-1 event time of 3, this person is represented by the first row because \(2 < 3 \leq 4\), with treatment 0. At time 5, the second row applies because \(4 < 5 \leq 6\), with treatment 1. At the competing cause-2 event at time 6, the cause-1 indicator is 0, but follow-up still ends at 6. Coding the first row as an event, or leaving the person at risk after time 6, would be incorrect.

This example distinguishes the end of a row from the end of follow-up: the row ends at 4 because the covariate changes, while the person’s follow-up ends at 6 because a competing event occurs.

What Goes Wrong When Entry Is Ignored

An origin-only analysis sets every start time to zero while retaining the observed stop times. Its risk set at \(t\) then includes anyone whose stop time is at least \(t\), including people who had not yet entered observation. Those extra people alter the denominators of the partial likelihood, and may alter the estimated coefficient and its standard error. The direction and size of the difference are not generally predictable: they depend on entry patterns, covariates, and event times.

The risk-set logic gives a direct justification for using actual entry times. At an event time \(t\), the partial likelihood compares the covariate of the person who experienced cause \(k\) with covariates of people who could have experienced that event at that time. A person not yet observed is not a valid comparison. Replacing \(L_r < t\) with \(0 < t\) changes that comparison set and therefore changes the likelihood being maximized.

Worked Example: Comparing Correct and Origin-Only Fits

Consider a hypothetical synthetic data file of 120 people, all measured on a binary exposure, with staggered entry and follow-up to cause 1, cause 2, or censoring. For illustration, suppose the correctly specified cause-1 start-stop fit gives \(\hat\beta_1=0.405\) with \(SE=0.220\), while the same data analyzed after incorrectly replacing all starts by zero gives \(\hat\beta_1=0.182\) with \(SE=0.190\). These are stipulated hypothetical software results, not universal effects of delayed entry.

For the delayed-entry model, the estimated hazard ratio is \(\exp(0.405)=1.50\). A Wald 95% confidence interval on the coefficient scale is \(0.405 \pm 1.96(0.220)\), or \(0.405 \pm 0.431\), giving \((-0.026,0.836)\). Exponentiating the endpoints gives a hazard-ratio interval of approximately \((0.974,2.31)\). The interval includes 1, so these hypothetical data do not provide strong evidence against a null cause-specific hazard ratio of 1 at the two-sided 5% level. This does not establish that the hazards are equal.

For the incorrect origin-only fit, \(\exp(0.182)=1.20\). Its point estimate differs from 1.50 because it uses different risk sets; it does not estimate the same partial likelihood. The example does not imply that ignoring entry always moves the estimate toward 1. The appropriate response is to verify entry times and risk-set membership, rather than select whichever fit gives a preferred result.

Diagnostics, Alternatives, and Limits

Useful checks include tabulating numbers at risk at selected event times, separately checking each cause’s event indicator, and confirming that terminal competing events remove people from later follow-up. Plotting or summarizing entry times against covariates can reveal whether the observed cohort has strong selection into later entry. The assumptions about delayed entry are substantive: if entry depends on unobserved event risk even after conditioning on modeled information, ordinary left-truncated Cox fitting may not remove that selection.

The main alternatives answer different questions or rely on different data structures. A cause-specific Cox model with correct start-stop risk sets models the cause-specific hazard. Cumulative-incidence estimation, such as the Aalen-Johansen approach, targets absolute event probabilities rather than a regression coefficient for this hazard. A Fine-Gray model uses a different risk-set construction and targets a subdistribution hazard; it is not a substitute for entering the correct delayed-entry times in a cause-specific Cox fit. If time origin is reset at entry, the scientific time scale changes; that is appropriate only when time since entry is the intended scale, not as a workaround for delayed entry on a common time scale.

These methods also have limits. A cause-specific hazard ratio is conditional on being event-free at each time and does not alone determine the cumulative incidence, which depends on the hazards of all causes. Sparse events, little covariate overlap in risk sets, incorrect proportional-hazards assumptions, and informative entry or censoring can all undermine interpretation. A successful software fit is not evidence that these conditions hold.

Common mistake: “Everyone has an observed event or censoring time, so I can use that time as the stop and set all starts to zero.” The stop time alone does not encode delayed entry. The correction is to use the actual entry time as the start, verify membership with \(start < t \leq stop\), and ensure that competing events end follow-up even when their cause-specific indicator is zero.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. A person has an interval \((2,5]\). Are they in the risk set at time 2, at time 3, and at time 5?
  2. For a cause-1 Cox fit, how should a cause-2 event be coded, and what happens to that person after the event time?
  3. A patient’s covariate changes at time 4, with no event then, and a competing event occurs at time 6. How many rows are needed, and when does follow-up end?
  4. Why can setting all delayed-entry times to zero change a Cox estimate even if every stop time is correct?

Solutions. (1) No at time 2, because the interval excludes its left endpoint; yes at 3 and 5, because both satisfy \(2 < t \leq 5\). (2) Code the cause-1 indicator as 0 at the cause-2 event, and end follow-up at that event so the person is absent from later risk sets. (3) Two rows, split at 4 to represent the covariate change; follow-up ends at 6, the competing event time. (4) The reset includes people in risk sets before they actually entered observation, changing the partial-likelihood denominators and potentially the estimate.

Clinical Biostats