IBM Support

Can SPSS produce Youden's index?

Troubleshooting


Problem

Can SPSS compute Youden's index, which can be expressed as sensitivity + specificity -1?

Resolving The Problem

Below are commands to produce a table with sensitivity, specificity and Youden's index. Comments are included that indicate how you might edit for your particular situation. These commands will work for either a situation where multiple values of a test variable are being assessed via an ROC curve, or where the variables forming a single 2x2 table are input to the procedure.

*Make sure your current data file has been saved before running these commands.
*Change the file name from C:\temp\ROC.sav if desired.

OMS
/SELECT TABLES
/IF COMMANDS = ["ROC Curve"]
SUBTYPES = ["Coordinates of the Curve"]
/DESTINATION FORMAT = SAV
OUTFILE = "C:\temp\ROC.sav".

OMS
/SELECT ALL
/IF COMMANDS = ["ROC Curve"]
/DESTINATION VIEWER = NO.

*Change the test and outcome variable names if necessary, and/or the value of the
*outcome value. If the outcome of interest has a smaller value than the negative
*outcome, change "LARGE" to "SMALL" on the CRITERIA subcommand. If you
*want the cutoff value excluded, change "INCLUDE" to "EXCLUDE" on the
*CRITERIA subcommand.

ROC testvar BY statevar (1)
/CRITERIA = TESTPOS(LARGE) CUTOFF(INCLUDE)
/PRINT = COORDINATES.

OMSEND.

*If you changed the file name or path above, change it here to match.

GET FILE = "C:\temp\ROC.sav".
SELECT IF Sensitivity NE @1Specificity.
COMPUTE Specificity = 1 - @1Specificity.
COMPUTE Youden = Sensitivity - @1Specificity.
FORMATS Specificity Youden (F8.3).

*If you changed LARGE to SMALL, change "Greater" in the first variable name on
*the TABLES subcommand to "Less". If you changed INCLUDE to EXCLUDE,
*remove "orEqualTo" from the end of that variable name.

SUMMARIZE
/TABLES=PositiveifGreaterThanorEqualTo Sensitivity Specificity Youden
/FORMAT=LIST NOCASENUM
/TITLE="Sensitivity, Specificity & Youden's Index"
/CELLS=NONE.

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

59162

Document Information

Modified date:
16 April 2020

UID

swg21477309