I read the relevant questions here involving interactions in CoxPH (including 1, 2, 3, 4, 5, 6), and the relevant chapter of Applied Regression Analysis and Generalized Linear Models textbook. However, my confusion still persists about how to interpret interaction terms in CoxPH.

Particularly, my question is about 1) How to think about changing directions of hazard (good turning to bad) when interactions are present 2) How to interpret interaction coefficients involving two continuous predictor variables.

Let me demostrate it more concretely by providing two mock analyses below. The first case involves two variables age (continuous) and treat (dichotomous) variables; a simple model to examine how treatment and age affect survival. The results are below:

enter image description here

Please correct me if I'm wrong, but, I interpret the models as:

  • (Univariate) Without taking age into account, the treatment reduces risk by 19% (1-0.81).
  • (Univariate) Without taking treatment into account, each year passing (1 unit increase in age), the risk is increased by 16% (1.16-1).
  • (Additive) When age is held constant (at every age value in the dataframe), treatment reduces risk by 21% (1-0.79). This assumes that there is no interaction between terms (ie. parallel slopes in the age vs outcome regression line fitted onto treatment or no treatment data subsets -- similar to Fig 7.4 in the book I mentioned earlier ).
  • (Additive) , Each passing year, the risk is increased by 10% (1.10-1), in both treatment and no treatment groups. The lower hazard ratio for age in additive model may suggest, with treatment the negative effect of aging is diminished.
  • (Interaction) This is where it gets confusing for me: How to interpret a higher risk calculated for the treat variable here, while it was associated with lower risk previously? Does that mean, the treatment is actually bad for certain age groups? Also what to make of the HR value lower than 1 for the interaction term? I guess I'm looking for an intuitive explanation of the situation here.

The second case involves interaction between two continuous variables. Analysis from real world data gave me the following parameters:

enter image description here

Here, Gene1 seems to be "bad" (ie high risk), and Gene2 is good (ie low risk) although Gene2 is not significant. In the interaction model, all the regressors were found significant, and the interaction term provides the highest risk of all. Is the following a proper interpretation of this data?

  • (Additive) Each unit increase in Gene1 is associated with 23% increase in risk (holding Gene2 constant)
  • (Additive) Each unit increase in Gene2 is associated with 10% decrease in risk (holding Gene1 constant)
  • (Interaction) Again, it gets tricky here: A simultaneous 1 unit increase in both Gene1 and Gene2 leads to %37 increase in risk (?). Biologically this might mean that the increase in the "bad" gene expression overrides the increase in "good" gene expression, resulting in a higher risk (?).
  • (Interaction) How to think about the coefficients/HR values of Gene1 (17% increase in risk) and Gene2 (17% decrease in risk) in and of itself in the context of the said interaction.

I hope I'm not missing a crucial point here. Any insight is appreciated.

  • 1
    $\begingroup$ These issues in interpreting coefficients when there are interaction terms are general in regression models, they aren't specific to Cox models. As Frank Harrell's answer points out, when there's an interaction you can't think of most individual coefficients as having "good" or "bad" values with respect to outcome. You have to consider specific illustrative scenarios represented by contrasts, as the influence of one predictor depends on the levels of others. His rms package provides useful tools to do that for regression models. $\endgroup$
    – EdM
    Commented Sep 27, 2021 at 12:12
  • $\begingroup$ Thanks for the insights. Looks like this is the statistical version of "seeing is believing". I will definitely check the rms package and its features. $\endgroup$
    – Atakan
    Commented Sep 28, 2021 at 8:42

1 Answer 1


That is exceptionally well laid out. As I detail in RMS it is not so fruitful to emphasize individual coefficient interpretation except for the highest-order term. That is, the interaction term can be interpreted (especially when one of the interacting variables is binary) but lower order terms (often called "main effects" but this is a bit misleading) are heavily depending on centering and indicator variable coding. Think instead of contrasts, which are most easily calculated in terms of differences in predicted values (here, differences in log relative hazard, so that the anti-log of the contrast is a hazard ratio).

What I'm about to describe doesn't work as well if any of the effects is nonlinear. In that case the choice of intervals is arbitrary and can even be misleading if there is a flat or non-monotonic piece of one of the covariate effects. Supposing effects are linear (which has to be the case for binary predictors), suppose you want to estimate the effect of x1 where x1 interacts with x2. Pick a series of values of x2. For each x2 contrast the relative log hazard when x1 is set to a vs. when x1 is set to b. For binary x1, a=0, b=1. For continuous x1 you might let a=first quartile of x1, b=upper quartile of x1.

In the R rms package the contrast function (long name contrast.rms) makes contrasts over a series of x2 values very easy to do no matter how complex the model. When getting differences in predicted values one can easily compute the standard error of each difference, as contrast does.

As shown in the RMS course notes, for the continuous-continuous x1 x2 case it works well to graph a color image plot where the 'temperature' of the the color represents the log hazard or survival probability.

If you evaluate any of the contrasts manually you'll see that the x1 effect is a simple function of x2. And as you referenced, large negative interaction terms can lead to reversals of x1 effects as x2 changes.

Note that the univariable estimates you provided are not helpful.

  • $\begingroup$ Thank you very much for the insightful response. I will need to do go through the RMS lecture to wrap my mind around this answer completely. Can you comment on how to approach interactions if one or two of the main effects are statistically insignificant? That is, would it make sense to include var1*var2 interaction in the model if var1 and/or var2 is insignificant? This is a similar case to Gene2 in my example. I can think of biological reasons why interaction can make sense in the model, but I'm trying to understand if it makes sense statistically to do so. $\endgroup$
    – Atakan
    Commented Sep 28, 2021 at 8:50
  • $\begingroup$ Also another point I would appreciate insight on: (Following on your point about the main effect variable interpretations are tricky in interactions, but highest order term can be interpreted) Am I thinking correctly in my assessment for scenario-2 bullet point-3 (A simultaneous 1 unit increase in both Gene1 and Gene2 leads to %37 increase in risk ) $\endgroup$
    – Atakan
    Commented Sep 28, 2021 at 8:54
  • $\begingroup$ No to the 37%. You have to use the whole equation to get the correct answer (difference in whole predicted values). On the previous question, you thought it was meaningful to include an interaction so you have already peaked at the data in a supervised learning fashion. Removing an interaction just because it is "insignificant" (a nearly meaningless term) will distort the standard errors (bias them low) of the remaining variables. $\endgroup$ Commented Sep 28, 2021 at 11:38
  • $\begingroup$ If you want to use a coherent approach that respects the uncertainty of inclusion of interaction, use a Bayesian model with a skeptical prior on the interaction coefficient. And you interpret contrasts the same whether or not a piece is "insignificant". $\endgroup$ Commented Sep 28, 2021 at 11:38
  • 1
    $\begingroup$ hbiostat.org/bayes and the RMS course notes linked to above $\endgroup$ Commented Sep 28, 2021 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.