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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 1536 views
  • 0 likes
  • 4 in conversation