Tutorials › Competing Risks and Multi-State Models › Time-Varying Covariates in Censoring Models

Practical Handling of Censoring · Tutorial 547 of 699

Time-Varying Covariates in Censoring Models

Learn to construct censoring models from covariates known just before each time point, and recognize how timing errors undermine their interpretation.

Advanced 11 min read

What You'll Learn

  • Define a predictable covariate history for a censoring model.
  • Distinguish covariate information available before censoring from information recorded afterward.
  • Write continuous-time and discrete-time censoring models with time-varying covariates.
  • Interpret model coefficients in the appropriate hazard or odds scale.
  • Identify timing errors that can create bias or information leakage.
  • Check temporal alignment and model fit without confusing events with censoring.

Why Timing Matters in a Censoring Model

A censoring model describes how the chance of losing observation changes over follow-up. In many studies, that chance depends on a participant’s evolving condition: symptoms may worsen, treatment may change, or a participant may move to a different disease state. A model that uses only baseline measurements can miss this changing history. But using measurements recorded after censoring—or after the decision to censor—can be worse: it gives the model information that was not available when censoring occurred.

The central rule is temporal: at time \(t\), a censoring model may use information observed strictly before \(t\), not information first observed at or after \(t\). This requirement applies whether the model is fitted in continuous time or in discrete intervals. It is also necessary to distinguish censoring from an event: a competing event is an outcome, not a censoring time.

Definition: Let \(C_i\) be the censoring time for individual \(i\), and let \(H_i(t-)\) denote the observed covariate and event-history information available immediately before time \(t\). A time-varying covariate \(X_i(t-)\) is predictable for a censoring model at \(t\) if its value is known from information recorded before \(t\). A model using \(H_i(t-)\) therefore predicts censoring using the history available just before censoring could occur.

The minus sign in \(t-\) matters. A value recorded at exactly the censoring time is not automatically usable: the timestamp alone may not establish whether the measurement was available before the censoring decision. The data-generation and recording process must establish the order.

Modeling the Censoring Process With a History

For a first-event analysis, write \(T_i\) for the event time and \(C_i\) for the censoring time. The observed follow-up time is \(Y_i=\min(T_i,C_i)\), and \(\Delta_i=I(T_i\le C_i)\) indicates whether the event was observed. A censoring model concerns censoring among individuals still under observation and still at risk for the event. In a competing-risks analysis, an observed competing event is an event, not censoring; it ends the first-event risk period.

A common continuous-time specification is a proportional-hazards model for the censoring hazard:

$$ \lambda_{C,i}(t\mid H_i(t-)) = \lambda_{C,0}(t)\exp\{\beta^\mathsf{T}X_i(t-)\}. $$

Here \(\lambda_{C,0}(t)\) is the baseline censoring hazard, and \(X_i(t-)\) is a vector of covariates known just before \(t\). For a one-unit increase in a covariate, holding the other modeled covariates fixed, the censoring hazard is multiplied by \(\exp(\beta_j)\), under the model’s proportional-hazards assumption. This describes the censoring process; it does not, by itself, establish that censoring is independent of the event process.

When time is divided into intervals, a pooled logistic model can represent the conditional probability of censoring in interval \(k\), given that the individual remains under observation and at risk at its start:

$$ \operatorname{logit}\{P(C_{ik}=1\mid R_{ik}=1,H_i(t_k-))\} = \alpha_k+\beta^\mathsf{T}X_i(t_k-). $$

Here \(C_{ik}=1\) means censoring occurs during interval \(k\), \(R_{ik}=1\) means the individual is at risk for censoring at its start, and \(t_k\) is the interval start. The coefficient is a log odds ratio for censoring during that interval, conditional on being at risk—not a log hazard ratio. The interval definition and the rule for assigning measurements to intervals must be stated.

In a multi-state study, observed transitions can be part of the history. If participants remain under observation after a transition, their current state before \(t\) can be used as a time-varying predictor of censoring. If the analysis ends at a first event, by contrast, a participant who has an event leaves the event-free risk set; that event must not be recoded as censoring just to keep the person in a censoring-model data set.

Assumptions and a Timing Justification

A correctly timed model is not sufficient on its own. The model must also represent the censoring process adequately, and the conditional independent-censoring assumption must be plausible for the intended analysis. In practical terms, after conditioning on the observed history used by the model, censoring should not still depend on unobserved information about the person’s subsequent event process. This is a substantive assumption, not something guaranteed by including time-varying covariates.

The timing requirement follows from what a conditional prediction means. A probability for censoring at \(t\), conditional on history, must be based on information available at \(t-\). If a model conditions on a value first observed at \(t+\), it conditions on a future consequence of what happened at or after \(t\), rather than on the information available beforehand.

$$ P\{C_i\in[t,t+dt)\mid H_i(t-)\} \quad\text{is defined from information available before }t, $$

whereas replacing \(H_i(t-)\) by \(H_i(t+)\) changes the conditioning set. If \(H_i(t+)\) is influenced by impending illness, the censoring decision, or the censoring itself, that replacement can create reverse-time prediction or selection bias. It can make a model appear more predictive without providing a valid description of censoring risk at \(t\).

Worked Example: A Symptom Measurement Recorded After Withdrawal

Suppose a hypothetical study records symptom severity on a 0-to-10 scale at scheduled visits. A participant reports severity 3 at week 4, withdraws at week 6, and has severity 8 recorded in a phone call at week 7. The analysis models withdrawal during weeks 4 to 6.

The week-4 value is available before the interval begins, so it can be used as a predictor for withdrawal in weeks 4 to 6. The week-7 value is not available before the censoring time. Entering severity 8 as if it predicted withdrawal would use a post-withdrawal measurement.

The error is not repaired by calling the week-7 value “the last measurement.” It was the last value recorded, but not the last value available before withdrawal. A defensible analysis either uses the week-4 measurement for that interval or specifies a principled method for handling the unobserved value; it does not silently move a future measurement backward in time.

Worked Model Examples

Worked Example: A Discrete-Time Model With a Lagged Covariate

Consider a hypothetical study with 100 participants followed in weekly intervals. For the interval from week 5 to week 6, suppose the fitted pooled logistic model is \(\operatorname{logit}(p_{ik})=-3.00+0.60X_i(5-)\), where \(X_i(5-)\) is a binary indicator of worsening symptoms known at the start of week 5. Calculate and compare the modeled censoring probabilities for participants with and without worsening symptoms.

For a participant without worsening symptoms, \(X_i(5-)=0\), so the linear predictor is \(-3.00+0.60(0)=-3.00\). The probability is \(p=1/(1+\exp(3.00))=0.0474\), or about 4.74% during that week, conditional on being at risk at its start.

For a participant with worsening symptoms, \(X_i(5-)=1\), so the linear predictor is \(-3.00+0.60(1)=-2.40\). Thus \(p=1/(1+\exp(2.40))=0.0832\), or about 8.32% during that week. The fitted odds ratio is \(\exp(0.60)=1.82\). Under this model, worsening symptoms are associated with 1.82 times the odds of censoring in that interval, conditional on being at risk; this is not a causal effect and is not a hazard ratio.

The time assignment is coherent only if the symptom indicator was established by the start of week 5. A symptom value measured during week 5 or after withdrawal cannot be substituted without changing the model’s temporal meaning.

Worked Example: A Continuous-Time Censoring Hazard by Current State

Suppose a hypothetical multi-state follow-up model uses the current disease state just before time \(t\), with \(X_i(t-)=1\) for a higher-severity state and 0 otherwise. The censoring model is \(\lambda_{C,i}(t)=\lambda_{C,0}(t)\exp\{0.70X_i(t-)\}\). Interpret the coefficient and check what state value is used after a transition at week 8.

The hazard ratio comparing the higher-severity state with the reference state is \(\exp(0.70)=2.01\). At a given time, under the proportional-hazards model and conditional on the modeled history, the instantaneous censoring hazard is about 2.01 times as high in the higher-severity state.

If a transition to the higher-severity state is observed at week 8, then for times after week 8 the state indicator can be 1, assuming the transition was known and recorded by then. For the instant of transition, the model must follow the study’s event-ordering convention; the state after the transition must not be treated as known before it occurs. If follow-up continues after the transition, the participant remains in the censoring process with an updated history.

Worked Example: Quantifying the Effect of a Timing Error

In a hypothetical dataset, suppose 20 of 100 participants withdraw. Of those 20, 12 have a severe symptom value recorded after withdrawal, while 10 of the 80 participants who remain observed have a severe value recorded at their latest visit. A naive analysis labels the withdrawal group “severe” using the post-withdrawal value and the observed group using the latest pre-interval value.

The naive severe proportions are \(12/20=0.600\) among withdrawals and \(10/80=0.125\) among those remaining observed. Their odds ratio is \[ \frac{0.600/(1-0.600)}{0.125/(1-0.125)} = \frac{1.50}{0.1429} = 10.5. \] This large contrast is not a valid estimate of how pre-withdrawal severity relates to censoring: the exposure definition differs in time between groups, and the withdrawal group’s value was recorded afterward.

If instead the analysis uses only severity measured before the relevant risk interval for both groups, it compares like-timed information. The resulting association may be smaller or larger; the hypothetical counts do not provide those correctly aligned values. The key conclusion is that the naive odds ratio cannot be interpreted as the intended censoring association.

Diagnostics, Alternatives, and Limitations

Timing should be checked before interpreting coefficients or predictions. Useful checks include comparing measurement and censoring timestamps, verifying which visit supplies each interval’s covariate value, and auditing state-transition ordering. A data set with dates but no reliable ordering within a date may not support an assumption that a same-day measurement preceded censoring. Prespecified rules—such as using the most recent measurement strictly before each interval—make the construction reproducible.

After temporal alignment, assess whether the fitted model describes observed censoring patterns across follow-up and across ranges of the modeled history. Large differences between observed and fitted interval censoring frequencies, sparse history patterns, or unstable estimates can signal inadequate model form or data support. These checks do not prove conditional independent censoring. A model can fit observed censoring well and still omit a factor related to subsequent event risk.

ApproachWhat it usesMain caution
Baseline-only censoring modelCovariates measured before follow-upCannot represent changes during follow-up unless those changes are irrelevant to censoring.
Time-varying censoring modelCovariate history available before each time pointRequires accurate temporal alignment and an adequate model for changing censoring risk.
Model using “last observed” value without a time ruleValue most recently found in the dataMay use a post-censoring measurement or values measured at inconsistent times.

A time-varying model is not automatically superior to a baseline model: it is useful when the changing history is relevant and measured with enough temporal detail. Conversely, finer time resolution can expose data-quality problems, such as irregular visits, delayed entry of measurements, and ambiguous event ordering. If a covariate is only measured at widely spaced visits, its value between visits is not directly observed. Carrying the last value forward is a modeling convention, not a fact about the person’s true evolving state.

The model’s purpose here is to represent censoring conditional on observed history. Estimating censoring survival probabilities and using them to construct weights are separate steps. Neither those calculations nor later choices about which covariates to include can fix a predictor that was recorded after the censoring time.

Common Mistakes

  • Using a future measurement as a predictor. “It is the last value in the file” does not mean it was known before censoring. Use the latest value available before the time being modeled.
  • Treating the measurement date as sufficient proof of ordering. If a measurement and withdrawal share a date, verify which happened first or apply a clearly stated ordering rule.
  • Interpreting a logistic coefficient as a hazard ratio. In a discrete-time logistic model, exponentiated coefficients are conditional odds ratios for censoring in the interval.
  • Treating an observed event as censoring. A competing event is an outcome. Whether a transition ends follow-up depends on the analysis, not on the fact that it changes the person’s state.
  • Assuming time-varying adjustment guarantees independent censoring. The assumption still requires that relevant dependence on subsequent event risk is adequately captured by the observed history.
Key takeaway: A censoring model at time \(t\) must use a covariate history known just before \(t\). Correct temporal ordering gives the model a valid predictive interpretation, but conditional independent censoring and adequate model specification remain separate assumptions.

Check Your Understanding

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

  1. A participant has a symptom score measured at week 3 and withdraws during week 4. Which value can be used to predict withdrawal in week 4, and why?
  2. In a pooled logistic censoring model, a coefficient is 0.40 for a binary time-varying covariate. What is the corresponding odds ratio, and what does it compare?
  3. A participant changes state at time \(t\) and remains under observation afterward. Which state can be used to predict censoring just before \(t\), and which can be used after \(t\)?
  4. Why does a good fit to observed censoring frequencies not establish conditional independent censoring?

Solutions. (1) Use the week-3 score because it was measured before the week-4 censoring risk interval; a score recorded after withdrawal would be future information. (2) The odds ratio is \(\exp(0.40)=1.49\). It compares the conditional odds of censoring during the modeled interval for covariate value 1 versus 0, among individuals at risk at the interval start. (3) Just before \(t\), use the state known before the transition. After the transition has occurred and been observed, the updated state can enter the history for later times. (4) Fit assesses how well the model describes observed censoring, not whether unobserved information about subsequent event risk remains related to censoring after conditioning on the modeled history.

Clinical Biostats