BookmarkSubscribeRSS Feed
peppapig
Calcite | Level 5

In proc glm, how to control all the class variables descending at the same time?

x1, x2, x3 class variables with grouping values as 1,2,3 , using the code below, I only had x1 in descending, not x2. x3 in the output .

PROC SORT DATA = abc;

BY DESCENDING x1 DESCENDING x2 DESCENDING x3;   

RUN;

 

PROC GLM DATA = abc  ORDER = DATA ;

CLASS x1 x2 x3 ;

MODEL  y = x1 x2 x3   /solution ss3  ; 

RUN;

2 REPLIES 2
Reeza
Super User

Not sure if this would work but usually in a class statement you should specify the parameterization, param='ref' and there's an option for descending. But I also have vague recollections of GLM being different.

At any rate, I'd be looking at options within GLM or GLMSELECT rather than via the SORT.

SAS/STAT(R) 9.2 User's Guide, Second Edition

JasonXin
SAS Employee

PROC GLM has option of

REF=FIRST | LAST

which you can set as global option for the whole class list.

Jason Xin

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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2085 views
  • 1 like
  • 3 in conversation