Programming the statistical procedures from SAS

Inclusion automatic possible interaction for variable selection using proc logistic

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

Inclusion automatic possible interaction for variable selection using proc logistic

Dear All

How can i include automatically all possible interaction of main effects to make variable selection?

here the code
proc logistic data=main;
model y/n= a   b   c   d   e  /selection=stepwise slentry=0.10 slstay=0.150 details lackfit;
run;

 

desired consideration:

proc logistic data=main;
model y/n= a   b   c   d   e  a*b   a*c   a*d    a*e    b*c    b*d   b*e   c*d    c*e    d*e /selection=stepwise slentry=0.10 slstay=0.150 details lackfit;
run;

 

Thank you much.


Accepted Solutions
Solution
‎05-26-2018 05:24 AM
Super User
Posts: 10,784

Re: Inclusion automatic possible interaction for variable selection using proc logistic

proc logistic data=sashelp.class;
model sex=age|weight|height @2 ;
run;

View solution in original post


All Replies
SAS Employee
Posts: 97

Re: Inclusion automatic possible interaction for variable selection using proc logistic

you can use the | notation with the @ to specify the degree.  For all two way interactions it would be:

 

model y/n= a|b|c|d|e @2 /selection=stepwise slentry=0.10 slstay=0.150 details lackfit;

Contributor
Posts: 22

Re: Inclusion automatic possible interaction for variable selection using proc logistic

Dear:
Thank you!
Solution
‎05-26-2018 05:24 AM
Super User
Posts: 10,784

Re: Inclusion automatic possible interaction for variable selection using proc logistic

proc logistic data=sashelp.class;
model sex=age|weight|height @2 ;
run;
Contributor
Posts: 22

Re: Inclusion automatic possible interaction for variable selection using proc logistic

Dear Ksharp:
Thank you much!
☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 137 views
  • 0 likes
  • 3 in conversation