brian-lau / matlabauc Goto Github PK
View Code? Open in Web Editor NEWMatlab code for the area under the receiver operating curve (AUC) and confidence intervals
License: GNU General Public License v3.0
Matlab code for the area under the receiver operating curve (AUC) and confidence intervals
License: GNU General Public License v3.0
Hi Brian,
Thanks for your code. It works nicely, though I have the feeling that the ROC curve is not calculated correctly when there are ties. The following example should demonstrate that.
[xx,yy]=roc([-1 1; 1 2; -1 3; -1 4; 1 5; -1 6; 1 7; -1 8; 1 9; 1 10; 1 11; -1 13; 1 13; 1 14; 1 14])
yields:
0
0.1111
0.2222
0.4444
0.5556
0.6667
0.6667
0.7778
0.7778
0.8889
0.8889
0.8889
1.0000
1.0000
1.0000
yy =
0
0
0.1667
0.1667
0.1667
0.1667
0.3333
0.3333
0.5000
0.5000
0.6667
0.8333
0.8333
1.0000
1.0000
Manually doing this exercise, it's easy to show that the first non-zero value should be 0.2222 not 0.1111 (2 out of 9 signals are seen when no non-signals are detected yet). This is what SPSS (which is well aware of ties) yields as well:
Coordinates of the Curve
Test Result Variable(s): VAR00008
Positive if Greater Than or Equal Toa Sensitivity 1 - Specificity
.0000 1.000 1.000
1.5000 1.000 .833
2.5000 .889 .833
3.5000 .889 .667
4.5000 .889 .500
5.5000 .778 .500
6.5000 .778 .333
7.5000 .667 .333
8.5000 .667 .167
9.5000 .556 .167
10.5000 .444 .167
12.0000 .333 .167
13.5000 .222 .000
15.0000 .000 .000
The test result variable(s): VAR00008 has at least one tie between the positive actual state group and the negative actual state group.
a The smallest cutoff value is the minimum observed test value minus 1, and the largest cutoff value is the maximum observed test value plus 1. All the other cutoff values are the averages of two consecutive ordered observed test values.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.