survival包内置了如此多的生存分析练习数据

我在生信技能树多次分享过生存分析的细节;

生存分析是目前肿瘤等疾病研究领域的点睛之笔!

大家会看到非常多的生存分析笔记,其实都很狡猾,喜欢使用他们自己的数据,这样的话,代码根本就无法重复出来。其实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)

Comments are closed.