値を見て、2値判断をする

  • 検査値が連続的
  • それを見て、陽性・陰性に判定を分けたい
  • 感度・特異度
  • PPV・NPV
  • 陽性・陰性の2値に分けてしまうと、「どっちつかず」の部分の情報がもったいない
  • 陽性確率p、陰性確率1-pのように出てくると、ある意味、便利
  • Rでは、ROCRパッケージなど(こちらの記事も参考)
  • こちらの続きでもある
## computing a simple ROC curve (x-axis: fpr, y-axis: tpr)
library(ROCR)
data(ROCR.simple)
pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels)
perf <- performance(pred,"tpr","fpr")
plot(perf)

## precision/recall curve (x-axis: recall, y-axis: precision)
perf1 <- performance(pred, "prec", "rec")
plot(perf1)

## sensitivity/specificity curve (x-axis: specificity,
## y-axis: sensitivity)
perf1 <- performance(pred, "sens", "spec")
plot(perf1)