In regression models, usually a (descriptive) indicator of an interaction effect can be plotted via a plot with x-axis with the potential interaction variable (e.g., gender) and the outcome variable on the y-axis – if the outcome is continuous. Else, a 2×2 table should give a hint to interaction effects.

In Cox models, however, I'm a bit confused about whether I should check the time until event variable or the number of event variable itself to descriptively see whether an interaction effect occurs. I know the underlying formula specifies both, time until and number of events:

$$S(t|x)=\exp(−H(t|x))$$ with $H(t|x). $

But what is the "more important variable"? Consider e.g. a case where 100/100 male participants have an event, while only 75/100 female participants have an event. However, all of the male participants have the event later than the female participants. Would there be a significant difference and in which direction (assuming power is high enough)? When looking at the formula, it seems that it's time, but it's somehow confusing to understand.

So my questions would be:

  1. if I want to descriptively look at an interaction effect, should I plot the moderator (e.g., gender) and time until event, a 2×2 table with moderator and number of events, or both?
  2. What would be the result of a Cox regression with the example I gave above?

1 Answer 1


Question 1. The censoring typical of survival data makes reliance on any simple tabular summary unreliable. If you think that an interaction might be important, include it in your model. Test for "significance" of the interaction if you wish. Unless you are overfitting your data it's a good idea to keep interaction terms that might reasonably be expected, based on your understanding of the subject matter, to be outcome-related.

Showing full survival curves for different combinations of predictor values is a good way to display Cox-model results when there are interaction terms.

Question 2. The data in your example would not meet the proportional hazards assumption, unless there are other covariates involved. The earlier event times for most of the females would lead to a high female/male hazard ratio at early times, but the continued presence of some event-free females in the sample later, while all males ultimately have events, would lead to a low female/male hazard ratio at late times. Changes in hazard ratios with time mean that the proportional hazards assumption doesn't hold.

  • $\begingroup$ Dear EdM, thanks a lot for your clear answers! I tried to model different predictor combinations in the meanwhile, as you indicated. My main aim is to test a hypothesis of group differences. Unfortunately, I have no pre-specification of the covariates I should use and the p-value is highly affected by the specification of my covariates. So I would have another few questions: 1) how would you act in this case? compare the models with LLR (Collett suggests this if i understand right)? 2) what would you indicate overfitting? Only high SEs or sth. else? $\endgroup$
    – Sebastian
    Mar 19, 2023 at 8:00
  • $\begingroup$ And one more question regarding my previous Q2: the literature is rather confusing about how to specify the outcome of a cox regression. Most of them use the term "the time until the event was modelled via cox regression", however it's not only the time until event but rather the ratio of the events. I read a paper regarding the proper interpretation of HRs in cox regression (which some studies interpret as time until event which is not really true) but what exactly is it that the cox regression modells? Is it proper to say its time until event and event ratio? $\endgroup$
    – Sebastian
    Mar 19, 2023 at 8:06
  • $\begingroup$ @Sebastian Frank Harrell's Regression Modeling Strategies provides much guidance on specifying predictors and ways to test for and avoid overfitting, with chapters on Cox models. Cox regression models the log-hazard-ratios as functions of covariates, assuming those ratios are constant over time. The hazard is the risk of having an event at a particular time, given that you've already survived that long. You are correct that time itself isn't modeled; only the order of events in time enters the model. You can then extract time information after the model is fit. $\endgroup$
    – EdM
    Mar 19, 2023 at 14:19

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.