BookmarkSubscribeRSS Feed
FreddyAdams
Calcite | Level 5

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

5 REPLIES 5
ballardw
Super User

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

FreddyAdams
Calcite | Level 5

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;

Doc_Duke
Rhodochrosite | Level 12

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

FreddyAdams
Calcite | Level 5

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.

SteveDenham
Jade | Level 19

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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1845 views
  • 0 likes
  • 4 in conversation