探序基因肿瘤研究院整理
R包survival可进行生存分析,并绘制生存曲线
install.packages("survival")
library(survival)
survival包的详细信息:https://cran.r-project.org/web/packages/survival/index.html
1. 生存时间的定义
2. 病人删失的处理
3. 注意病人状态的表示,根据survival包的说明书,bladder数据集表格,status指的是End of interval code, 0=censored, 1=recurrence,2=death from bladder disease, 3=death other/unknown cause。
4. survival包中的Surv函数,接受时间变量和事件状态变量两个参数。根据说明书描述, event这个参数:
The status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2=death). For interval censored data, the status indicator is 0=right censored, 1=event at time, 2=left censored, 3=interval censored. For multiple endpoint data the event variable will be a factor, whose first level is treated as censoring. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event.
下载各种数据集的临床信息,大家要注意对应好病人状态
参考:
知乎-统计基本功:一文搞懂生存分析
CSDN-使用R语言中的survival包可以进行生存分析,并生成生存曲线
CSDN-使用R语言中的survival包进行生存分析是一种常见的统计方法