I have a paper in revision, in which I present a cox regression model with a significant interaction. The reviewer requests simple slopes. I am familiar with simple slopes from regular linear regression models. But can they be applied to a cox model? I have googled and can not get any hits on the terms "cox" and "simple slopes", which leads me to think no. But at the same time, cox regression is "just" the application of a linear regression model on survival data, so it sounds like it should work. Then again, the plot of survival curves can function somewhat like a plot of the simple slopes. But I have multiple predictors in my model (14 predictors, and 2 interaction terms), and cannot create a survival curve plot while including all of them.

Further clarification of the model

The two interaction terms are 2-way. The moderator is the same in both interaction terms, it is the binary variable sex. The predictors are two different personality traits, which are continuous.

  • $\begingroup$ Are your two interaction terms both only 2-way? Is there some single predictor included in both interactions? Are the interacting predictors continuous or categorical? If categorical, how many categories? Please provide those details by editing the question, as comments are easy to overlook and can be deleted. There certainly are ways to illustrate interaction terms in Cox models graphically, but the best way to proceed can depend on the nature of the interactions. $\endgroup$
    – EdM
    Sep 23, 2022 at 13:48
  • $\begingroup$ Thanks for your comment. I have added info about the models $\endgroup$ Sep 23, 2022 at 14:07

1 Answer 1


This is a relatively simple situation. If each of the 2 continuous predictors was modeled linearly, each has 2 different slopes provided by the Cox model: one for the reference level of sex (its individual coefficient in the model) and one for the other level (the sum of its individual coefficient with its sex interaction coefficient). That gives you 2 "simple slopes," one for each sex, for each of those 2 continuous predictors.

As Cox models represent relative hazards, the choice of values for the 11 predictors not involved in interactions is arbitrary. It might be simplest to work with whatever baseline values the software assumes. (Different survival software packages can make different assumptions.)

Work with one of the 2 continuous predictors interacting with sex at a time. For a display most directly related to "simple slopes" in a linear model with interactions, use a predict()-type function to get linear-predictor estimates (with standard errors) over a useful range of its values, for both values of sex. Plot the linear predictor, the log-hazard relative to the baseline condition, as a function of the continuous-predictor value separately for each value of sex on the same graph. This will work even if you modeled the continuous predictor non-linearly (e.g., with a spline); you will get 2 curves instead of 2 straight lines.

Repeat in a separate graph for the second predictor interacting with sex. As those 2 continuous predictors aren't interacting with each other, those graphs provide all the "simple slopes" that you need.

Instead of working in the log-hazard scale with the linear-predictor estimates, you could get corresponding plots of hazard ratios with respect to the baseline condition, which might be more intuitive to your audience. Or you could choose to display separate survival probability estimates at a representative time point for each sex as a function of the values of a continuous predictor.

This can be implemented by providing sets of predictor values to the standard R predict.coxph() or survfit.coxph() functions. If you will be doing a lot of such modeling, the tools in the R rms package can make these types of displays easier to produce once you get over the initial learning curve.

  • $\begingroup$ Thanks for the detailed answer! I don't have the time to try it out right now, but I believe I should be able to follow your instructions later. So I have accepted it as the answer. $\endgroup$ Sep 26, 2022 at 8:23

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.