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

建设化妆品网站的成本湖南seo优化服务

建设化妆品网站的成本,湖南seo优化服务,自己建立一个网站,门户网站的发展趋势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.hkea.cn/news/792648/

相关文章:

  • dz网站数据备份bt磁力猪
  • github 可以做网站吗360seo
  • 杭州 企业门户网站建设爱链
  • dj那个网站做的好长沙公司网络营销推广
  • 设计师培训招生视频黑帽seo联系方式
  • 做网上贸易哪个网站好西宁网站seo
  • 电子烟网站建设杯子软文营销300字
  • 广州企业网站制作怎么做营销推广
  • 网站建设服务器在香港郑州网站建设专业乐云seo
  • 河北建设工程交易信息网海口关键词优化报价
  • 全国网站建设公司有多少家微信朋友圈广告投放收费标准
  • 免费做网站公司黑帽seo排名技术
  • apk连接wordpress上海seo
  • 企业建网站租用服务器好还是买一个好石家庄网站关键词推广
  • wordpress文件解析外贸网站优化
  • 建设工程竣工备案网站百度保障中心人工电话
  • 韶关城乡建设部网站首页营销型网站建设策划书
  • 建设银行手机银行下载官方网站谷歌浏览器网页版入口在哪里
  • 网站建设 好域名注册信息
  • 公众号微网站建设认证哪个推广网站好
  • 爬取1024上传到wordpress蔡甸seo排名公司
  • 流感吃什么药更好seo的方法
  • 营销型网站建设市场seo黑帽技术有哪些
  • 扬中做网站的公司seo虚拟外链
  • 永川集团网站建设免费网站seo诊断
  • 国外 上海网站建设网络营销推广方式案例
  • 24手表网站网络技术推广服务
  • 鞍山网站制作推广游戏推广员判几年
  • 360如何做网站优化网页设计制作软件
  • 金华网站建设电话电商运营主要负责什么