# Calculate ROC curve for data

So, I have 16 trials in which I am trying to authenticate a person from a biometric trait using Hamming Distance. My threshold is set to 3.5. My data is below and only trial 1 is a True Positive:

Trial   Hamming Distance
1   0.34
2   0.37
3   0.34
4   0.29
5   0.55
6   0.47
7   0.47
8   0.32
9   0.39
10  0.45
11  0.42
12  0.37
13  0.66
14  0.39
15  0.44
16  0.39


My point of confusion is that I am really unsure about how to make an ROC curve (FPR vs. TPR OR FAR vs. FRR) from this data. It doesn't really matter which one, but I'm just really confused about how to go about calculating it. Any help would be appreciated.

I suggest ROC Graphs: Notes and Practical Considerations for Reasearchers by Tom Fawcett, really an excellent read. As far as I understand your question, you will find everything you need in this paper.

Edit: Inspired by Adam I also want to recommend my favorite R-package for this task: ROCR.

• Do you know any good Matlab packages that can get the job done? – rohanbk Dec 4 '10 at 20:01
• @rohanbk Sorry, no. It is a long time since I have used matlab. – steffen Dec 6 '10 at 7:42
• @steffen link is broken. – Alleo Dec 2 '15 at 0:10
• @Alleo thank you for the notification, the link is now pointing to citeseer (where pdf is available)... this should last longer. – steffen Dec 3 '15 at 16:49

Why do you want to make an ROC curve? Do you want to graph the curve for your dependent variables, or are you looking to use it as a test statistic in order to gauge the accuracy of your probability predictions (in which case you're looking for the AUC [area under the curve]).

If you're familiar with R, the verification package in R has two functions that you will find useful: roc.plot(), which will allow you to plot your ROC curve, and roc.area() which will allow you to calculate the AUC.

• Do you know any good Matlab packages that can get the job done? – rohanbk Dec 4 '10 at 20:00