ROC-curves

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ROC-curves

Oystein
I have stratified my data in four groups and are making Roc-curves for each group in SPSS. Is it somehow possible to get these four curves in one figure?
Reply | Threaded
Open this post in threaded view
|

Re: ROC-curves

Bruce Weaver
Administrator
Oystein wrote
I have stratified my data in four groups and are making Roc-curves for each group in SPSS. Is it somehow possible to get these four curves in one figure?
I have done something similar (i.e., ROC curves for different tests in the same plot) by using the following approach:

OMS
 /SELECT TABLES
 /IF COMMANDS = ['ROC Curve']
     SUBTYPES = ['Coordinates of the Curve']
 /DESTINATION FORMAT = SAV NUMBERED = group viewer = yes
  OUTFILE = { file name for coordinates of the curve }.

OMS
 /SELECT TABLES
 /IF COMMANDS = ['ROC Curve']
     SUBTYPES = ['Area Under the Curve']
 /DESTINATION FORMAT = SAV NUMBERED = group viewer = yes
  OUTFILE = { file name for AUC table } .

* Now run ROC for each group separately,
* e.g., via a series of filters, or SPLIT FILE by GROUP.

OMSEND.

* ---------------------------------------------- .
* Open the file of ROC data and generate the plot .
* ---------------------------------------------- .

get file = { file name for coordinates of the curve } .

var lab group "Group" .
val lab group
 1 'Group 1 label'
 2 'Group 2 label'
.
freq group.

formats @1Specificity Sensitivity (f8.2).

* Plot coordinates in a scatter-plot .
GRAPH
  /SCATTERPLOT(BIVAR)=@1Specificity WITH Sensitivity BY model
  /MISSING=LISTWISE
  /TITLE= 'ROC Curve'.


Then I used the chart editor to add interpolation lines and do some other formatting.  There is probably a way to add the interpolation lines via the GGRAPH version of a scatter-plot, but I didn't take the time to figure it out.

The reason for the other OMS command above is that I also wanted a table that summarized the AUC values for all of the curves in the plot.  

HTH.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).