Search code examples
rrocauc

Is my ROC curve different from null hypothesis?


I have drawn a ROC curve with pROC package :

library(pROC)
data(aSAH)
ROCA <- plot.roc(aSAH$outcome, aSAH$s100, percent=TRUE, col="BLUE")
ROCB <- lines.roc(aSAH$outcome, aSAH$ndka, percent=TRUE, col="RED")
legend("bottomright", legend=c("A", "B"), col=c("BLUE", "RED"), lwd=2)

I want to test if curve A is different from null hypothesis (grey line) but the only test I can find is comparing curve A and B.

comparecurves <- roc.test(ROCA, ROCB)
text(20, 40, labels=paste("p-value =", format.pval(comparecurves$p.value)))

This is what I get at the end: ROC

I have read this : ROC curve plot: 0.50 significant and cross-validation but it does not help me... Thanks for your help!


Solution

  • For the full area under the ROC curve, the difference to the null hypothesis is equivalent to the Mann-Whitney U statistic. In R you can easily get it with the wilcox.test function, for instance:

    wilcox.test(s100b ~ outcome, data = aSAH)