What I want to do is comparing two non-nested Cox regression models using R. Just for example:

fit1 <- coxph(Surv(time,status)~ age, data=cancer)
fit2 <- coxph(Surv(time,status)~ sex, data=cancer)

I have read almost all relative questions about non-nested model comparison in this website. However, when it comes into survival data, things become quite different. Here are ways to compare non-nested models(some of them don't work in Cox regression model):

  • AIC/BIC: the less the better, but there isn't any test to do comparison.
  • LR based test: coxtest {lmtest}, jtest {lmtest}, vuong test {games}, Clarke test {games}. These tests were developed to deal with non-nested models, but they are not applicable to Cox regression models (I guess because Cox model use partial likelihood?) And I found a paper Comparing nonnested Cox models which is close to my question, but I have problem to imply this method in R code. Is there any package can be used to do LR based test for non-nested Cox model?
  • Encompassing test: fit3 <- coxph(Surv(time,status)~ age+sex, data=cancer). Fit3 can be used to do anova(fit1,fit3,fit2). But in reality, the variables are not age and sex, but two extremely relevant variables which are continuous age and discrete age. So fit3 is irrational.
  • C-index: it can be used to compare the predictions of Cox models. But it is less sensitive than LR based test. So far I haven't found a test to compare two c-indexes.

I consider to use bootstrap methods to compare AIC/BIC and c-index. Any help in this question is greatly appreciated !

  • 1
    $\begingroup$ Why not fit <- coxph(Surv(time,status)~ age + sex, data=cancer), which, if really needed, can simplify to fit1 or fit2? $\endgroup$
    – ocram
    Commented Oct 31, 2017 at 7:03

2 Answers 2


You can compare Cox regression models (coxph) in R with plrtest which is partial likelihood ratio test for non-nested coxph models:

require("nonnestcox") #github.com/thomashielscher/nonnestcox
pbc  <- subset(pbc, !is.na(trt))
mod1 <- coxph(Surv(time, status==2) ~ age, data=pbc, x=T)
mod2 <- coxph(Surv(time, status==2) ~ age + albumin + bili + edema + protime, data=pbc,  x=T)
mod3 <- coxph(Surv(time, status==2) ~ age + log(albumin) + log(bili) + edema + 
log(protime), data=pbc, x=T)
plrtest(mod3, mod2, nested=F) # non-nested models
plrtest(mod3, mod1, nested=T) # nested models

You can check out this link: http://www.drizopoulos.com/courses/emc/ep03_%20survival%20analysis%20in%20r%20companion#proportional-hazards-assumption

My understanding is, that under section 4.3 it recommends to use a likelihood-ratio test using the anova() function.

fit1 <- coxph(Surv(time,status)~ age, data=cancer)
fit2 <- coxph(Surv(time,status)~ sex, data=cancer)

Gives the output:

Analysis of Deviance Table
Cox model: response is  Surv(time, status)
 Model 1: ~ age
 Model 2: ~ sex
   loglik  Chisq Df P(>|Chi|)    
1 -747.79                        
2 -744.59 6.3927  0 < 2.2e-16 ***
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  • 1
    $\begingroup$ If models aren't nested, ANOVA wouldn't be the best option $\endgroup$
    – garcesj
    Commented Dec 15, 2021 at 15:01

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.