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

网站 建设 步骤google推广

网站 建设 步骤,google推广,重庆网站建设外贸,wordpress 识别pc手机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://www.ds6.com.cn/news/25649.html

相关文章:

  • 网站建设的概念汕头seo网站建设
  • 湛江有哪些网站建设公司厦门网络推广哪家强
  • 如何使用模板建设网站网络销售平台怎么做
  • 公司发布网站需要备案上海全网营销推广
  • 南宁网站推广排名搜索推广竞价托管哪家好
  • asp做的网站怎么发布seo是什么部位
  • 地方门户网站建设百度关键词刷排名教程
  • 南昌科技网站建设广州seo好找工作吗
  • 哪些网站有设计缺点百度推广客户端下载安装
  • 电子商务网站推广实训心得点击器
  • 有没有找项目的网站如何制作百度网页
  • 网站实现留言功能网站接广告
  • 郑州做网站推广外包宁波seo运营推广平台排名
  • 网站制作设计机构产品市场推广计划书
  • 官方网站建设最重要的是今天的重要新闻
  • 网站制作资质互动营销经典案例
  • 网站建设使用的工具seo顾问服务四川
  • 有哪个网站可以做兼职网络推广的主要工作内容
  • 中国科技成就有哪些沈阳网站制作优化推广
  • 常州个人网站建设大学生网络营销策划书
  • 网站搭建就来徐州百度网络非常好郑州网络营销哪家正规
  • 网站可视区最多可以做多大定制网站制作公司
  • 服务器搭建网站步骤视频域名注册服务网站查询
  • 珠海企业网站建设费用淘宝指数官网入口
  • 在网上帮做图片的网站推广方案模板
  • 企业常用邮箱360优化大师最新版的功能
  • 广告设计与制作app杭州seo外包
  • 自己搭建服务器做网站要多久缅甸最新新闻
  • php网站mysql数据库导入工具营销软文范例大全300字
  • 免费咨询医院网站seo工具