Tutorials › Competing Risks and Multi-State Models › Contrasting Covariate Effects Between Transitions

Regression for Multi-State Data · Tutorial 353 of 699

Contrasting Covariate Effects Between Transitions

Calculate and interpret a contrast between transition-specific covariate effects, including uncertainty when the coefficient estimates are correlated.

Advanced 11 min read

What You'll Learn

  • Define a contrast between two transition-specific regression coefficients.
  • Calculate the contrast variance using both coefficient variances and their covariance.
  • Interpret the exponential of a log-hazard contrast as a ratio of hazard ratios.
  • Construct and interpret a confidence interval for the contrast and its exponentiated form.
  • Diagnose errors caused by ignoring covariance or using incompatible coefficient estimates.
  • Distinguish a direct contrast from comparing two separate confidence intervals.

Why Compare Covariate Effects Across Transitions?

A covariate can be associated with different changes in hazard on different transitions. For example, a one-unit increase in a covariate might multiply the hazard of moving from state A to state B by one factor, and the hazard of moving from state A to state C by another. The natural question is not merely whether either transition-specific effect differs from zero, but how the two effects compare.

That comparison is a contrast of regression coefficients. Its uncertainty depends on how the coefficient estimates vary together. Because transition-specific estimates may come from overlapping participants or risk sets, their covariance can matter: ignoring it can either overstate or understate the uncertainty in the contrast.

Defining the Contrast

Suppose two transitions, labelled \(r\) and \(s\), have transition-specific proportional-hazards models for a covariate \(x\):

$$ \lambda_r(t\mid x)=\lambda_{0r}(t)\exp(\beta_r x), \qquad \lambda_s(t\mid x)=\lambda_{0s}(t)\exp(\beta_s x). $$

Here, \(\lambda_r\) and \(\lambda_s\) are the transition intensities, \(\lambda_{0r}\) and \(\lambda_{0s}\) are their baseline intensities, and \(\beta_r\) and \(\beta_s\) are the covariate coefficients. In each model, a one-unit increase in \(x\) multiplies the transition intensity by \(\exp(\beta)\), holding the model's other covariates fixed. This interpretation relies on the proportional-hazards specification for the covariate effect.

Definition: The log-hazard contrast comparing transition \(r\) with transition \(s\) is \(\Delta=\beta_r-\beta_s\). Its exponent, \(\exp(\Delta)=\exp(\beta_r)/\exp(\beta_s)\), is the ratio of the two transition-specific hazard ratios for a one-unit increase in the same covariate. A positive \(\Delta\) means the covariate's multiplicative hazard effect is larger on transition \(r\) than on transition \(s\); a negative \(\Delta\) means it is smaller.

This is a comparison of relative effects, not a comparison of the baseline transition intensities. For example, \(\exp(\Delta)=1.5\) says the hazard ratio for the covariate is 1.5 times as large on transition \(r\) as on transition \(s\). It does not say that the transition-\(r\) intensity itself is 1.5 times the transition-\(s\) intensity.

Standard Error: The Covariance Matters

Let \(\hat\beta_r\) and \(\hat\beta_s\) be estimates from a joint coefficient vector, or from an analysis that provides their estimated covariance. The estimated contrast is \(\hat\Delta=\hat\beta_r-\hat\beta_s\). The variance of a difference follows from the variance of a sum, including the covariance term:

$$ \widehat{\operatorname{Var}}(\hat\Delta) = \widehat{\operatorname{Var}}(\hat\beta_r) + \widehat{\operatorname{Var}}(\hat\beta_s) - 2\widehat{\operatorname{Cov}}(\hat\beta_r,\hat\beta_s), \qquad SE(\hat\Delta)= \sqrt{\widehat{\operatorname{Var}}(\hat\Delta)}. $$

The minus sign is essential. A positive covariance reduces the estimated variance of a difference, while a negative covariance increases it. The covariance may be zero in a particular analysis, but it should not be assumed to be zero merely because the coefficients refer to different transitions.

Justification: For any random variables \(U\) and \(V\), \(\operatorname{Var}(U-V)=\operatorname{Var}(U)+\operatorname{Var}(V)-2\operatorname{Cov}(U,V)\). Applying this identity to the two coefficient estimates gives the contrast variance above. In practice, the quantities on the right are taken from the estimated variance-covariance matrix of the coefficient estimates.

A large-sample Wald interval for \(\Delta\), using a 95% confidence level, is \(\hat\Delta\pm1.96SE(\hat\Delta)\). Exponentiating both endpoints gives an interval for \(\exp(\Delta)\), the ratio of hazard ratios. The coefficient-scale null value is zero; the corresponding ratio-scale null value is one.

Worked Example: A Positive Covariance Narrows the Contrast Uncertainty

Suppose a hypothetical fitted model gives \(\hat\beta_r=0.50\) and \(\hat\beta_s=0.20\) for a covariate measured in years. The estimated variances are 0.0400 and 0.0225, and their estimated covariance is 0.0120. Assume these are estimates from the same correctly specified analysis and that the large-sample Wald approximation is reasonable.

The estimated log-hazard contrast is

$$ \hat\Delta=0.50-0.20=0.30. $$

Its estimated variance and standard error are

$$ \widehat{\operatorname{Var}}(\hat\Delta) =0.0400+0.0225-2(0.0120) =0.0385, \qquad SE(\hat\Delta)=\sqrt{0.0385}\approx0.1962. $$

The ratio of hazard ratios is \(\exp(0.30)\approx1.350\). Thus, for each additional year of the covariate, the estimated hazard ratio is about 1.35 times as large on transition \(r\) as on transition \(s\).

A 95% interval on the log scale is

$$ 0.30\pm1.96\sqrt{0.0385} \approx[-0.0846,\,0.6846]. $$

Exponentiating the endpoints gives approximately \([0.919,\,1.983]\). This interval includes 1, so these data do not establish a difference between the two covariate effects at the two-sided 5% level. The point estimate suggests a larger effect on transition \(r\), but the interval is compatible with a smaller effect there as well.

Worked Calculation With a Narrower Interval

The covariance term can make a noticeable difference even when each coefficient has substantial uncertainty. The next example uses a positive covariance and shows the calculation without rounding the standard error before constructing the interval.

Worked Example: Constructing a Contrast Interval From the Covariance Matrix

In a hypothetical analysis, \(\hat\beta_r=0.70\) and \(\hat\beta_s=0.40\). The estimated variances are 0.0144 and 0.0121, and the estimated covariance is 0.00405. Both coefficients describe the effect of the same one-unit covariate increase on their respective transitions. Assume the estimates and covariance are on the same coefficient scale.

The contrast is \(\hat\Delta=0.70-0.40=0.30\). Its variance is

$$ 0.0144+0.0121-2(0.00405) =0.0265-0.00810 =0.0184. $$

Thus \(SE(\hat\Delta)=\sqrt{0.0184}\approx0.1356466\). The 95% interval is calculated using this unrounded standard error:

$$ 0.30\pm1.96\sqrt{0.0184} = 0.30\pm0.2658673 \approx[0.03413,\,0.56587]. $$

The estimated ratio of hazard ratios is \(\exp(0.30)\approx1.350\). Exponentiating the interval endpoints gives approximately \([1.035,\,1.761]\). Under the model and the large-sample interval approximation, the data support a larger covariate hazard ratio on transition \(r\) than on transition \(s\): the interval for the ratio lies above 1. This is evidence about a contrast, not a claim that either transition intensity is larger in absolute terms.

When Covariance Is Negative

A negative covariance has the opposite effect on a difference: subtracting twice a negative quantity increases its variance. The direction of the contrast also determines its interpretation, so transition order must be stated.

Worked Example: A Negative Covariance and a Reversed Contrast

Suppose a hypothetical analysis estimates \(\hat\beta_r=0.25\) and \(\hat\beta_s=0.45\), with estimated variances 0.0100 and 0.0225 and covariance \(-0.0060\). The covariance is admissible: its magnitude, 0.0060, is less than \(\sqrt{0.0100(0.0225)}=0.0150\). Assume the fitted models and covariance estimate are otherwise appropriate.

For the explicitly ordered contrast \(r-s\),

$$ \hat\Delta=0.25-0.45=-0.20, \qquad \widehat{\operatorname{Var}}(\hat\Delta) =0.0100+0.0225-2(-0.0060) =0.0445. $$

Therefore \(SE(\hat\Delta)=\sqrt{0.0445}\approx0.21095\). The ratio of hazard ratios is \(\exp(-0.20)\approx0.8187\), meaning the estimated hazard ratio is about 0.819 times as large on transition \(r\) as on transition \(s\). The 95% log-scale interval is

$$ -0.20\pm1.96\sqrt{0.0445} \approx[-0.6135,\,0.2135]. $$

On the ratio scale, this is approximately \([0.542,\,1.238]\). Because it includes 1, the estimate does not show a clear difference between the transition-specific effects at the 5% level. Reversing the contrast to \(s-r\) would change the sign of the log contrast, but it would not change the underlying conclusion.

Assumptions, Diagnostics, and Alternatives

A contrast calculation is meaningful only when the coefficients being compared represent comparable quantities. Check that both coefficients refer to the same covariate, the same unit increase, and compatible adjustment choices. The transition-specific models must also define the relevant populations and time scales appropriately. The proportional-hazards assumption is needed for a single coefficient to summarize a constant multiplicative covariate effect over time; if that assumption fails, a single contrast may conceal time variation.

For inference, the variance-covariance estimate must correspond to the coefficient estimates used in the contrast. When participants contribute information to multiple transitions, use an analysis that accounts for the dependence structure when estimating uncertainty. A covariance matrix from a joint fit, or an appropriate covariance estimator for the fitted procedure, is preferable to treating estimates as independent by default. The Wald interval additionally relies on the coefficient estimates being sufficiently close to a joint normal approximation.

Useful checks include confirming that the estimated contrast variance is nonnegative, checking that the covariance is plausible relative to the two variances, and verifying the order of subtraction against the written interpretation. A covariance matrix that is not positive semidefinite can produce an impossible negative contrast variance; this points to an estimation, extraction, or numerical problem rather than a reason to take the square root of an absolute value.

The main alternative is to inspect separate confidence intervals for the two coefficients. That can describe uncertainty in each effect separately, but it does not directly quantify uncertainty in their difference: overlap or non-overlap of separate intervals is not a valid substitute for the contrast interval. The earlier material on Testing Covariate Effect Heterogeneity Across Transitions addresses formal tests of equality; here the emphasis is on estimating the size and direction of the difference, with its standard error and interval. A direct contrast also makes the chosen ordering explicit.

Limits remain. A precise contrast does not establish causation, and a large ratio of hazard ratios does not necessarily imply a large difference in absolute transition probabilities. The contrast is conditional on the model, covariate definition, adjustment set, and transition-specific risk sets. If the scientific question concerns a different covariate change, multiply the coefficient contrast by that change before exponentiating.

Common Mistake

  • Wrong reasoning: “The estimates come from different transitions, so their covariance is zero. I can add the two variances and take the square root.”
  • Correction: Different transitions do not guarantee independent coefficient estimates. Use the estimated covariance in \(\operatorname{Var}(\hat\beta_r-\hat\beta_s)=\operatorname{Var}(\hat\beta_r)+\operatorname{Var}(\hat\beta_s)-2\operatorname{Cov}(\hat\beta_r,\hat\beta_s)\). Only omit the covariance when independence is justified or the estimated covariance is appropriately zero.
  • Another common error: Calling \(\exp(\hat\beta_r-\hat\beta_s)\) a ratio of transition intensities. It is a ratio of covariate hazard ratios; baseline intensities are not compared by this contrast.
Key takeaway: State the transition order, subtract the two coefficients, and calculate uncertainty with the covariance term. Interpret the exponentiated contrast as a ratio of transition-specific hazard ratios, not as a ratio of baseline hazards or absolute risks.

Check Your Understanding

Answer each question, then compare with the brief solutions.

  1. If \(\hat\beta_r=0.40\) and \(\hat\beta_s=0.10\), what is the estimated log-hazard contrast for \(r-s\), and what does its exponent represent?
  2. Suppose the two coefficient variances are 0.09 and 0.04, and their covariance is 0.03. Calculate the standard error of their difference.
  3. Why can comparing two separate coefficient confidence intervals fail to answer whether the transition effects differ?
  4. A contrast interval on the log scale is \([-0.10,\,0.50]\). Does the corresponding ratio-of-hazard-ratios interval include its null value? Interpret.

Solutions. (1) The contrast is \(0.40-0.10=0.30\), and \(\exp(0.30)\approx1.350\) is the estimated ratio of the hazard ratio on transition \(r\) to that on transition \(s\), for the same one-unit covariate increase. (2) The variance is \(0.09+0.04-2(0.03)=0.07\), so the standard error is \(\sqrt{0.07}\approx0.2646\). (3) Separate intervals do not directly include the covariance needed for the uncertainty of the difference; overlap is not a test or interval for the contrast. (4) Exponentiating gives \([\exp(-0.10),\exp(0.50)]\approx[0.905,1.649]\), which includes 1. The interval is compatible with either a smaller or a larger covariate hazard ratio on transition \(r\) relative to transition \(s\).

Clinical Biostats