BookmarkSubscribeRSS Feed
taylor_metz1
Calcite | Level 5

I am trying to use a backwards selection process to create a parsimonious model using proc logistic.

 

when I attempt it my code is this:

 

proc logistic data=test2;
class stroke(ref="1") / param=ref;
model prevhyp (event="1")= stroke diabetes sysbp educ BMI diabp totchol glucose prevchd;
selection=stepwise;
slentry=0.05
slstay=0.20
details
lackfit;
run;

 

 

and my SAS log says this:

 

248  proc logistic data=test2;
249  class stroke(ref="1") / param=ref;
250  model prevhyp (event="1")= stroke diabetes sysbp educ BMI diabp totchol glucose prevchd;
251  selection=stepwise;
     ---------
     180
ERROR 180-322: Statement is not valid or it is used out of proper order.
252  slentry=0.05
253  slstay=0.20
254  details
255  lackfit;
256  run;

 

I am not sure what I am doing wrong as I have never used the SLSTAY function before.

2 REPLIES 2
Astounding
PROC Star

Off the top of my head, SELECTION= is an option on the MODEL statement.  The line before should not end with a semicolon.

 

Instead, change it to a slash to indicate that MODEL statement options follow.

Reeza
Super User

Yes, @Astounding is correct, you have a semicolon where you need a / to specify options instead.

 

model prevhyp (event="1") = stroke diabetes sysbp educ BMI diabp totchol glucose prevchd /selection=stepwise ... <rest of your options>;

@taylor_metz1 wrote:

I am trying to use a backwards selection process to create a parsimonious model using proc logistic.

 

when I attempt it my code is this:

 

proc logistic data=test2;
class stroke(ref="1") / param=ref;
model prevhyp (event="1")= stroke diabetes sysbp educ BMI diabp totchol glucose prevchd;
selection=stepwise;
slentry=0.05
slstay=0.20
details
lackfit;
run;

 

 

and my SAS log says this:

 

248  proc logistic data=test2;
249  class stroke(ref="1") / param=ref;
250  model prevhyp (event="1")= stroke diabetes sysbp educ BMI diabp totchol glucose prevchd;
251  selection=stepwise;
     ---------
     180
ERROR 180-322: Statement is not valid or it is used out of proper order.
252  slentry=0.05
253  slstay=0.20
254  details
255  lackfit;
256  run;

 

I am not sure what I am doing wrong as I have never used the SLSTAY function before.


 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1298 views
  • 0 likes
  • 3 in conversation