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.


 

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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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