Why Internal Covariates Need Careful Timing
In transition regression, a covariate can change as a subject moves through states or experiences earlier events. The number of prior relapses, for example, is determined by that subject’s event history. Such a covariate is internal: its path is tied to the process being modeled. This differs from an external time-varying covariate, whose path is not generated by the subject’s event process.
The distinction matters when forming risk sets. A subject who makes a transition at time \(t\) contributes the covariate information available just before that transition, not a value created by the transition itself. Using a post-transition value can reverse the time ordering and introduce information that was not available to describe the subject’s risk at \(t\).
For example, the number of relapses before time \(t\) is internal. A laboratory measurement may also be internal if prior disease events affect the measurement. By contrast, a calendar-time exposure assigned independently of an individual’s event history is typically external. A variable’s label alone does not decide the distinction; the relevant question is whether its trajectory can be affected by the subject’s history in the modeled process.
Transition Model and Risk-Set Values
Consider a specified transition from state \(r\) to state \(s\). Let \(Y_i^r(t)\) indicate whether subject \(i\) is in state \(r\) and under observation just before \(t\). Let \(\lambda_i^{rs}(t\mid\mathcal F_i(t-))\) denote the instantaneous hazard of that transition, conditional on the subject’s observed history \(\mathcal F_i(t-)\) through just before \(t\). A transition-specific proportional-hazards model with an internal covariate is
Here \(\lambda_0^{rs}(t)\) is the baseline hazard for transition \(r\to s\), and \(\beta_{rs}\) is the transition-specific coefficient vector. The model says that, among subjects currently eligible for this transition and with their history represented by \(X_i(t-)\), the hazard is the baseline hazard multiplied by the exponential covariate term. A one-unit increase in a scalar covariate corresponds to a conditional hazard ratio of \(\exp(\beta_{rs})\), holding the other modeled covariates fixed.
The risk set for this transition at time \(t\) consists of subjects who are in state \(r\), under observation, and eligible to make the transition immediately before \(t\). In a transition-specific Cox analysis, each member’s covariate vector in that risk set is \(X_i(t-)\). The same subject can have different values at different event times because earlier events may have changed the subject’s history.
Worked Example: Interpreting a Prior-Relapse Covariate
Suppose a hypothetical model for transition from a stable state to hospitalization includes the number of prior relapses. The estimated coefficient is \(\hat\beta=0.35\) per prior relapse. Interpret this coefficient, assuming the specified proportional-hazards model is appropriate.
For two otherwise comparable people in the stable state at the same time, suppose one has one more prior relapse. The fitted hazard ratio for hospitalization is
Thus, conditional on being in the stable state at that time and on the other covariates in the model, the person with one additional prior relapse has an estimated transition hazard about 1.419 times as large, or about 41.9% higher. The comparison is conditional on the modeled history and risk set. It does not establish that an additional relapse causes a later hospitalization: prior relapses may reflect underlying severity or other factors not adequately controlled in the model.
Why the Partial-Likelihood Contribution Uses the Left Limit
The timing convention also follows from the conditional event probability used by the Cox partial likelihood. Suppose one subject makes transition \(r\to s\) at an untied event time \(t_j\), and consider only the subjects in the corresponding risk set. Over a short interval of length \(dt\), subject \(i\)’s transition probability is approximately its hazard multiplied by \(dt\). Conditional on one such transition occurring at \(t_j\), the probability that subject \(i\) is the one who transitions is therefore proportional to its hazard.
Under the model above, the baseline hazard is common to all members of this transition-specific risk set and cancels from the conditional probability. The covariate values used are those that were available immediately before the event:
Here \(\mathcal R_{rs}(t_j)\) denotes the risk set for transition \(r\to s\) immediately before \(t_j\). Multiplying these conditional probabilities across untied transition events gives the transition-specific partial likelihood. This justification relies on the model’s hazard form and the stated risk sets; tied event times require an appropriate tie-handling method rather than treating the events as a single untied event.
Worked Example: One Partial-Likelihood Contribution
Consider hypothetical subjects at risk for transition \(r\to s\) at time \(t=6\). Their numbers of prior relapses immediately before time 6 are 0, 1, and 2; the subject with one prior relapse makes the transition. Suppose the coefficient for prior relapses is \(\beta_{rs}=0.40\). Find this event’s partial-likelihood contribution.
The event subject’s covariate value is \(X(t-)=1\). The three risk-set values are \(0,1,2\), so the contribution is
This is one event’s contribution at the stated coefficient value, not an estimated coefficient or a complete model fit. The subject’s prior-relapse count is evaluated at \(6-\), and each other subject’s count is evaluated at the same pre-event instant. If a relapse were recorded at time 6 as part of a different transition, it could not be used to update the covariate for this event at that same instant without a clearly specified ordering of events.
Assumptions, Data Construction, and Diagnostics
An internal covariate does not by itself invalidate a Cox transition model. The key requirement for its use in the event-time risk set is that the value be determined from information available before the event: the covariate process must be predictable with respect to the observed history. The model also requires a correctly specified transition hazard structure, including the proportional-hazards form for the covariate effects being modeled. In addition, event times, state membership, and censoring must be observed and coded appropriately; censoring should not be informative about the transition process after conditioning on the history and variables used in the analysis.
These conditions need substantive and data checks. For every transition time, establish which state the subject occupied immediately beforehand and which covariate values had already been observed. In start-stop data, split a subject’s follow-up at each relevant event or covariate update so that each interval carries the correct pre-event value. Check that the covariate does not change before the event that is said to generate it, that event ordering is explicit when times coincide, and that subjects who have left state \(r\) are not retained in its risk set.
- Look for future information. If a recorded covariate value incorporates the event at the interval’s endpoint, the interval may be using a post-event value instead of \(X_i(t-)\).
- Check update timing. An event-history count should change only after the event that increments it. Confirm that data processing has not shifted the update to an earlier interval.
- Inspect observation patterns. If a biomarker is measured only at irregular visits, the last measurement before an event may not represent the underlying value at all times. Informative visit timing or missingness can complicate interpretation and model validity.
- Check the risk set. At each event, verify that every listed subject is eligible for the specific transition and that the covariate values correspond to the same pre-event time.
A valid conditional hazard model is not automatically a causal model. Internal covariates can be affected by prior events, disease severity, treatment, or unmeasured processes that also predict future transitions. Conditioning on a changing internal covariate therefore describes hazards conditional on the recorded history; it does not, by itself, identify the effect of intervening to change that covariate.
Worked Example: Avoiding a Post-Event Covariate Value
In hypothetical data, two people are in state \(r\) immediately before time 8. A covariate \(X\) records the number of prior infections. The person who makes transition \(r\to s\) has \(X(8-)=1\); the other person has \(X(8-)=2\). Suppose \(\beta_{rs}=0.20\). Calculate the event’s contribution using the correct values.
The partial-likelihood contribution is
Suppose the transition at time 8 is itself an infection, so the event subject’s recorded count becomes 2 immediately after that transition. Using 2 for that person in the contribution would use an outcome-time update as if it were already part of the prior history. The correct value for this risk comparison remains 1, the count immediately before time 8. The post-event count can be used for later risk times, once the subject is again eligible for the modeled transition and the state structure permits it.
How Internal-Covariate Models Differ From Alternatives
A baseline-covariate model uses a value fixed at the start of follow-up. It may be simpler to construct and interpret, but it cannot represent a covariate that changes with the subject’s event history. An external time-varying covariate can change over time too, but its trajectory is not generated by the subject’s event history. Internal-covariate models instead compare subjects at each transition time using their respective histories up to just before that time.
That distinction is useful for prediction conditional on observed history and for describing how transition hazards vary across histories. It is also a limitation: two people with the same current covariate value may have reached it through different histories, and a single covariate may not capture all history relevant to the transition. If important history is omitted, the fitted coefficient remains a model-based conditional association for the included covariates, but it may not summarize the full history dependence.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A covariate counts the number of a subject’s prior state transitions. Why is it internal, and which value belongs in the risk set at time \(t\)?
- For a scalar coefficient \(\beta_{rs}=0.50\), what is the conditional hazard ratio for a one-unit increase in the covariate? Interpret it.
- At an untied event time, the event subject has covariate value 0 and the only other risk-set member has value 1. If \(\beta_{rs}=0.20\), calculate the event contribution.
- Why does using a covariate value recorded after the transition risk biasing the event-time comparison, even if that value is available in the completed data set?
Solutions. (1) The covariate is internal because its value is determined by the subject’s own event history. Use the count immediately before \(t\), \(X_i(t-)\), not a count that includes an event at \(t\). (2) The hazard ratio is \(\exp(0.50)=1.649\). Conditional on the same transition risk set and other modeled covariates, a one-unit increase is associated with an estimated hazard about 1.649 times as large. This is not automatically a causal effect. (3) The event contribution is \(\exp(0)/\{\exp(0)+\exp(0.20)\}=1/(1+1.221403)=0.4502\). (4) A post-transition value can contain information created by the event whose hazard is being modeled. It violates the pre-event timing required for a risk-set covariate and can make the comparison depend on the outcome itself.