pROC 1.5 released

pROC's steady progression goes on with version 1.5. It is avalable for R only. S+ users will need to wait for the upcoming 1.6 release which will introduce power / sample size computations.

This version introduces four new notable features:

Variance and covariance

It is now possible to compute the variance of a ROC curve, and the covariance of two paired ROC curves.

library(pROC)
data(aSAH)
rocobj <- roc(aSAH$outcome, aSAH$s100b)

var(roc1)
var(roc2)
cov(roc1, roc2)

Two methods are available: bootstrap, DeLong1. The bootstrap is the most versatile method. DeLong is faster but works for full AUC only. For more details, see ?var.roc and ?cov.roc.

Univariate Log-Concave Density Estimation smoothing

Until now, three methods were available to smooth a ROC curve: binormal, density and fitdistr (to fit a distribution with MASS). Now, two new methods are available: logcondens and logcondens.smooth. They are based on Duembgen and Rufibach (2011)2. You first need to install the logcondens package:

install.packages("logcondens")

It doesn't need to be loaded.

plot(rocobj)
rs <- smooth(rocobj, method="binormal")
plot(rs, add=TRUE, col="green")
rs2 <- smooth(rocobj, method="density")
plot(rs2, add=TRUE, col="blue")
rs3 <- smooth(rocobj, method="fitdistr", density="lognormal")
plot(rs3, add=TRUE, col="magenta")
rs4 <- smooth(rocobj, method="logcondens")
plot(rs4, add=TRUE, col="brown")
rs5 <- smooth(rocobj, method="logcondens.smooth")
plot(rs5, add=TRUE, col="orange")
legend("bottomright", legend=c("Empirical", "Binormal", "Density", "Log-normal",
                               "Log-concave density", "Smoothed log-concave density"),
       col=c("black", "green", "blue", "magenta", "brown", "orange"), lwd=2)

Improvements to the plotting function

Several users have been bothered by the fact than in pROC (R version), the sensitivity is plotted as decreasing specificity. Most other software plot increasing 1 – specificity on the X axis. The reason is purely historical: only few statistical software can plot an axis in decreasing direction. For instance S+ cannot do it, and pROC's ROC curve are plotted as 1 – specificity there. However it makes absolutely no difference on the ROC curve itself. As it was possible, I decided plot the modern version on R rather than stick to obsolete conventions.

For those who are disturbed and prefer to stick to obsolete conventions, pROC 1.5 comes with a way to plot increasing 1 – specificity in the R version with the legacy.axes argument.

plot(rocobj, legacy.axes=TRUE)

Note that it makes no difference to the coordinates of the plot, and if you want to add some text you still have to think in the "new" way. Consequently, the following will always be plotted to the top left corner of the curve, whatever legacy.axes you specified:

text(1, 1, auc(rocobj), adj=c(0, 1))

New return values in coords

The retargument of the coords function now accepts several new values:

In addition, sensitivity, specificity, npv and ppv can be prefixed with 1- in order to get the opposite value. Finally two additional values are recognized:

Here is an example. We take the best threshold of the ROC curve rocobj and display all the parameters of this threshold:

coords(rocobj, "best", ret=c("threshold", "specificity", "sensitivity", "accuracy", "tn", "tp", "fn", "fp", "npv", "ppv", "1-specificity", "1-sensitivity", "1-npv", "1-ppv"))

Coords also accepts a new argument: drop to control the dimension of the return value. If drop is FALSE, a matrix will always be returned, even if it contains only one column. This is especially useful to make scripts more reliable.

Conclusion

Here is the full change log:

As usual, you can find the new version on ExPASy and on the CRAN. To update, type update.packages() or install.packages("pROC") if you want to update pROC only.

Xavier Robin
Publié le lundi 12 décembre 2011 à 09:27 CET
Lien permanent : /blog/2011/12/12/proc-1.5-released
Tags : pROC
Commentaires : 6

Switch to English

Chercher

Tags

Bruit de fond Hobbys Humour Informatique Internet Livres Logiciels Moi Mon site web Mozilla Photo Politique Programmation Scolaire Ubuntu pROC

Billets récents

Calendrier

lun.mar.mer.jeu.ven.sam.dim.
1234
567891011
12131415161718
19202122232425
262728293031

Syndication

Recommender