Updated 1 Sep 2021

ROC - Receiver Operating Characteristics.
The ROC graphs are a useful technique for organizing classifiers and visualizing their performance. ROC graphs are commonly used in medical decision making.
The input is a Nx2 matrix: in the first column you will put your test values (i.e. glucose blood level); in the second column you will put only 1 or 0 (i.e. 1 if the subject is diabetic; 0 if he/she is healthy).
Run rocdemo to see an example

The function computes and plots the classical ROC curve and curves for Sensitivity, Specificity and Efficiency (see the screenshot).

The function will show 6 cut-off points:
1) Max sensitivity
2) Max specificity
3) Cost effective (Sensitivity=Specificity)
4) Max Efficiency
5) Max PLR
6) Max NLR

ROC requires the Curve fitting toolbox.

Cite As

Giuseppe Cardillo (2024). ROC curve (https://github.com/dnafinder/roc), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

inputparser; table implementation, github link
change in Description

minor code improvements

bug fixed in output table

some little editing for verbose flag management

The curves Fitting was enhanced.
L5P is no more needed.

new plots and outputs

change in description.
Cut-off points and AUC confidence interval are now always computed to avoid nargout error

running roc without arguments, it will run a demo

I added the possibility to choose if you want to use all unique values or 3<=N<all unique values as tresholds

Previously I uploaded an old version of roc.m This is the last version

Bug fixing in Cut off grabbing

Trapz correction

another little bug correction to include the points (0,0) and (1,1)

ROC requires another function of mine: partest. If it is not present on the computer, ROC will download it from FEX

The function is deeper commented

Changes in description

bug fixing in area computation after adding the points (0,0) and (1,1) as previously suggested

I modified the files according to Jens Kaftan suggestion

correction in ROC performance bounds

advancedmcode link added in description section

In my previous submission I forgot to add the demo...

improved compatibility with URocomp

According to cabrego comment, in the function output the table of cutoff points, sensibility and specificity.

New plot output

bug correction

Changes to make it compatible with uroccomp function

Mistake correction in z test computation

if mean(healthy)>mean(unhealthy) the function mirrors the curve to obtain the correct ROC curve.

Input error handling added

Test on significance of AUC added

Changes in help section

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.