R studio-我需要使用混淆矩阵的敏感性和特异性以及阳性和阴性预测值的置信区间

问题描述 投票:2回答:1

我正在撰写有关住院儿童帐单代码有效性的论文。我是R Studio的新手。我需要敏感性和特异性以及阳性和阴性预测值的置信区间,但是我不知道该怎么做。

我的数据有3列:ID,真实值,帐单值

这是我的代码:

confusionMatrix(table(finalcodedataset $ billing_value,finalcodedataset $ true_value),positive =“ 1”,boot = TRUE,boot_samples = 4669,alpha = 0.05)

这里是输出:

混淆矩阵和统计信息

   0    1

0 4477 162

1 10 20

           Accuracy : 0.9632          
             95% CI : (0.9574, 0.9684)
No Information Rate : 0.961           
P-Value [Acc > NIR] : 0.238           

              Kappa : 0.1796          

Mcnemar的检验P值:<2e-16

        Sensitivity : 0.109890        
        Specificity : 0.997771        
     Pos Pred Value : 0.666667        
     Neg Pred Value : 0.965079        
         Prevalence : 0.038981        
     Detection Rate : 0.004284        

检测患病率:0.006425平衡精度:0.553831

   'Positive' Class : 1   
r confidence-interval confusion-matrix css-specificity
1个回答
0
投票

欢迎您!您是否看过bdpv包装? https://rdrr.io/cran/bdpv/man/BDtest.html可以使用conf.level中的BDtest参数来计算敏感性,特异性,NPV和PPV的CI。

© www.soinside.com 2019 - 2024. All rights reserved.