Programming the statistical procedures from SAS

Statement is not valid...Error when using the Slice statement in Proc Logistic

Reply
New Contributor
Posts: 3

Statement is not valid...Error when using the Slice statement in Proc Logistic

Hi,

Can someone give me the position of the Slice Statement in Proc Logistic syntax? I've put it all over the place and I keep getting the above error about invalidity or proper order. I'm using the param=glm option. Thanks, wardodd

Super User
Posts: 10,816

Re: Statement is not valid...Error when using the Slice statement in Proc Logistic

It would help to show the rest of your syntax as well. Some options may be incompatible with others.

A partial example from online help:

determines how to construct the partition of the least squares means for the model-effect. A slice-specification consists of an effect name followed by an optional list of formatted values. For example, the following statements creates partitions of the A*B interaction effect for all levels of variable A:

class a b;  model y = a b a*b;  slice a*b / sliceby=a;  

Similar to use of LSMEANS

New Contributor
Posts: 3

Re: Statement is not valid...Error when using the Slice statement in Proc Logistic

Here's my code:

proc logistic data = test ;

class gender_code (ref='M') const (ref='1') back (ref='1')/param=glm;

model employed1 (event='1') = const back gender_code gender_code*back gender_code*const const*back/ rsq lackfit;

slice const*back/sliceby back;

oddsratio back;

oddsratio const;

oddsratio gender_code;

run;

Trusted Advisor
Posts: 2,114

Re: Statement is not valid...Error when using the Slice statement in Proc Logistic

Curious.  The code you posted here is different from that which came by e-mail.  The PARAM=GLM is required for the SLICE statement to be valid.  Perhaps you could post your log, as something strange is going on.

Doc

New Contributor
Posts: 3

Re: Statement is not valid...Error when using the Slice statement in Proc Logistic

I pasted the wrong code at first (had param=ref) and edited it after I posted it. The log is vague - it just says it's invalid or is not in the proper order. Weird. I wonder if it's a patch thing or version issue.

Respected Advisor
Posts: 2,655

Re: Statement is not valid...Error when using the Slice statement in Proc Logistic

Unless you are operating on a version earlier than 9.2, I doubt that it is a version issue.  Try:

slice const*back/sliceby = back;

It may be that the syntax requires the equals sign in the sliceby option.

Steve Denham

Ask a Question
Discussion stats
  • 5 replies
  • 309 views
  • 0 likes
  • 4 in conversation