SPSS command: SPSS ROC
ROC curves and AUC in your browser
A ROC curve shows how well a score separates positive from negative cases by plotting sensitivity against 1 − specificity at every possible cutoff.
Free · No account · Files stay on your device · Updated 18 October 2026
What it tells you
Crosstabs runs the SPSS ROC procedure on your device for up to four test variables, with the area under the curve, its nonparametric or bi-negative exponential standard error, a test against AUC = .5 and a full table of cutoffs.
- The area under the curve: the probability that a random positive case scores higher than a random negative one.
- Whether the test discriminates better than chance, with an asymptotic p value and confidence interval for the area.
- Sensitivity, 1 − specificity and precision at every cutoff, so you can pick an operating point.
- The Gini index (2·AUC − 1) and the Kolmogorov-Smirnov statistic, the largest gap between sensitivity and 1 − specificity.
When to use it
Use it when
- Evaluating a diagnostic test, risk score or model probability against a known binary outcome.
- Choosing a cutoff that balances missed positives against false alarms.
- Comparing the discrimination of up to four scores side by side on the same cases.
Use something else when
- You need a significance test of the difference between two AUCs: use ROC Analysis, which runs the DeLong or independent-groups comparison.
- You care about calibration (are predicted probabilities correct?), not ranking: AUC ignores calibration; check a Hosmer-Lemeshow test in logistic regression.
- Positives are very rare and false positives are costly: also look at the precision column, since AUC can look good while precision is poor.
How to run it in Crosstabs
- 01
Open your data
Open a file with one row per case containing the score(s) and the true state, and switch to Statistics mode.
- 02
Choose ROC Curve
In the Agreement and diagnostics group, pick ROC Curve (ROC).
- 03
Choose test and state variables
Tick up to four numeric Test variables, choose the State variable and its Value of state variable (positive).
- 04
Set direction and confidence
Under Test direction, say whether a larger or smaller test result indicates a more positive test, and set the Confidence level (%).
- 05
Pick the standard error and run
Set Standard error of the area to Nonparametric or Bi-negative exponential (the latter needs equal numbers of positives and negatives, otherwise the nonparametric one is shown), declare any weight as a frequency weight, and press Run.
Worked example
Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.
Data
100 synthetic patients, 40 with the disease (state = positive) and 60 without. The biomarker is a whole number drawn from normal distributions with means 62 and 50 for diseased and healthy patients; larger values indicate disease. Fixed seed.
| Disease state | Valid N (listwise) |
|---|---|
| Positive | 40 |
| Negative | 60 |
| Test Result Variable(s) | Area | Std. Error | Asymptotic Sig. | 95% CI | Gini index | K-S |
|---|---|---|---|---|---|---|
| biomarker | 0.791 | 0.046 | <.001 | 0.701 – 0.881 | 0.583 | 0.458 |
Under the nonparametric assumption. Null hypothesis: true area = 0.5. Some values are tied between the positive and negative groups.
| Positive if Greater Than or Equal To | Sensitivity | 1 - Specificity | Precision |
|---|---|---|---|
| 26.0 | 1.000 | 1.000 | 0.400 |
| 38.5 | 1.000 | 0.900 | 0.426 |
| 44.5 | 0.950 | 0.783 | 0.447 |
| 49.5 | 0.875 | 0.517 | 0.530 |
| 52.5 | 0.825 | 0.367 | 0.600 |
| 54.5 | 0.750 | 0.350 | 0.588 |
| 59.5 | 0.525 | 0.200 | 0.636 |
| 65.5 | 0.400 | 0.033 | 0.889 |
| 71.0 | 0.175 | 0.000 | 1.000 |
| 86.0 | 0.025 | 0.000 | 1.000 |
Every fifth cutoff plus the cutoff where the K-S statistic is reached; the workspace lists every cutoff.
How to read it
The area under the curve is 0.791 (95% CI 0.701 – 0.881, p < .001): a randomly chosen diseased patient has a higher biomarker than a randomly chosen healthy one 79.1% of the time (ties counting as half). The largest gap between sensitivity and 1 − specificity (K-S = 0.458) occurs at a cutoff of 52.5, where sensitivity is 0.825 and specificity is 0.633.
Output tables explained
- Case Processing Summary
- Valid positive and negative counts after listwise deletion across the state and all test variables.
- Area Under the Curve
- Area, standard error, asymptotic significance against 0.5, confidence interval, Gini index and K-S for each test variable. A footnote warns when values are tied across the two groups.
- Coordinates of the Curve
- Every cutoff with sensitivity, 1 − specificity and precision. Cutoffs are midpoints between adjacent observed values, plus the minimum minus 1 and the maximum plus 1.
Assumptions and notes
- The state variable is the true condition, measured independently of the test.
- Cases are independent; repeated measurements on the same person inflate the apparent precision.
- The nonparametric standard error makes no distributional assumption; the bi-negative exponential one assumes that model and equal group sizes.
- Weights must be declared as whole-number frequency weights; sampling weights stop the procedure.
How the results are validated
The engine reproduces the worked example in the SPSS ROC algorithms documentation (area .64, SE .183). On a 180-case weighted reference file the area matches scikit-learn 1.9.1 roc_auc_score and R pROC 1.19.1 to 1e-12, and the nonparametric (Hanley-McNeil with ties) standard error matches an independent NumPy implementation to 1e-12 for both test directions, with the p value to 1e-9. Validation evidence
Questions
What counts as a good AUC?
0.5 is chance and 1.0 is perfect separation. Rough conventions call 0.7–0.8 acceptable, 0.8–0.9 good and above 0.9 excellent, but what matters is whether the test beats the alternatives used in practice.
My AUC is below 0.5. What happened?
The test direction is probably reversed: lower scores indicate the positive state. Switch Test direction to Smaller test result indicates a more positive test and the area becomes 1 minus the old value.
How do I choose the best cutoff?
A common choice maximises sensitivity + specificity − 1 (Youden's J), which is the K-S statistic reported in the area table. If missing a positive is costlier than a false alarm, pick a lower cutoff with higher sensitivity from the coordinates table.
Why does precision appear in the coordinates?
Precision (positive predictive value) depends on how common positives are in your data. It complements the ROC curve when the positive class is rare.
Related procedures
- ROC AnalysisROC ANALYSIS
- Binary Logistic RegressionLOGISTIC REGRESSION
- Discriminant AnalysisDISCRIMINANT
- Naive BayesNAIVEBAYES
- ProportionsPROPORTIONS
- Free SPSS alternative: full coverage list
Run ROC Curve on your own data
Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.
SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.