首页 > 解决方案 > coxph的输出中缺少R平方

问题描述

我是 R 新手,正在上一门在线课程。我正在运行 cox 模型,但在输出中没有得到 r 平方值。有谁知道为什么?

cox2 <- coxph(Surv(fu_time,death) ~ age_cat)
> summary(cox2)
Call:
coxph(formula = Surv(fu_time, death) ~ age_cat)

  n= 1000, number of events= 492 

                   coef exp(coef) se(coef)      z Pr(>|z|)    
age_catUnder 65 -1.4264    0.2402   0.2402 -5.938 2.88e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

                exp(coef) exp(-coef) lower .95 upper .95
age_catUnder 65    0.2402      4.164      0.15    0.3846

Concordance= 0.549  (se = 0.007 )
Likelihood ratio test= 56.34  on 1 df,   p=6e-14
Wald test            = 35.26  on 1 df,   p=3e-09
Score (logrank) test = 41.66  on 1 df,   p=1e-10

标签: cox-regression

解决方案


R 包是“活的”,它们会随着时间而变化。形成包“survival”的 2.44 版,summary.coxph 不再报告 R2。您可以在“2.44 版更改”中阅读原因:

Nagelkirke R^2 已从 summary.coxph 中删除。这种措施的缺点是众所周知的,一致性是更好的措施。


推荐阅读