BookmarkSubscribeRSS Feed
FightingIllini
Calcite | Level 5

Hey all,

I am trying to use a best subsets selection on the score chi-square for a set of both categorical and continuous predictors. The problem is that since some of my variables are categorical they have to be specified with a class statement and I can't use "selection=score" as a parameter when class variables are involved. Any ideas on how to deal with this problem? Thanks.

Here is my code:

ods output bestsubsets=score;

     proc logistic data=work.***;

     class x1 x2 x3 x4 x5 x6 x7;

     model target(event='1')= x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 / selection=score best=1 start=1 stop=20;

run;

ods output close;

1 REPLY 1
StatDave
SAS Super FREQ

If the CLASS variables are at least ordinal in scale and it is reasonable to assign numeric scores to their levels, then you could create numeric variables for them.  Otherwise, you might want to consider another method such as SELECTION=STEPWISE.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1250 views
  • 0 likes
  • 2 in conversation