Reputation: 305
I have built a model using Proc logistic and I need to rank the strength of predictors. Should I be looking for something in one of the outputs? Or is there some code that will calculate the strength?
Upvotes: 0
Views: 1581
Reputation: 412
This document explains how to use standardized coefficients to rank the predictors of a logistic regression model. In proc logistic
you specify stb
option to get the standardized coefficients and ods output parameterestimates = params;
to get these in a table. Then you calculate the absolute values of the standardized coefficients and rank them from highest (stronger predictors) to lowest (weaker predictors).
PROC LOGISTIC DATA=SASHELP.JUNKMAIL;
MODEL CLASS = MAKE -- CAPTOTAL / STB;
ODS OUTPUT PARAMETERESTIMATES = PARAMS;
RUN;
DATA PARAMS;
SET PARAMS;
WHERE VARIABLE NE 'Intercept';
ABSSTANDARDIZEDEST = ABS(STANDARDIZEDEST);
KEEP VARIABLE STANDARDIZEDEST ABSSTANDARDIZEDEST;
RUN;
PROC RANK DATA=PARAMS OUT=RANKPARAMS DESCENDING;
VAR ABSSTANDARDIZEDEST;
RANKS RANK;
RUN;
PROC SORT DATA=RANKPARAMS;
BY RANK;
RUN;
PROC PRINT DATA=RANKPARAMS NOOBS;
RUN;
Upvotes: 2