我在生信技能树多次分享过生存分析的细节;
- 人人都可以学会生存分析(学徒数据挖掘)
- 学徒作业-两个基因突变联合看生存效应
- TCGA数据库里面你的基因生存分析不显著那就TMA吧
- 对“不同数据来源的生存分析比较”的补充说明
- 批量cox生存分析结果也可以火山图可视化
- 既然可以看感兴趣基因的生存情况,当然就可以批量做完全部基因的生存分析
- 多测试几个数据集生存效应应该是可以找到统计学显著的!
- 我不相信kmplot这个网页工具的结果(生存分析免费做)
- 为什么不用TCGA数据库来看感兴趣基因的生存情况
- 200块的代码我的学徒免费送给你,GSVA和生存分析
- 集思广益-生存分析可以随心所欲根据表达量分组吗
- 生存分析时间点问题
- 寻找生存分析的最佳基因表达分组阈值
- apply家族函数和for循环还是有区别的(批量生存分析出图bug)
- TCGA数据库生存分析的网页工具哪家强
- KM生存曲线经logRNA检验后也可以计算HR值
生存分析是目前肿瘤等疾病研究领域的点睛之笔!
大家会看到非常多的生存分析笔记,其实都很狡猾,喜欢使用他们自己的数据,这样的话,代码根本就无法重复出来。其实R包survival里面内置了超级多的可以供练习生存分析代码的数据集,如下所示 :
Data sets in package ‘survival’:
aml (leukemia) Acute Myelogenous Leukemia survival data
bladder Bladder Cancer Recurrences
bladder1 (bladder) Bladder Cancer Recurrences
bladder2 (bladder) Bladder Cancer Recurrences
cancer NCCTG Lung Cancer Data
capacitor (reliability) Reliability data sets
cgd Chronic Granulotamous Disease data
cgd0 (cgd) Chronic Granulotomous Disease data
colon Chemotherapy for Stage B/C colon cancer
cracks (reliability) Reliability data sets
diabetic Ddiabetic retinopathy
flchain Assay of serum free light chain for 7874
subjects.
genfan (reliability) Reliability data sets
heart Stanford Heart Transplant data
ifluid (reliability) Reliability data sets
imotor (reliability) Reliability data sets
jasa (heart) Stanford Heart Transplant data
jasa1 (heart) Stanford Heart Transplant data
kidney Kidney catheter data
leukemia Acute Myelogenous Leukemia survival data
logan Data from the 1972-78 GSS data used by
Logan
lung NCCTG Lung Cancer Data
mgus Monoclonal gammopathy data
mgus1 (mgus) Monoclonal gammopathy data
mgus2 (mgus) Monoclonal gammopathy data
myeloid Acute myeloid leukemia
nafld1 (nafld) Non-alcohol fatty liver disease
nafld2 (nafld) Non-alcohol fatty liver disease
nafld3 (nafld) Non-alcohol fatty liver disease
nwtco Data from the National Wilm's Tumor Study
ovarian Ovarian Cancer Survival Data
pbc Mayo Clinic Primary Biliary Cirrhosis Data
pbcseq (pbc) Mayo Clinic Primary Biliary Cirrhosis,
sequential data
rats Rat treatment data from Mantel et al
rats2 (rats) Rat data from Gail et al.
retinopathy Diabetic Retinopathy
rhDNase rhDNASE data set
solder Data from a soldering experiment
stanford2 More Stanford Heart Transplant data
survexp.mn (survexp)
Census Data Sets for the Expected Survival
and Person Years Functions
survexp.us (survexp)
Census Data Sets for the Expected Survival
and Person Years Functions
survexp.usr (survexp)
Census Data Sets for the Expected Survival
and Person Years Functions
tobin Tobin's Tobit data
transplant Liver transplant waiting list
turbine (reliability)
Reliability data sets
udca Data from a trial of usrodeoxycholic acid
udca1 (udca) Data from a trial of usrodeoxycholic acid
udca2 (udca) Data from a trial of usrodeoxycholic acid
uspop2 Projected US Population
valveSeat (reliability)
Reliability data sets
veteran Veterans' Administration Lung Cancer study
假如你加载了 survival
包,就可以完完整整的复制粘贴下面的代码啦:
rm(list=ls())
options(stringsAsFactors = F)
library(survival)
colnames(cancer)
bc<-cancer
dc<-datadist(bc)
options(datadist="dc")
library(rms)
# Cox Proportional Hazards Model and Extensions , cph {rms}
f <- cph(Surv(time, status) ~ age + sex +ph.ecog + pat.karno +wt.loss,
x=T, y=T, surv=T, data=cancer, time.inc=36)
summary(f)
# Fit Proportional Hazards Regression Model , coxph {survival}
surv<- Survival(f)
nom<- nomogram(f, fun=list(function(x) surv(36, x), function(x) surv(60, x),
function(x)surv(120, x)), lp=F, funlabel=c("3-year survival", "5-yearsurvival", "10-year survival"),
maxscale=10, fun.at=c(0.95,0.9, 0.85, 0.8, 0.75, 0.7, 0.6, 0.5))
plot(nom)