Programming the statistical procedures from SAS

How to do variable selection for logistic regression?

Accepted Solution Solved
Reply
Contributor
Posts: 49
Accepted Solution

How to do variable selection for logistic regression?

Hello,everyone!  I need to do logistic regression on my data,but the client offered me more than 20 variables. I'm pretty sure that some of them are not necessary. But how to remove them? Is there one stepwise method, just like proc reg, for proc logistic?

Anyone could help me out?

Thanks!


Accepted Solutions
Solution
‎07-03-2012 05:18 AM
Regular Contributor
Posts: 151

Re: How to do variable selection for logistic regression?

Yes, there is a SELECTION= option in the MODEL statement within PROC LOGISTIC.  The methods available are BACKWARD, FORWARD, STEPWISE and SCORE. Check out the SAS documentation below.

http://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_logistic_sec...

View solution in original post


All Replies
Solution
‎07-03-2012 05:18 AM
Regular Contributor
Posts: 151

Re: How to do variable selection for logistic regression?

Yes, there is a SELECTION= option in the MODEL statement within PROC LOGISTIC.  The methods available are BACKWARD, FORWARD, STEPWISE and SCORE. Check out the SAS documentation below.

http://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_logistic_sec...

Contributor
Posts: 49

Re: How to do variable selection for logistic regression?

Great! I'll give one try. Thanks, Keith!

Respected Advisor
Posts: 2,655

Re: How to do variable selection for logistic regression?

Mike,

Before you get too far with stepwise selection, you might want to read the paper by Peter Flom and David Cassell on "Stopping Stepwise."  It is at

http://www.nesug.org/proceedings/nesug07/sa/sa07.pdf

If the link isn't clickable, paste it into your browser.  There have been several presentations regarding the use of the LASSO method in PROC GLMSELECT to get a reasonable model, even for non-normally distributed response variables.

Good luck.

Steve Denham

Respected Advisor
Posts: 4,745

Re: How to do variable selection for logistic regression?

Hi Steve, thanks for the reference. I wish the equivalent of GLMSELECT was available for logistic regression. It would save me a lot of work! - PG

PG
Contributor
Posts: 49

Re: How to do variable selection for logistic regression?

One more question.

How to output the odds value for every observation to one dataset?

Thanks!

Regular Contributor
Posts: 151

Re: How to do variable selection for logistic regression?

I'm not sure if you can output the odds, however you can output the estimated probability (from which you could easily calculate the odds)

proc logistic data=sashelp.class;

output out=test predicted=prob;

model sex= age height weight;

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 6680 views
  • 0 likes
  • 4 in conversation