我需要为我的数据集计算以下内容。我可以计算个人PPV(95%CI)和NPV(95%CI),但对如何计算这个问题感到困惑:
PPV + NPV-1(95%CI)我该如何计算?
答案 0 :(得分:0)
This page on SAS support提供如下代码:
title 'Sensitivity';
proc freq data=FatComp;
where Response=1;
weight Count;
tables Test / binomial(level="1");
exact binomial;
run;
title 'Specificity';
proc freq data=FatComp;
where Response=0;
weight Count;
tables Test / binomial(level="0");
exact binomial;
run;
title 'Positive predictive value';
proc freq data=FatComp;
where Test=1;
weight Count;
tables Response / binomial(level="1");
exact binomial;
run;
title 'Negative predictive value';
proc freq data=FatComp;
where Test=0;
weight Count;
tables Response / binomial(level="0");
exact binomial;
run;
答案 1 :(得分:0)
我怀疑这是否有用。通常,您应该提供敏感性,特异性,阳性和阴性预测值。如果您想整体衡量准确性,则应该选择正确分类的科目。
如果您进入由彼得·弗洛姆(Peter Flom)建议的webpage,则可以滚动直到获得一段完整的代码。可以通过创建一个二进制变量来计算准确性,该变量指示每个观察结果中的测试和响应是否一致。 :
let from = "23/09/2019";
let to = "29/10/2019";
// convert to date object by interchanging date/month expected by Date function
let fromDate = new Date(from.replace(/([0-9]+)\/([0-9]+)/,'$2/$1'));
let toDate = new Date(to.replace(/([0-9]+)\/([0-9]+)/,'$2/$1'));
let response = [];
while(toDate > fromDate){
response.push({day: fromDate.getDate(), month: fromDate.getMonth()+1, year: fromDate.getFullYear()});
fromDate.setDate(fromDate.getDate()+1) // increment date by 1
}
console.log(response)
希望有帮助