诺莫图(Nomogram)展示回归分析的结果

展现回归分析的OR、HR值可以用森林图,而如果想直观预测实例化对象的生存概率,则可以使用诺莫图

安装补充包

Logistic回归

1
2
3
4
5
6
7
8
dd=datadist(df)
options(datadist="dd")
lrmf <- paste0("factor(dcf_status)~", paste(colnames(df)[1:10], collapse = '+'))
lrmf
f <- lrm(formula(lrmf) , data = df)
nom <- nomogram(f, fun=plogis, lp=F, funlabel="Risk")
options(repr.plot.width=10, repr.plot.height=6)
plot(nom, xfrac=.2)

Cox回归

1
2
3
4
5
6
7
8
9
10
11
12
13
14
dd=datadist(df)
options(datadist="dd")
coxmf <- paste0("Surv(dcf_time/365, dcf_status==0)~", paste(colnames(df)[1:10], collapse = '+'))
coxmf
f2 <- psm(formula(coxmf), data=df, dist='lognormal') # 构建COX比例风险模型
med <- Quantile(f2) # 计算中位生存时间
surv <- Survival(f2) # 构建生存概率函数
nom <- nomogram(f2, fun=function(x) med(lp=x),funlabel="Median Survival Time")
options(repr.plot.width=12, repr.plot.height=6)
plot(nom,xfrac=.2)
nom <- nomogram(f2, fun=list(function(x) surv(10, x)),
funlabel=c("10-year Survival Probability"))
options(repr.plot.width=10, repr.plot.height=6)
plot(nom, xfrac=.2)

诺莫图(Nomogram)展示回归分析的结果
https://b.limour.top/1914.html
Author
Limour
Posted on
July 17, 2022
Licensed under