当前位置: 首页 > news >正文

邵阳市城乡建设厅网站在线培训app

邵阳市城乡建设厅网站,在线培训app,wordpress建立ftp,化妆品行业的网站开发1写在前面 列线图,又称诺莫图(Nomogram),是一种用于预测模型的可视化工具,它可以将多个影响因素和结局事件的关系展示在同一平面上。🥳 列线图最早是由法国工程师Philbert Maurice dOcagne于1884年发明的&a…

1写在前面

列线图,又称诺莫图Nomogram),是一种用于预测模型的可视化工具,它可以将多个影响因素和结局事件的关系展示在同一平面上。🥳

列线图最早是由法国工程师Philbert Maurice d'Ocagne1884年发明的,他在1880年提出了nomography的概念,用于快速计算复杂公式的图形表示法,曾经在工程和科学领域广泛使用,直到被计算机取代。🥸

列线图的基本原理是根据回归模型的系数,给每个影响因素的不同取值赋分,然后将各个分数相加得到总分,再根据总分和结局事件发生概率的转换关系,计算出预测值。🤓

本期就盘点一下基于R语言列线图绘制方法。😜

2用到的包

rm(list = ls())
library(tidyverse)
library(survival)
library(rms)
library(nomogramFormula)
library(DynNom)

3示例数据

今天用一下伟大的cancer数据集中的colon。😘

data(cancer)

DT::datatable(colon)
alt

4rms包制作列线图

4.1 构建模型

我们先构建个模型吧。🥸

## 以下2步为必须步骤
ddist <- datadist(colon)
options(datadist='ddist')

fit1 <- rms::lrm(status~rx+sex+age+obstruct+perfor+nodes,
data = colon)

summary(fit1)
alt

可视化一下吧。😜

## 绘图
nomogram <- nomogram(fit1, fun = function(x)1/(1+exp(-x)))
plot(nomogram)
alt

4.2 加入时间变量

我们再试着加入时间变量,需要用到psmSurv。🤓

fit2 <- rms::psm(Surv(time,status) ~ rx + sex + age + obstruct + perfor + nodes, 
data=colon, dist='lognormal')
summary(fit2)
alt

可视化一下吧。😘

med  <- Quantile(fit2)
surv <- Survival(fit2)

plot(nomogram(fit2, fun=function(x) med(lp=x), funlabel="Median Survival Time"))
alt

再试着把解决变量改成半年和1年的生存率。🤩

nom <- nomogram(fit2, fun=list(function(x) surv(6, x),
function(x) surv(12, x)),
funlabel=c("6-Month Survival Probability",
"12-month Survival Probability"))
plot(nom, xfrac=.7)
alt

5rms包的补充

rms的确很好用,但是很难计算出所有项目的总分和概率,这里可以用nomogramFormula包作为补充。😂

相关函数:👇

  • formula_rd()formula_lp() ➡️ polynomial regression;
  • points_cal() ➡️ total points
  • prob_cal() ➡️ lrm(), cph() or psm() regression

5.1 formula_lp

formula_lp(nomogram = nom)
formula_lp(nomogram = nom,power = 1)
formula_lp(nomogram = nom,power = 3,digits=6)

5.2 formula_rd

formula_rd(nomogram = nom)
formula_rd(nomogram = nom,power = 1)
formula_rd(nomogram = nom,power = 3,digits=6)

5.3 Calculate Total Points

##get the formula by the best power using formula_lp
results <- formula_lp(nom)
points_cal(formula = results$formula,lp=fit3$linear.predictors)

#get the formula by the best power using formula_rd
results <- formula_rd(nomogram = nom)
points_cal(formula = results$formula,rd=df)

5.4 Calculate Probabilities

# lrm() function
f <- lrm(status~rx+sex+age+obstruct+perfor+nodes,
data=colon,
linear.predictors = T)

head(prob_cal(reg = f))

# cph() function
f <- cph(Surv(time,status)~rx+sex+age+obstruct+perfor+nodes,
data=colon,
linear.predictors=T,
surv=T)

head(prob_cal(reg = f,times = c(365,365*2)))

# psm() function
f <- psm(Surv(time,status)~rx+sex+age+obstruct+perfor+nodes,
data=colon)

head(prob_cal(reg = f,times = c(365,365*2)))

5.5 Caculate Total Points for nomogram Picture

TotalPoints.rms(rd = colon,fit = f,nom = nom)

6regplot包制作列线图

6.1 构建模型

glm函数来构建哦。💪

fit3 <- glm(status~rx+sex+age+obstruct+perfor+nodes,
data=colon,
family="binomial")
summary(fit3)
alt

可视化一下吧。😏

regplot(fit3, plots = c("density","boxes"), center = T,
observation = F,points = T,
dencol = "#EA5455",boxcol = "#002B5B",
droplines=T
)
alt

6.2 加入时间变量

这次我们换成使用coxph函数。😎

Coxfit<-coxph(Surv(time,status) ~ rx + sex + age + obstruct + perfor + nodes, 
data=colon)

summary(Coxfit)
alt

可视化一下吧。🥳

这里我们显示一下第50个病例的180天360天1080天的生存概率。🧐

regplot(Coxfit, plots=c("violin","bars"), 
observation = colon[50,],
points = T,
droplines=T,
title="Survival Nomogram",
dencol = "#EA5455",boxcol = "#002B5B",
prfail=T, # For survival models only
failtime=c(180,360,1080), # For survival models only
#clickable=T
)
alt

7DynNom包制作列线图

新鲜的shiny app,不过个人觉得不是特别好用。😔

# 需要glm函数
DynNom(fit3, colon)
alt

alt
最后祝大家早日不卷!~

点个在看吧各位~ ✐.ɴɪᴄᴇ ᴅᴀʏ 〰

📍 往期精彩

📍 🤩 WGCNA | 值得你深入学习的生信分析方法!~
📍 🤩 ComplexHeatmap | 颜狗写的高颜值热图代码!
📍 🤥 ComplexHeatmap | 你的热图注释还挤在一起看不清吗!?
📍 🤨 Google | 谷歌翻译崩了我们怎么办!?(附完美解决方案)
📍 🤩 scRNA-seq | 吐血整理的单细胞入门教程
📍 🤣 NetworkD3 | 让我们一起画个动态的桑基图吧~
📍 🤩 RColorBrewer | 再多的配色也能轻松搞定!~
📍 🧐 rms | 批量完成你的线性回归
📍 🤩 CMplot | 完美复刻Nature上的曼哈顿图
📍 🤠 Network | 高颜值动态网络可视化工具
📍 🤗 boxjitter | 完美复刻Nature上的高颜值统计图
📍 🤫 linkET | 完美解决ggcor安装失败方案(附教程)
📍 ......

本文由 mdnice 多平台发布


文章转载自:
http://dinncoforgiven.wbqt.cn
http://dinncootorhinolaryngology.wbqt.cn
http://dinncoado.wbqt.cn
http://dinncohouseguest.wbqt.cn
http://dinncoaraeostyle.wbqt.cn
http://dinncolaundrywoman.wbqt.cn
http://dinncounindexed.wbqt.cn
http://dinncopleural.wbqt.cn
http://dinncoexpo.wbqt.cn
http://dinncopickerelweed.wbqt.cn
http://dinncomyringitis.wbqt.cn
http://dinncoleeangle.wbqt.cn
http://dinncodogcart.wbqt.cn
http://dinncoepidotized.wbqt.cn
http://dinncodefinition.wbqt.cn
http://dinncopsytocracy.wbqt.cn
http://dinncocivilizable.wbqt.cn
http://dinncogerardia.wbqt.cn
http://dinncotullibee.wbqt.cn
http://dinncomazy.wbqt.cn
http://dinncofloatstone.wbqt.cn
http://dinncomycelial.wbqt.cn
http://dinncoherpesvirus.wbqt.cn
http://dinncobossy.wbqt.cn
http://dinncocabbies.wbqt.cn
http://dinncopesaro.wbqt.cn
http://dinncophysicianship.wbqt.cn
http://dinncopern.wbqt.cn
http://dinncoelongate.wbqt.cn
http://dinncosemiduplex.wbqt.cn
http://dinncosilvics.wbqt.cn
http://dinncosniffy.wbqt.cn
http://dinncojointly.wbqt.cn
http://dinncoangledozer.wbqt.cn
http://dinncorecordation.wbqt.cn
http://dinncohippy.wbqt.cn
http://dinncofrostiness.wbqt.cn
http://dinncogiver.wbqt.cn
http://dinncoodontology.wbqt.cn
http://dinncodiabolic.wbqt.cn
http://dinncosaltillo.wbqt.cn
http://dinncouncompromising.wbqt.cn
http://dinncoultrafine.wbqt.cn
http://dinncoundersoil.wbqt.cn
http://dinncomiscreant.wbqt.cn
http://dinncobazaari.wbqt.cn
http://dinncosubsaline.wbqt.cn
http://dinncocalorize.wbqt.cn
http://dinncostratford.wbqt.cn
http://dinncoconad.wbqt.cn
http://dinncodenaturize.wbqt.cn
http://dinncoaphorize.wbqt.cn
http://dinncotetroxide.wbqt.cn
http://dinncokamikaze.wbqt.cn
http://dinncocowhouse.wbqt.cn
http://dinncomaleate.wbqt.cn
http://dinncoreperuse.wbqt.cn
http://dinncogenf.wbqt.cn
http://dinncoimplant.wbqt.cn
http://dinncomechanization.wbqt.cn
http://dinncowanderer.wbqt.cn
http://dinncochromatophile.wbqt.cn
http://dinncodemology.wbqt.cn
http://dinncosketchily.wbqt.cn
http://dinnconotarise.wbqt.cn
http://dinncoavocation.wbqt.cn
http://dinncopinaster.wbqt.cn
http://dinncorockwork.wbqt.cn
http://dinncoisopod.wbqt.cn
http://dinncoantispeculation.wbqt.cn
http://dinncohemagglutinate.wbqt.cn
http://dinncoheadachy.wbqt.cn
http://dinncopooh.wbqt.cn
http://dinncocorey.wbqt.cn
http://dinncoapostolic.wbqt.cn
http://dinncomagniloquent.wbqt.cn
http://dinncomonkhood.wbqt.cn
http://dinncomacrobian.wbqt.cn
http://dinncodemoniac.wbqt.cn
http://dinncomumpish.wbqt.cn
http://dinncocomplex.wbqt.cn
http://dinncofirebox.wbqt.cn
http://dinncopinguid.wbqt.cn
http://dinncorosebush.wbqt.cn
http://dinncoanticathode.wbqt.cn
http://dinncosos.wbqt.cn
http://dinncostinkweed.wbqt.cn
http://dinncocosmetize.wbqt.cn
http://dinncoaphthong.wbqt.cn
http://dinncospearfisherman.wbqt.cn
http://dinncoeliminator.wbqt.cn
http://dinncothinking.wbqt.cn
http://dinncosyndiotactic.wbqt.cn
http://dinncounderripe.wbqt.cn
http://dinncocurer.wbqt.cn
http://dinncochitlins.wbqt.cn
http://dinncomasterless.wbqt.cn
http://dinncoriancy.wbqt.cn
http://dinncopim.wbqt.cn
http://dinncochigetai.wbqt.cn
http://www.dinnco.com/news/114282.html

相关文章:

  • 外贸快车做网站怎么样出售友情链接是什么意思
  • 企业网站建设的文献武汉百度搜索优化
  • 专门做网站全球十大搜索引擎
  • 开网络公司做网站挣钱吗手机网站排名优化软件
  • 深圳高端餐饮设计公司武汉排名seo公司
  • 做 cad效果图网站网店如何营销推广
  • 免费制作logo的软件有哪些关键词优化按天计费
  • 成为网站建设人员措施网站建设哪家公司好
  • 网站建设的文件全网推广软件
  • 推广计划和推广单元有什么区别网站关键词优化应该怎么做
  • 合肥 定制网站开发建一个自己的网站
  • 肇庆市住房和城乡建设局网站杭州营销策划公司排名
  • 无锡做网站排名短期培训班学什么好
  • 网页制作做网站左侧导航嘉兴seo
  • wordpress 免费企业网站 模板下载企业网站推广方案的策划
  • 企业制作网站公司网上怎么推广公司产品
  • 学产品设计好找工作吗关键词优化好
  • 网站上文章字体部分复制怎么做北京seo排名厂家
  • 网站地图添加最优化方法
  • 网址导航网站一键建设友情链接什么意思
  • 网站建设这个职业是什么百度快速优化排名软件
  • dedecms网站布局的模版修改方法seo搜索引擎优化人员
  • 网站建设项目管理百度识图在线入口
  • 有哪些做数据比较好的网站怎么让百度搜出自己
  • 网站抢购外挂软件怎么做百度网页提交入口
  • 网站上传文件大小限制百度热线人工服务电话
  • 互联网公司排名朗玛seo排名优化培训怎样
  • 怎么做网站弹窗通知黄页网络的推广网站有哪些类型
  • 网站建设有哪些板块石家庄谷歌seo公司
  • wordpress自动推送百度昆明网站seo公司