cliffgao的个人博客分享 http://blog.sciencenet.cn/u/cliffgao 兴趣:生物信息学、统计、概率

博文

生存分析中 摘记

已有 4321 次阅读 2020-3-10 22:11 |个人分类:癌症|系统分类:科研笔记

(1)
如果遇到:
Error in survdiff(surv.dfs ~ group) : Right censored data only
Error in coxph(surv.dfs ~ group) : 
        Cox model doesn't support "mright" survival data

很可能是你的 Event是 因子(factor)类型的数据


df$Event <- as.numeric(as.character(df$Event))

如果是将因子转化为数值,可以使用 as.numberica(as.character(YOUR_STRING))


参考: https://stackoverflow.com/questions/42243471/survival-not-recognizing-right-censored-data


(2)

library(survival)

kmfit<survfit(Surv(Time,Event)~Group,data=yourData)

kmfit

输出结果的时候发现medain 是NA

像:

         n     events  median     0.95LCL   0.95UCL
Group=high  332     57    NA     2134      NA
Group=low  264     67   1741    1503      NA

这是因为:

If one of the groups has not yet dropped to 50% survival at the end of the available data, you cannot compute a median survival and there will be NA values for median survival in such cases. Even if median survival has been reached in a group, it might not be possible to calculate complete confidence intervals for those median values, as you have seen.*

参考: https://stats.stackexchange.com/questions/402432/why-median-is-na-for-some-of-the-group-outcomes-in-survival-analysis


(3)Time数值类型; Status 如果是0/1 可以是数值类型





https://wap.sciencenet.cn/blog-468005-1222838.html

上一篇:keras validation n-fold cross validation
下一篇:RNA-seq 测序数据表达数据类型
收藏 IP: 111.165.25.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-26 13:38

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部