# How to Create and Interpret a ROC Curve in SPSS

Logistic Regression is a statistical method that we use to fit a regression model when the response variable is binary. To assess how well a logistic regression model fits a dataset, we can look at the following two metrics:

• Sensitivity: The probability that the model predicts a positive outcome for an observation when indeed the outcome is positive.
• Specificity: The probability that the model predicts a negative outcome for an observation when indeed the outcome is negative.

One easy way to visualize these two metrics is by creating a ROC curve, which is a plot that displays the sensitivity and specificity of a logistic regression model.

This tutorial explains how to create and interpret a ROC curve in SPSS.

### Example: ROC Curve in SPSS

Suppose we have the following dataset that shows whether or not a basketball player got drafted into the NBA (0 = no, 1 = yes) along with their average points per game in college:

To create an ROC curve for this dataset, click the Analyze tab, then Classify, then ROC Curve:

In the new window that pops up, drag the variable draft into the box labelled State Variable. Define the Value of the State Variable to be 1. (This is the value that indicates a player got drafted). Drag the variable points into the box labelled Test Variable.

Check the boxes next to With diagonal reference line and Coordinate points of the ROC Curve. Then click OK.

Here is how to interpret the output:

Case Processing Summary:

This table displays the total number of positive and negative cases in the dataset. In this example 8 players got drafted (positive result) and 6 players did not get drafted (negative result):

ROC Curve:

The ROC (Receiver Operating Characteristic) curve is a plot of the values of sensitivity vs. 1-specificity as the value of the cut-off point moves from 0 to 1:

A model with high sensitivity and high specificity will have a ROC curve that hugs the top left corner of the plot. A model with low sensitivity and low specificity will have a curve that is close to the 45-degree diagonal line.

We can see that the ROC curve (the blue line) in this example hugs the top left corner of the plot, which indicates that the model does a good job of predicting whether or not players will get drafted, based on their average points per game.

Area Under the Curve:

The Area Under the Curve gives us an idea of how well the model is able to distinguish between positive and negative outcomes. The AUC can range from 0 to 1. The higher the AUC, the better the model is at correctly classifying outcomes.

We can see that the AUC for this particular logistic regression model is .948, which is extremely high. This indicates that the model does a good job of predicting whether or not a player will get drafted.

Coordinates of the Curve:

This last table displays the sensitivity and 1 – specificity of the ROC curve for various cut-off points.

For example:

If we allow the cut-off point to be 8.50, this means we predict that any player who scores less than 8.50 points per game to not get drafted, and any player who scores greater than 8.50 points per game to get drafted.

Using this as a cut off point, our sensitivity would be 100% (since each player that scored less than 8.50 points per game indeed did not get drafted) and our 1 – specificity would be 66.7% (since 8 out of 12 players who scored more than 8.50 points per game actually did get drafted).

The table above allows us to see the sensitivity and 1-specificity for every potential cut-off point.

## 11 Replies to “How to Create and Interpret a ROC Curve in SPSS”

1. PJ says:

Great job explaining by use of a simple illustration!
Reading once was enough to fully understand the entire text 🙂

2. Fin says:

Thank you so much!!! It is very descriptive.

3. Harshan says:

what does Diagonal segments are produced by ties mean?

4. Ahmed-Rufai Yahaya says:

Fantastic and clear explanation

5. DR HEMEDI says:

nice tips

6. Nikhil says:

What if the state variable have three or more classes for the outcome or “draft” ?

eg: class 1 -vehicle is ok
class 2- vehicle needs repair
class 3- vehicle to be scrapped

7. Happy says:

Hello,
Why did you choose 8.5 as cut-off and not 10.5, since that was the point after which sensitivity went below 1.00?
What is to be considered in choosing the cut-offs looking at the Coordinates of the Curve Table?

Thanks.

8. Matthew Crawley says:

Thanks for this great article! Do you know if there is a way to change the cut-off scores which are automatically generated? For example, I have just created a ROC curve and in the coordinates table, the cut-offs are all decimals (2.5, 3.5, 4.5 etc). Is it possible to change this table so that the cut-offs for whole numbers are shown (2, 3, 4, 5 etc)?

9. SULEIMAN Ibrahim says:

Good morning.
Thank you very much for this educative write up.
Sir, I am trying to plot a ROC curve for AFP performance in HCV, but only diagonal line shown. ROC curve did not show (i. e. That blue line

10. Joseph Nnodim says:

Excellent and concise explanation of how to create and interpret ROC curves. Well done!

1. James Carmichael says:

Hi Joseph…Thank you for feedback!