R数据分析:列线图的做法及解释 您所在的位置:网站首页 列线图校准曲线怎么解读 R数据分析:列线图的做法及解释

R数据分析:列线图的做法及解释

2024-06-21 05:44| 来源: 网络整理| 查看: 265

我们经常做的研究就是建立预测模型,我常常问自己,建的模型有啥实际应用价值?

直到我了解到列线图这个东西,才知道模型可以通过列线图转化为实际的应用工具。

列线图也叫Nomogram,中文常称为诺莫图:

Nomograms are visual and intuitive, which helps the general population and health managers to undersand the risk of diseases more easily

简单来说这个东西就是来帮助病人或者医生来预测某种结局的风险的工具,其核心是背后的预测模型。

今天还是手把手带大家做一个列线图。

实例描述

今天我们用到的数据为R自带的泰坦尼克邮轮数据集titanic3。数据大概如下图:

R数据分析:列线图的做法及解释

 

里面有乘客的死亡情况(二分类)和乘客的各种特征。那么我们关心的是:如何根据乘客的年龄age,性别sex和客舱等级pclass来预测乘客的死亡情况。我们打算画一个列线图出来。

R操作

做列线图必不可少的一步操作就是总结一下数据的分布,这一步的目的就是画图时好依照这个分布规定画图的尺度,我们要用到的方法是datadist:

datadist:For a given set of variables or a data frame, determines summaries of variables for effect and plotting ranges, values to adjust to, and overall ranges for Predict, plot.Predict, ggplot.Predict, summary.rms, survplot, and nomogram.rms.

代码如下:

t.data


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有