-2

Does anyone know of an R package (or any other statistical freeware or just a piece of code) that lets you plot a smooth ROC curve knowing only the means and variances of the control and case groups? That is, one that doesn't require a dataset with specific classifier values and test outcomes. I found a couple of online graph plotters that do just that: https://kennis-research.shinyapps.io/ROC-Curves/ , http://arogozhnikov.github.io/2015/10/05/roc-curve.html Any help appreciated

prishly
  • 11
  • 3

1 Answers1

2

I don't think you need any fancy package for this. You can just use simple probability functions in base R.

m1 <- 0
m2 <- 2
v1 <- 4
v2 <- 4

range <- seq(-10, 10, length.out=200)

d1<-pnorm(range, m1, sd=sqrt(v1))
d2<-pnorm(range, m2, sd=sqrt(v2))

tpr <- 1-d2
fpr <- 1-d1

plot(fpr, tpr, xlim=0:1, ylim=0:1, type="l")
abline(0,1, lty=2)

enter image description here

MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • Thank you. The reason why I asked about a specific package is that I was hoping I could use it (to generate an object) for further calculations, e.g. AUC and cutoff. I understand that these too can be calculated analytically with just the core functions. But a package could make it easier. In pROC you can build a rocobject and plot a smoothened ROC curve if you provide means and sd's but you still need a large enough dataset to begin with. Perhaps I should have made my question more clear. – prishly Jun 21 '17 at 08:41