Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R: Proportional Hazard Assumption in coxme()

I am running a mixed effects model using the coxme() function in R. The model analyzes the event of product success of firms in different countries. Fixed effects are for example GDP, population, technology and cultural variables. Random effects are the different countries.

I know that with coxph() it is possible to test for proportional hazard using the cox.zph() command.

My question: How can I check for proportional hazard with coxme()?

like image 307
CC89 Avatar asked Sep 11 '25 02:09

CC89


1 Answers

Fixed effects in a random-effects coxme model can be checked for proportional hazards (PH) with the same cox.zph() function used for standard coxph() models. According to the manual, the fit argument for cox.zph() is "the result of fitting a Cox regression model, using the coxph or coxme functions."

Random effects "are not checked for proportional hazards, rather they are treated as a fixed offset in model."

An example, borrowed from this Cross-Validated question:

> library(survival)    
> library(coxme)    
> df <- stanford2
> df$cid <- round(df$id / 10) + 1 ## generates some clusters
> fit <- coxme(Surv(time, status) ~ age + t5 + (1 | cid),data=df)
> fit
Cox mixed-effects model fit by maximum likelihood
  Data: df
  events, n = 102, 157 (27 observations deleted due to missingness)
  Iterations= 2 12 
                    NULL Integrated    Fitted
Log-likelihood -451.0944  -446.8618 -446.8261

                  Chisq   df        p  AIC   BIC
Integrated loglik  8.47 3.00 0.037317 2.47 -5.41
 Penalized loglik  8.54 2.04 0.014582 4.46 -0.88

Model:  Surv(time, status) ~ age + t5 + (1 | cid) 
Fixed coefficients
          coef exp(coef)   se(coef)    z      p
age 0.02960206  1.030045 0.01135724 2.61 0.0091
t5  0.17056610  1.185976 0.18330590 0.93 0.3500

Random effects
 Group Variable  Std Dev      Variance    
 cid   Intercept 0.0199835996 0.0003993443
> cox.zph(fit)
       chisq   df    p
age    0.831 3.00 0.84
t5     2.062 2.04 0.36
GLOBAL 2.767 5.04 0.74

This was done with survival_3.1-11 and coxme_2.2-16.

like image 72
EdM Avatar answered Sep 12 '25 19:09

EdM