Citation
If you use pROC in published research, please cite the following paper:
Xavier Robin, Natacha Turck, Alexandre Hainard, Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez and Markus Müller (2011). pROC: an open-source package for R and S+ to analyze and compare ROC curves. BMC Bioinformatics, 12, p. 77. DOI: 10.1186/1471-2105-12-77.
News
Authors
Xavier Robin, Natacha Turck, Alexandre Hainard, Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez and Markus Müller
Contributors
Stefan Siegert, Matthias Doering, Zane Billings
Report a bug
License
Finding help
- Frequently asked questions
- Check the manual, or type
?pROC
on the R prompt. - If you still have questions, ask a question on Stack Overflow tagged with
proc-r-package
.
Installation
There is no need to download the package. The installation can be done in one command directly from R:
install.packages("pROC")
The package must then be loaded with:
library(pROC)
To get help, enter the following in the R prompt:
?pROC
Update
You can update pROC by installing it again:
install.packages("pROC")
Or updates all your packages:
update.packages()
Version history
1.19.0.1 (2025-07-31)
- Move
fun.sesp
definition to work around LudvigOlsen/cvms#44.
1.19.0 (2025-07-30)
ci.coords
can now take the sameinput
values ascoords
(issue #90)ci.coords
can beplot
ted- Added "lr_pos" and "lr_neg" to
coords
(issue #102) coords
with partial.auc now interpolates bounds when needed- Added
ignore.partial.auc
argument tocoords
- Deprecated
transpose
,as.list
,as.matrix
anddrop
incoords
- Deprecated the
algorithm
argument toroc
andfun.sesp
value - Deprecated the
progress
andparallel
argument for bootstrap operations. - Removed dependencies on doParallel and retired package plyr (thanks to Michael Chirico, pr #134, #135, #136, #137, #138, #139 and #140).
1.18.5 (2023-07-04)
- Fixed formula input when given as variable and combined with
with
(issue #111) - Fixed formula containing variables with spaces (issue #120)
- Fixed broken grouping when
colour
argument was given inggroc
(issue #121)
1.18.4 (2023-07-04)
- Fix broken
legacy.axes
inggroc
1.18.3 (2023-07-02)
1.18.2 (2023-05-13)
- Fix CRAN submission NOTE (issue #112)
1.18.1 (2023-05-07)
- Fix
print
ing some curves built from a formula (issue #101) - Fix tests following upstream updates in density()
- Improvements in documentation
1.18.0 (2021-09-02)
1.17.0.1 (2021-01-07)
- Fix CRAN incoming checks as requested by CRAN
1.17.0 (2020-12-29)
- Accept more values in
input
of coords (issue #67) - Accept
kappa
for thepower.roc.test
of two ROC curves (issue #82) - The
input
argument tocoords
forsmooth.roc
curves no longer has a default - The
x
argument tocoords
forsmooth.roc
can now be set toall
(also the default) - Fix bootstrap roc.test and cov with
smooth.roc
curves - The
ggroc
function can now plotsmooth.roc
curves (issue #86) - Remove warnings with
warnPartialMatchDollar
option (issue #87) - Make tests depending on vdiffr conditional (issue #88)
1.16.2 (2020-03-19)
- Skip test depending on Rcpp version
1.16.1 (2020-01-13)
- Skip timing-dependent test failing occasionally on CRAN
1.16.0 (2020-01-12)
- BACKWARD INCOMPATIBLE CHANGE:
transpose
argument tocoords
switched to FALSE by default (issue #54) - BACKWARD INCOMPATIBLE CHANGE:
ci.coords
return value is now of list type and easier to use - Fix one-sided DeLong test for curves with
direction=">"
(issue #64) - Fix an error in
ci.coords
due to expected NA values in some coords (like "precision") (issue #65) - Ordrered predictors are converted to numeric in a more robust way (issue #63)
- Cleaned up
power.roc.test
code (issue #50) - Fix pairing with
roc.formula
and warn ifna.action
is not set to "na.pass" or "na.fail" (issue #68) - Fix
ci.coords
not working withsmooth.roc
curves
1.15.3 (2019-07-21)
- Fix: previous version accidentally set transpose = FALSE, should only be for next major release
1.15.2 (2019-07-20)
- Fix -Inf threshold in coords for curves with
direction = ">"
(issue #60) - Restore lazy loading of the data and fix an
R CMD check
warning "Variables with usage in documentation objectaSAH
not in code"
1.15.1 (2019-07-17)
1.15.0 (2019-06-01)
roc
now prints messages when autodetectinglevels
anddirection
by default. Turn off withquiet = TRUE
or set these values explicitly- Speedup with
algorithm = 2
(issue #44) and incoords
(issue #52) - New
algorithm = 6
(used by default) usesalgorithm = 2
for numeric data, andalgorithm = 3
for ordered vectors - New
roc.data.frame
method androc_
function for use in pipelines coords
can now returnsyouden
andclosest.topleft
values (issue #48)- New
transpose
argument forcoords
, TRUE by default (issue #54) - Use text instead of Tcl/Tk progress bar by default (issue #51)
- Fix
method = "density"
smoothing when called directly fromroc
(issue #49) - Renamed
roc
argumentn
tosmooth.n
- Fixed
are.paired
ignoring smoothing arguments ofroc2
withreturn.paired.rocs
- New
ret
option "all" incoords
(issue #47) drop
incoords
now drops the dimension ofret
too (#issue 43)
1.14.0 (2019-03-12)
- The
multiclass.roc
function now accepts multivariate decision values (code contributed by Matthias Döring) ggroc
supports multiple aesthetics (issue #42)- Make
ggplot2
dependency optional - CSuggested packages can be installed interactively when required
- Passing both
cases
andcontrols
orresponse
andpredictor
arguments is now an error - Many small bug fixes
1.13.0 (2018-09-23)
roc
now returnsNaN
when predictor contains infinite values (issue #30)- Better handling of near-ties near +-Infinity and 0
ggroc
supports aes="group" to allow curves with identical aesthetics
1.12.1 (2018-05-06)
- Fix a regression causing the allocation of a very large vector (issue #29)
1.12.0 (2018-05-05)
- Fix bug that crashed DeLong calculations when predictor had near-ties close to the floating point precision limit that were rounded back to a predictor value (issue #25)
- Fix bug that crashed
ci.auc
andvar
ifdirection
was ">" andpercent=TRUE
(issue #25) - Fix bug causing
ci
to returnNaN
values withmethod="delong"
when cases or controls had a single observation (issue #27) - Fix
power.roc.curve
failed with curves havingpercent=TRUE
- Fix
ci(..., of="coords")
returned theci
function instead of the CI - C++ code now check for user interrupts regularly with Rcpp::checkUserInterrupt()
- Better error message for
ci.coords
attempting to returnthreshold
- New algorithm = 5 (used by default) chooses the algorithm based on the number of thresholds to avoid worst case with algorithm = 3
1.11.0 (2018-03-24)
- Added argument
legacy.axes
toggroc
- Fix NOTE about
apparent S3 methods exported but not registered
inR CMD check
1.10.0 (2017-06-10)
- Basic ggplot2 support (one and multiple ROC curves)
- Implement
precision
andrecall
forcoords
- Fix: properly handle NAs in cases when passing cases/controls to
roc
(thanks Thomas König for the report) - Fix various minor bugs detected with new unit tests
1.9.1 (2017-02-05)
- Fix:
subset
andna.action
arguments now handled properly inroc.formula
(thanks Terry Therneau for the report) - Added policies to handle the case where a ROC curve has multiple "best" threshold in
ci
(thanks Nicola Toschi for the report) - Support
xlim
andylim
gracefully inplot.roc
- Improved validation of input class
levels
anddirection
; messages when auto-detecting, usequiet
to turn on - Removed extraneous
name
attribute on thep.value
(thanks Paweł Kleka for the report) - Faster DeLong algorithm (code contributed by Stefan Siegert)
1.8 (2015-05-04)
- NAMESPACE now properly exports the methods as S3 methods.
- Now uses and works with
requireNamespace
- Add ability to supply two ordered factors with identical levels as control / cases
- Deprecate dangerous use of a matrix as response / predictor with a warning
- Forward
best.method
andbest.weights
arguments tocoords
inci.thresholds
- Fix CITATION file as per CRAN request
- pAUC correction is undefined for partial AUC below the diagonal (result < 0.5) and now returns NA (with a warning). Thanks Vincenzo Lagani for the report.
1.7.3 (2014-06-14)
- Fixed AUC of binomial-smoothed ROC off by 100^2 (thanks Bao-Li Chang for the report)
- Fix print of logcondens-smoothed ROC
1.7.2 (2014-04-05)
- Fixed bug where
ci.coords
withx="best"
would fail if one or more resampled ROC curve had multiple "best" thresholds (thanks Berend Terluin for the report) - Fixed bug in
ci.coords
: passing more than one value inx
now works - Fixed typo in documentation of
direction
argument toroc
(thanks Le Kang for the report) - Add a warning when computing statistics of ROC curve with AUC = 1
- Require latest version of Rcpp to avoid weird errors (thanks Tom Liptrot for the report)
1.7.1 (2014-02-20)
- Close SOCK cluster on Windows with parallel=TRUE
- Fixed really use algorithm 1 when microbenchmark fails
1.7 (2014-02-19)
- Faster algorithm for DeLong
roc.test
,power.roc.test
,ci.auc
,var
andcov
function (no large matrix allocation) - Handling Math and Operations correctly on
auc
andci
objects (see?groupGeneric.pROC
) - The
formula
forroc.formula
can now provide several predictors and a list of ROC curves will be returned - Fixed documentation of
ci.coords
with examples - Fixed binormal AUC computed with triangulation despite the claim in the documentation
- Fixed unstated requirement on Rcpp >= 0.10.5
1.6.0.1 (2013-12-28)
- Removed erroneous error message displayed when predictors and responses were not vectors.
1.6 (2013-12-26)
- New
power.roc.test
function for sample size and power computations. - New
cov
andvar
functions supports new"obuchowski"
method. - New
ci.coords
function to compute CI of arbitrary coords. coords
accepts newret
value "1-accuracy".- Introducing various algorithms to compute sensitivities and specificites, with a more vectorized code or Rcpp. See
algorithm
in?roc
for more details on the trade-offs of the different methods. - Faster algorithm for DeLong
roc.test
,ci
,var
andcov
function (thanks Kazuki Yoshida). are.paired
now also checks for identicallevels
.- Fixed a warning generated in the examples.
- Fixed several bugs related with
smooth.roc
curves. - Additional input data sanity checks.
- Now requires R ≥ 2.13 (in fact, since 1.5.1, thanks Emmanuel Curis for the report).
- Progress bars now defaults to text on Macs where
tcltk
seems broken (thanks Gerard Smits for the report).
1.5.4 (2012-08-31)
- Running less smooth.roc examples with logcondens because they take too much time (requested by Uwe Ligges).
1.5.3 (2011-08-31)
- AUC specification was lost when
roc.test
,cov
orvar
was passed anauc
object. - Correct computation of "accuracy" in
coords
(thanks to Kosuke Yoshihara for the report).
1.5.1 (2011-03-09)
- Faster loading of the package (thanks to Prof Brian Ripley and Glenn Lawyer for the report).
1.5 (2011-12-12)
- New
cov
andvar
functions. coords
accepts newret
values: "accuracy", "tn", "tp", "fn", "fp", "npv", "ppv", "1-specificity", "1-sensitivity", "1-npv", "1-ppv", "npe" and "ppe".- New
legacy.axes
argument toplot
1-specificity rather than specificity. - New
axes
argument to turn off the plotting of the axis. - New
logcondens
andlogcondens.smooth
(Univariate Log-Concave Density Estimation) smoothing methods. - New function
has.partial.auc
to determine if an AUC is full or partial. - New argument
drop
forcoords
. auc
andmulticlass.auc
objects now also have secondary classnumeric
.- Updated load call.
- Delong's CI reversed in ROC curves with
direction=">"
. - Delong's CI AUC returned values > 1 or < 0 in some rare cases.
- Minor improvements in documentation.
1.4.9 (2014-01-04)
- This is the last version of pROC for S+. It introduces some features of pROC 1.5 (covariance and variance functions, some bugfixes) and 1.6 (power tests) for R into S+, and will not be maintained any more.
- Fixed custom output report.
- New
power.roc.test
function for sample size and power computations. - New
cov
andvar
functions. auc
objects now also have secondary classnumeric
.- Delong's CI reversed in ROC curves with
direction=">"
- Delong's CI AUC returned values > 1 or < 0 in some rare cases
- Delong's CI AUC returned NA values when AUC was 1. Now reporting 1-1 interval.
- Minor improvements in documentation.
1.4.4 (2011-08-10)
- Fixed alternative for one-tailed tests.
- Removed COPYING file to fix a warning in r-devel.
1.4.3 (2011-03-18)
- Updated citation.
1.4.2 (2011-03-03)
- Fixed bootstrap
roc.test
generating NAs whensmooth.roc
s were used withreuse.auc=FALSE
(thanks to Buddy for the report). - Documented a warning that was missing in
roc.test
. - Updated citation.
1.4.1 (2011-01-27)
- Venkatraman's test for unpaired ROC curves.
1.4 (2011-01-21)
- 'smooth' does not apply on
ordered
factors anymore. - Multi-class AUC support (R only).
- Can choose how
best
thresold is determined (best.method
andbest.weights
incoords
andprint.thres.best.method
andprint.thres.best.weights
inplot.roc
). - Minor fixes in documentation (R and S+) and
citation
(S+ only). print
now prints the response instead of response and more informative data inhtest
s.- Bootstrap with
ci.auc
consumes much less memory. - Unpaired bootstrap and DeLong's test.
- Specificity and sensitivity tests (in
roc.test
).
1.3.2 (2010-08-24)
print.auc
printed incorrect CI inplot.roc
(thanks to Alexander B. Leichtle for the report).- Failed to detect local maximas in
coords
when 2 or less points were selected. - Don't consider ROC extremities (+-Inf at 1.0/0.0 SE<->SP) as local maximas.
1.3.1 (2010-08-18)
- Sensitivity and specificity were inverted in coords when results were reported as list.
- Faster checks with
\dontrun{}
inroc.test
.
1.3 (2010-08-13)
- CI is not re-computed by default in
smooth.roc
. You can still turn it on withreuse.ci=TRUE
. - New function
are.paired
. - Local maximas could be incorrectly detected in
coords
(andplot.roc
) withpredictor
s containing more than 2 levels. - New method
venkatraman
forroc.test
. - MASS and tcltk packages are now only suggested instead of required (R only).
...
not passed correctly inplot.ci.se
withtype="bars"
resulting in an error (R only).
1.2.1 (2010-05-11)
- Handle
method
arguments forsmooth.roc
andci.auc
separately inroc.default
(R-only). - Added
auc.polygon.*
andmax.auc.polygon.*
arguments forpolygon
inplot.roc
.
1.2 (2010-05-09)
- Added DeLong method in
ci.auc
(with a GUI, S+ only). - Return value of ci.auc does not contain an
"aucs"
item anymore. - Put most examples with bootstrap within
\dontrun{}
blocks for faster (but less useful) checks execution.
1.1 (2010-05-05)
- Added
lines.roc
functions for ROC. - Added
type
argument for bothlines.roc
andplot.roc
. - Added
print.auc.col
argument toplot.roc
. - Fixed a warning in
roc.test.default
when the class ofpredictor1
had several elements. - Fixed an encoding failure during the checks on MacOS X (R only).
1.0.1 (2010-04-28)
- Reduced examples execution time. Added low
boot.n
in the slowest examples andreuse.auc
andreuse.ci
arguments insmooth.roc.roc
.
1.0 (2010-04-27)
- First public release.
References
- James Carpenter and John Bithell (2000) "Bootstrap condence intervals: when, which, what? A practical guide for medical statisticians". Statistics in Medicine 19, 1141–1164. DOI: 10.1002/(SICI)1097-0258(20000515)19:9<1141::AID-SIM479>3.0.CO;2-F; PMID: 10797513.
- Elisabeth R. DeLong, David M. DeLong and Daniel L. Clarke-Pearson (1988) "Comparing the areas under two or more correlated receiver operating characteristic curves: a nonparametric approach". Biometrics 44, 837–845. JSTOR: 2531595; PMID: 3203132.
- Lutz Duembgen, Kaspar Rufibach (2011) "logcondens: Computations Related to Univariate Log-Concave Density Estimation". Journal of Statistical Software, 39, 1–28. URL: jstatsoft.org/v39/i06.
- Tom Fawcett (2006) "An introduction to ROC analysis". Pattern Recognition Letters 27, 861–874. DOI: j.patrec.2005.10.010.
- James E. Hanley (1988) "The robustness of the "binormal" assumptions used in fitting ROC curves". Medical Decision Making 8, 197–203. DOI: 10.1177/0272989X8800800308; PMID: 3398748.
- Donna Katzman McClish (1989) "Analyzing a Portion of the ROC Curve". Medical Decision Making 9, 190–195. DOI: 10.1177/0272989X8900900307; PMID: 2668680.
- Nancy A. Obuchowski and Donna K. McClish (1997) "Sample size determination for diagnostic accurary studies involving binormal ROC curve indices". Statistics in Medicine, 16, 1529–1542. DOI: 10.1002/(SICI)1097-0258(19970715)16:13<1529::AID-SIM565>3.0.CO;2-H.
- Nancy A. Obuchowski, Micharl L. Lieber and Frank H. Wians Jr. (2004) "ROC Curves in Clinical Chemistry: Uses, Misuses, and Possible Solutions". Clinical Chemistry, 50, 1118–1125. DOI: 10.1373/clinchem.2004.031823.
- Margaret Pepe, Gary Longton and Holly Janes (2009) "Estimation and Comparison of Receiver Operating Characteristic Curves". The Stata journal 9, 1. PMID: 20161343.
- Xavier Robin, Natacha Turck et al. (2011) "pROC: an open-source package for R and S+ to analyze and compare ROC curves". BMC Bioinformatics, 12, 77. DOI: 10.1186/1471-2105-12-77.
- E. S. Venkatraman and Colin B. Begg (1996) "A distribution-free procedure for comparing receiver operating characteristic curves from a paired experiment". Biometrika 83, 835–848. DOI: 10.1093/biomet/83.4.835
- E. S. Venkatraman (2000) "A Permutation Test to Compare Receiver Operating Characteristic Curves". Biometrics 56, 1134–1138. DOI: 10.1111/j.0006-341X.2000.01134.x.
- Kelly H. Zou, W. J. Hall and David E. Shapiro (1997) "Smooth non-parametric receiver operating characteristic (ROC) curves for continuous diagnostic tests". Statistics in Medicine 18, 2143–2156. DOI: 10.1002/(SICI)1097-0258(19971015)16:19<2143::AID-SIM655>3.0.CO;2-3; PMID: 9330425 .