BookmarkSubscribeRSS Feed
clg2
Calcite | Level 5

I have a response variable with six categories, 1 - 6. 

 

SAS Version: TS1M6

 

I am analyzing the data using GLIMMIX: 

 

PROC GLIMMIX ; 

CLASS rep group size ;

MODEL size = group / DIST=MULT ; 

RANDOM rep ; 

OUTPUT OUT=new PRED(ILINK)=ps ; 

 

SIZE has discrete values 1, 2, 3, 4, 5, 6. 

When I previously used this code, the new SAS DATA set would have _LEVEL_ to identify which of the six levels of the categorical response variable the predicted cumulative probabilIty (ps)  was associated with. Now, I am no longer getting the _LEVEL_ variable; just the observed value of SIZE.  I want to make certain I align the correct value of SIZE with its cumulative probability for each group value. 

 

Any assistance would be appreciated. 

 

clg

 

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @clg2 and welcome to the SAS Support Communities (as a first-time poster)!

 

Sorry to see that your post hasn't been answered yet. Not sure if I can be of much help, but running your code using my SAS 9.4M5 (SAS/STAT 14.3) and this very crude input dataset HAVE

data have;
call streaminit(27182818);
do i=1 to 100;
  group=rand('bern',0.5);
  rep=rand('bern',0.5);
  size=rand('integer',6);
  output;
end;
run;

creates a dataset NEW which does contain variable _LEVEL_ with values 1 through 5 for each value of variable i, hence 500 observations in total. However, if I add the OBSCAT option to the OUTPUT statement

OUTPUT OUT=new1 PRED(ILINK)=ps / obscat;

the output dataset NEW1 is only a subset of NEW: comprised of those 75 observations where SIZE=_LEVEL_, and variable _LEVEL_ is omitted (as it would be redundant). This looks like what you describe.

 

As far as I see, the documentation of the OUTPUT statement has not changed between SAS/STAT 14.3 and 15.1. So I wouldn't know why your SAS 9.4M6 should work as if OBSCAT was the default. Do you get variable _LEVEL_ if you use the above HAVE dataset? If so, there might be a data-dependent issue and you may want to share a portion of your data (possibly with confidential values replaced with mock-up data).

clg2
Calcite | Level 5
Thank you for your reply. The error I made was embarrasingly simple. I needed to sort the categorical responses within each of the levels of the CLASS variable. Bad oversight on my part.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 2 replies
  • 706 views
  • 0 likes
  • 2 in conversation