DATA Step, Macro, Functions and more

ERROR 180-322: Statement is not valid or it is used out of proper order.

Reply
Learner
Posts: 1

ERROR 180-322: Statement is not valid or it is used out of proper order.

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.

Super User
Posts: 6,934

Re: ERROR 180-322: Statement is not valid or it is used out of proper order.

[ Edited ]
Posted in reply to taylor_metz1

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.

Super User
Posts: 24,010

Re: ERROR 180-322: Statement is not valid or it is used out of proper order.

Posted in reply to taylor_metz1

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.


 

Ask a Question
Discussion stats
  • 2 replies
  • 149 views
  • 0 likes
  • 3 in conversation