ROCnReg: An R Package for Receiver Operating Characteristic Curve Inference with and without Covariates

Maria Xose Rodriguez-Alvarez, Vanda Inacio de Carvalho

Research output: Contribution to journalArticlepeer-review


The receiver operating characteristic (ROC) curve is the most popular tool used to evaluate the discriminatory capability of diagnostic tests/biomarkers measured on a continuous scale when distinguishing between two alternative disease states (e.g, diseased and nondiseased). In some circumstances, the test's performance and its discriminatory ability may vary according to subject-specific characteristics or different test settings. In such cases, information-specific accuracy measures, such as the covariate-specific and the covariate-adjusted ROC curve are needed, as ignoring covariate information may lead to biased or erroneous results. This paper introduces the R package ROCnReg that allows estimating the pooled (unadjusted) ROC curve, the covariate-specific ROC curve, and the covariate-adjusted ROC curve by different methods, both from (semi) parametric and nonparametric perspectives and within Bayesian and frequentist paradigms. From the estimated ROC curve (pooled, covariate-specific or covariate-adjusted), several summary measures of accuracy, such as the (partial) area under the ROC curve and the Youden index, can be obtained. The package also provides functions to obtain ROC-based optimal threshold values using several criteria, namely, the Youden Index criterion and the criterion that sets a target value for the false positive fraction. For the Bayesian methods, we provide tools for assessing model fit via posterior predictive checks, while model choice can be carried out via several information criteria. Numerical and graphical outputs are provided for all methods. The package is illustrated through the analyses of data from an endocrine study where the aim is to assess the capability of the body mass index to detect the presence or absence of cardiovascular disease risk factors. The package is available from CRAN at this https URL.
Original languageEnglish
Number of pages31
JournalThe R Journal
Publication statusAccepted/In press - 17 Jun 2021


Dive into the research topics of 'ROCnReg: An R Package for Receiver Operating Characteristic Curve Inference with and without Covariates'. Together they form a unique fingerprint.

Cite this