Tutorials › Competing Risks and Multi-State Models › Auditing a Transition-Regression Design Matrix

Regression for Multi-State Data · Tutorial 387 of 699

Auditing a Transition-Regression Design Matrix

Build and inspect a stacked design matrix so its fitted coefficients represent the intended transition-specific effects.

Advanced 11 min read

What You'll Learn

  • Identify the observations and transition indicators represented by a stacked design matrix.
  • Verify which transition and covariate level are reference categories.
  • Translate shared effects and interaction coefficients into transition-specific slopes.
  • Detect aliased columns, missing covariate variation, and unintended equality constraints.
  • Check fitted coefficient combinations and hazard ratios against the intended model.

Why Audit the Design Matrix?

A transition-regression model can be written compactly, but its fitted coefficients are determined by the columns supplied to the model. A transition indicator placed on the wrong interaction, a misidentified reference level, or a redundant column can change the meaning of a coefficient without changing the apparent form of the model. Auditing the design matrix means checking, row by row and column by column, that the numerical representation matches the scientific model.

The audit is an algebraic check, not a substitute for assessing the event-time model, the covariate measurements, or the data collection process. It is useful before fitting and again when interpreting fitted coefficients: first verify what the model encodes, then verify what the reported coefficient combinations imply for each transition.

Definition: Let \(E\) be the set of allowed transitions, with a transition denoted \(r\to s\). A stacked design matrix has rows indexed by subject-transition records (and, when the data are split over time, by subject-transition-time intervals). Its columns are covariates, transition indicators, and any specified interactions. A row’s linear predictor is the inner product of that row with the coefficient vector.

For example, a transition-specific hazard model may have the form

$$ \lambda_{i,rs}(t)=\lambda_{0,rs}(t)\exp\{\eta_{i,rs}(t)\}, \qquad \eta_{i,rs}(t)=\mathbf{x}_{i,rs}(t)^\mathsf{T}\boldsymbol{\beta}. $$

Here \(\lambda_{0,rs}(t)\) is the transition-specific baseline hazard and the design row \(\mathbf{x}_{i,rs}(t)\) determines the covariate part of the log hazard. A transition-stratified model can use a separate baseline hazard for each transition without putting a transition-intercept column into the design matrix. In a parametric model with transition-specific log-rate intercepts, transition indicators may instead encode those intercepts. The audit must match the chosen model, not assume that every model uses the same intercept structure.

A basic assumption for interpreting a row is that it represents a record genuinely at risk for its indicated transition at that time. The allowed transition must be correctly labelled, and covariates must be assigned according to the intended measurement timing and definition. Those assumptions concern the data and model specification; matrix algebra alone cannot confirm them.

Audit the Rows, Columns, and Reference Levels

Start by writing down the allowed transitions and the precise meaning of each row. In a stacked competing-destinations analysis, for instance, the same subject may contribute records for each eligible outgoing transition. An event on one transition does not make a row for another transition an observed event. The event indicator and risk-set construction must therefore be checked separately from the predictor columns.

Next, write the intended predictor in symbols before inspecting software-generated columns. For a binary covariate \(x_i\) and two transitions, suppose \(1\to2\) is the reference transition for the slope and \(1\to3\) has a transition-specific departure. Then

$$ \eta_{i,rs} = \beta_x x_i + \delta_{13}x_i I(rs=1\to3). $$

Substitution gives slope \(\beta_x\) for \(1\to2\), because its indicator is zero, and slope \(\beta_x+\delta_{13}\) for \(1\to3\), because its indicator is one. Thus \(\delta_{13}\) is the difference between the two transition-specific slopes, not the slope on transition \(1\to3\) by itself. If instead \(1\to3\) is intended as the reference, the interaction should be with \(I(rs=1\to2)\).

For categorical covariates, the reference level also matters. With levels A, B, and C and A as the reference, use indicators for B and C; do not include an indicator for A along with an intercept unless the parameterization has been deliberately changed. For each transition-specific interaction, state whether its indicator marks the reference transition or a departure from it. These explicit statements prevent the common ambiguity of saying “reference transition” while coding an interaction for that same transition.

1
Check row meaning.
Confirm each record’s subject, transition, risk interval, and covariate values match the intended risk set and measurement times.
2
Write the predictor.
Express the intended transition-specific effects as a formula, identifying reference transitions and covariate levels.
3
Inspect the columns.
For selected records, calculate every indicator and interaction by hand and compare those values with the stacked matrix.
4
Check estimability and interpretation.
Look for redundant columns or absent covariate variation, then reconstruct each transition’s slope from the fitted coefficients.

Worked Examples

Worked Example: Checking a Binary-Covariate Interaction

Suppose a hypothetical model has transitions \(1\to2\) and \(1\to3\), with \(1\to2\) as the reference transition for the slope of binary \(x\). The intended predictor is \(\eta_{i,rs}=\beta_xx_i+\delta_{13}x_iI(rs=1\to3)\). Four hypothetical rows have the following transition and covariate combinations:

Transition\(x_i\)\(x_i\)\(x_iI(rs=1\to3)\)
\(1\to2\)000
\(1\to2\)110
\(1\to3\)000
\(1\to3\)111

The final two columns are the design columns for \(\beta_x\) and \(\delta_{13}\). Suppose fitting gives \(\hat{\beta}_x=0.25\) and \(\hat{\delta}_{13}=-0.40\). On \(1\to2\), the slope is \(0.25\). On \(1\to3\), it is \(0.25-0.40=-0.15\). The corresponding hazard ratios per one-unit increase in \(x\) are \(\exp(0.25)=1.284\) for \(1\to2\) and \(\exp(-0.15)=0.8607\) for \(1\to3\). These are transition-specific hazard ratios under the stated model, not overall risks.

The arithmetic confirms the reference coding: the interaction column is zero on \(1\to2\) and adds the slope difference only on \(1\to3\). If a software output or written interpretation called \(\beta_x+\delta_{13}\) the \(1\to2\) slope, it would contradict the matrix.

Worked Example: Auditing Factor Levels and Transition Effects

Consider a hypothetical parametric log-rate model with transitions \(1\to2\) and \(1\to3\), and a three-level covariate with levels A, B, and C. A is the covariate reference level. The model uses separate transition log-rate intercepts and allows B and C to have departures on \(1\to3\). Its columns are \(D_{12},D_{13},B,C,D_{13}B,D_{13}C\), where, for example, \(D_{13}B=1\) only for a level-B record on transition \(1\to3\).

Transition, level\(D_{12}\)\(D_{13}\)BC\(D_{13}B\)\(D_{13}C\)
\(1\to2\), A100000
\(1\to2\), B101000
\(1\to2\), C100100
\(1\to3\), A010000
\(1\to3\), B011010
\(1\to3\), C010101

The predictor is \(\gamma_{12}D_{12}+\gamma_{13}D_{13}+\beta_BB+\beta_CC+\delta_BD_{13}B+\delta_CD_{13}C\). Suppose the fitted values are \(\hat{\gamma}_{12}=-2.00\), \(\hat{\gamma}_{13}=-1.50\), \(\hat{\beta}_B=0.40\), \(\hat{\beta}_C=-0.20\), \(\hat{\delta}_B=0.30\), and \(\hat{\delta}_C=0.50\). For a B record on \(1\to2\), the row product is \(-2.00+0.40=-1.60\); for B on \(1\to3\), it is \(-1.50+0.40+0.30=-0.80\).

Relative to A, the B log-rate contrast is \(0.40\) on \(1\to2\) and \(0.40+0.30=0.70\) on \(1\to3\). Their rate ratios are \(\exp(0.40)=1.492\) and \(\exp(0.70)=2.014\), respectively. The interaction coefficient \(0.30\) is the difference between those log-rate contrasts. It is not the entire B-versus-A contrast on \(1\to3\). The same check for C gives contrasts \(-0.20\) and \(-0.20+0.50=0.30\).

Worked Example: Finding a Redundant Transition Coding

Suppose a hypothetical model for two transitions uses a common intercept plus indicators for both transitions. The rows of the intercept-and-indicator matrix are

$$ X= \begin{pmatrix} 1&1&0\\ 1&0&1 \end{pmatrix}, $$

where the columns are the intercept, \(D_{12}\), and \(D_{13}\). The first column equals the sum of the second and third columns: \((1,1)^\mathsf{T}=(1,0)^\mathsf{T}+(0,1)^\mathsf{T}\). Therefore the three columns are linearly dependent, and the coefficient vector is not uniquely determined by these rows. For example, adding a constant \(c\) to the intercept and subtracting \(c\) from each transition-indicator coefficient leaves both row predictors unchanged.

One repair is to remove the common intercept and retain both transition indicators, which directly gives two transition intercepts. Another is to retain the intercept and only one transition indicator, making the other transition the reference. Which repair is appropriate depends on the intended parameterization. In a transition-stratified Cox model with separate baseline hazards, transition indicators for baseline intercepts are generally not needed in the covariate predictor.

Justification: Why the Coefficient Mapping Works

The mapping from coefficients to transition slopes follows by evaluating the predictor for each transition. For two transitions, let \(D_{13}=I(rs=1\to3)\) and write \(\eta=\beta_xx+\delta_{13}xD_{13}\). The coefficient of \(x\), after collecting terms, is

$$ \eta=x(\beta_x+\delta_{13}D_{13}). $$

Since \(D_{13}=0\) on \(1\to2\), its slope is \(\beta_x+\delta_{13}(0)=\beta_x\). Since \(D_{13}=1\) on \(1\to3\), its slope is \(\beta_x+\delta_{13}(1)=\beta_x+\delta_{13}\). This substitution is the simplest reliable check of reference-level claims. More generally, a design column’s coefficient contributes to a row’s predictor only when that row’s entry in the column is nonzero; summing the active contributions gives the effect for that row.

Identifiability has a related linear-algebra condition. If two coefficient vectors produce the same linear predictor for every observed row, their difference \(\mathbf{v}\) satisfies \(X\mathbf{v}=\mathbf{0}\). If a nonzero such \(\mathbf{v}\) exists, the design matrix lacks full column rank, and those coefficients cannot be separately identified from the data represented in \(X\). Full rank is necessary for unique coefficient estimation in an ordinary full-rank parameterization, but it does not guarantee adequate event information or a well-specified hazard model.

Diagnostics, Alternatives, and Limitations

Several checks can reveal a design that is not doing what its author intended:

  • Reconstruct rows by hand. Select records covering every transition, covariate level, and interaction case. Calculate the expected zeros and ones and compare them with the actual matrix.
  • Check reference coding explicitly. State both the covariate reference level and the transition at which a shared slope applies. Reconstruct the slope on every transition as a coefficient sum.
  • Inspect rank and aliases. Redundant indicator columns can make separate coefficients non-estimable. A model-fitting warning, dropped column, or unstable coefficient may signal the issue, but the underlying column relationship should be identified directly.
  • Check support within transition. A column may be nonredundant overall yet lack useful variation for a particular transition. If no records or events support a covariate level for a transition, its transition-specific effect may be poorly estimated or not estimable.
  • Check the interaction meaning. A shared slope plus an interaction represents a slope difference. If the intended model instead gives each transition its own unconstrained slope, verify that the parameterization permits that without accidental equality constraints.

Different parameterizations can represent the same fitted predictors. Separate transition regressions make each transition’s coefficients explicit, while a stacked model with shared terms and interactions can express equality constraints or structured differences across transitions. Neither is automatically preferable: the design should reflect the scientific question and the intended constraints. A shared-slope model is more parsimonious but assumes the slope is common; transition-specific slopes are more flexible but require information for each transition. A reference-coded interaction is a convenient way to express differences, not evidence that the reference transition is scientifically special.

ApproachWhat the design encodesAudit question
Shared covariate slopeOne common coefficient across transitionsIs equality of slopes intended?
Shared slope plus interactionsA reference slope and transition-specific differencesDoes each interaction mark the transition stated in the interpretation?
Separate transition modelsDistinct coefficients fit transition by transitionAre estimates being compared using the intended contrast?

A correct design matrix cannot fix an incorrect risk set, poorly timed covariates, sparse events, or a misspecified hazard structure. Nor does a coefficient audit establish that an estimated association is causal. The design audit answers the narrower but essential question: given the observed rows and the fitted model, do the columns encode the effects that the analysis claims to estimate?

Common pitfall: Calling a transition the slope reference when the interaction indicator is one for that transition. The incorrect reasoning is that the interaction coefficient itself is that transition’s slope. The correction is to substitute the indicator value into the predictor: indicator zero leaves the shared coefficient alone, and indicator one adds the interaction. Always derive the transition-specific slope from the formula rather than infer it from a label.

Check Your Understanding

Answer each question, then compare with the worked solutions.

  1. For \(\eta=\beta x+\delta xI(rs=1\to3)\), which transition is the slope reference, and what is the slope on each transition?
  2. Suppose a three-level factor has A as its reference, and B has coefficient \(\beta_B=0.25\) plus an interaction \(\delta_B=-0.10\) for transition \(1\to3\). What are the B-versus-A log-hazard contrasts on transitions \(1\to2\) and \(1\to3\)?
  3. With two transition indicators and a common intercept, explain why the intercept and both indicators cannot all be separately estimated when every row belongs to exactly one of the two transitions.
  4. A covariate is constant at zero among all observed records for transition \(1\to3\). Can the data identify a transition-\(1\to3\)-specific slope for that covariate? Explain.

Solutions. 1. The indicator is zero on \(1\to2\), so \(1\to2\) is the reference and its slope is \(\beta\). The indicator is one on \(1\to3\), so that slope is \(\beta+\delta\). 2. The \(1\to2\) contrast is \(0.25\). The \(1\to3\) contrast is \(0.25-0.10=0.15\); the interaction is the difference from the reference-transition contrast. 3. For every row, the intercept column equals the sum of the two transition-indicator columns. Thus the columns are linearly dependent, so different coefficient vectors give the same fitted linear predictors; remove the common intercept or one indicator according to the intended parameterization. 4. No. With no covariate variation for that transition, the data contain no information about how its hazard changes with that covariate. The slope is not identified from those records, regardless of whether the interaction column is present.

Clinical Biostats