r - 在 R 上使用 pROC 的 ROC 曲线:计算阈值等于的实验室值
问题描述
我正在使用 pROC 提供血液测试的 ROC 分析。我已经计算了 ROC 曲线、AUC,并正在使用 ci.coords 函数以提供的特异性(95% CI)提供规格、传感器、PPV 和 NPV。
我想能够说出这是什么值的血检,例如在 1.2 时,sens 是 x,spec 是 y,NPV 是 c,PPV 是 d。理想情况下,我应该有如下表的数据:
Lab value | Sens | Spec | NPV | PPV
我似乎无法从我目前使用的方法中得到这个?
有没有人有什么建议?
非常感谢
目前
spred1 = predict(smodel1)
sroc1 = roc(EditedDF1$any_abnormality, spred1)
ci.coords(sroc1, x=0.95, input="sensitivity", transpose = FALSE, ret=c("sensitivity","specificity","ppv","npv"))```
解决方案
由于您没有给出可重复的示例,因此我们使用包装随附的示例
library(pROC)
data(aSAH)
roc1 <- roc(aSAH$outcome, aSAH$s100b)
该软件包附带coords
列出不同阈值的特异性和敏感性的功能:
> coords(roc1)
threshold specificity sensitivity
1 -Inf 0.00000000 1.00000000
2 0.035 0.00000000 0.97560976
3 0.045 0.06944444 0.97560976
4 0.055 0.11111111 0.97560976
5 0.065 0.13888889 0.97560976
6 0.075 0.22222222 0.90243902
7 0.085 0.30555556 0.87804878
8 0.095 0.38888889 0.82926829
9 0.105 0.48611111 0.78048780
10 0.115 0.54166667 0.75609756
...
从那里,您可以使用ci.coords
您已经使用的功能,通过您想要的任何数据来完成表格。
推荐阅读
- node.js - 按电话号码跟踪链接点击次数
- image - 如何在反应本机应用程序中通过相机(反应本机图像选择器)捕获和渲染多个图像
- javascript - 如何在 Spring MVC 的 JSP 登录页面中实现记住我?
- javascript - @keyup.delete输入直到为空时如何触发功能?VueJS
- django - 即使级别设置为 ERROR,Django 记录器的级别也不会跟踪 INFO 消息
- javascript - 无法在 VAST - FLUID PLAYER 中显示“跳过广告”
- node.js - 如何在通过 sql 查询保存数据或更新数据时删除脚本注入?
- entity-framework - EF Core 不能在父级中包含子级
- javascript - NodeJS:从 readStream 获取文件名
- bash - 正则表达式匹配以点结尾的所有内容