6

I am running mixed effect Cox models (I have 1 random effect factor) using the coxme function {coxme} in R, and I would like to check the assumption of proportional hazard.

I know that the proportional hazards (PH) assumption can be verified with the cox.zph function {survival} on cox.ph model.

However, I cannot find the equivalent for coxme models.

In 2015 a similar question has been posted here, but had no answer.

My questions are:

  1. How to test PH assumption on mixed effect cox model coxme?
  2. If there is no equivalent of the cox.zph for coxme models, is it valid for publication in scientific article to run mixed effect coxme model but test the PH assumption on a cox.ph model identical to the coxme model but without random effect?
EmMo
  • 61
  • 3

4 Answers4

3

Apologies for making this a separate answer, but I cannot comment because I have less than 50 reputation.

Oka suggested using frailty in connection with coxph in order to test the proportional hazard assumption. I believe it is worth noting that the documentation for frailty mentions, "the coxme package has superseded this [frailty] method." For this reason, the original question about "how to test the PH assumption on mixed effect cox model coxme," has strong justification to stay within the scope of coxme.

kjg
  • 31
  • 2
2

However, I cannot find the equivalent for coxme models.


Based on the documentation, you can add the random effects into Cox or survreg model with frailty function. As suggested in SO answer, you can do it like this:

# making the model
myfit <- coxph( Surv(Time, Censor) ~ fixed + frailty(random) , data = mydata )

# assessing the proportionality of hazards
cox.zph(myfit)

How to test PH assumption on mixed effect cox model coxme?


With coxme you could probably use model residuals for diagnostics. The objects produced by lmekin or lmer functions have been mentioned to have methods for residuals. And when you get them, you can plot them and examine graphically or otherwise.

If there is no equivalent of the cox.zph for coxme models, is it valid for publication in scientific article to run mixed effect coxme model but test the PH assumption on a cox.ph model identical to the coxme model but without random effect?


There is no reason for that, since you can test the PH with random effects with cox.zph/cox.ph and get more accurate results.

Oka
  • 523
  • 2
  • 6
0

Based on the documentation in the page 31, "cox.zph" does not work for the "frailty" function.

Therefore, you can not use cox.zph(myfit) to check mixed effects Cox models as the answers Oka or kjg suggested above.

Random effects terms such a frailty or random effects in a coxme model are not checked for proportional hazards, rather they are treated as a fixed offset in model.

j0ke777
  • 1
  • 2
  • The note in the manual for `cox.zph` that you cite only applies to the random-effect terms. According to the manual, the fixed-effect terms in a `coxme` model can still be evaluated for PH with `cox.zph()`. Those fixed effects will typically be of most interest in terms of evaluating PH. – EdM May 26 '21 at 15:44
0

The proportional hazards (PH) assumption for fixed effects in a coxme model can be tested with the same cox.zph() function used for coxph models. As the documentation of cox.zph() states, its fit argument is "the result of fitting a Cox regression model, using the coxph or coxme functions." (Emphasis added.)

As another answer notes, the random effects in a coxme model cannot be evaluated for PH, as the modeling process treats the random effects as fixed offsets. I suspect that failures of PH with respect to random effects (whatever that might mean in this context) would thus show up as PH violations in fixed effects.

This answer illustrates the successful use of cox.zph() on a coxme object, at least with fairly recent versions of the software (survival_3.1-11 and coxme_2.2-16).

EdM
  • 57,766
  • 7
  • 66
  • 187