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.
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.
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.
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.
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.