BookmarkSubscribeRSS Feed
dammie_101
Obsidian | Level 7

Good day dear professionals!

 

When using PROC GLM, one can compute the statistic of more than one dependent variable within the same PROC GLM syntax.

Take for example, the following pseudo code:

 

PROC GLM DATA = input_dataset;

CLASS class_var1;

MODEL dependent_var1 dependent_var2 dependen_var3 = class_var1;

LSMEANS class_var1 / ADJUST = adj_method CL;

RUN;

QUIT;

However, for PROC GLIMMIX, one can only model just one response variable within one GLIMMIX syntax. And in my case, I have up to 14 response variables.

 

Would anyone be kind enough to share with me a macro (or something similar) with which I can instruct PROC GLIMMIX to repeat the modelling step for the other variables I have in my data set? I will be sincerely grateful.

 

Thank you very much!

SIncerely,

Dami.

 

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Not a direct answer to your question, but the way you have written this example, there is no need for PROC GLIMMIX; you can use PROC GLM which does allow multiple Y variables in the MODEL statement.

 

Now perhaps the real problem is more complicated than this example, and you really do need PROC GLIMMIX, in which case you will need a simple macro.

--
Paige Miller
dammie_101
Obsidian | Level 7

I'm dealing with count data. GLM can't correctly model count data. That's why I need GLIMMIX to accommodate for overdispersion.

 

I know I need a macro but I can't write one because i don't have the know-how to do so. That's why I asked.

Rick_SAS
SAS Super FREQ

The article "An easy way to run thousands of regressions in SAS"

provides a macro solution and also a By-group solution. For the By-group solution, you transform the data from wide to long, then use a BY statement to run the 14 regression models. The article shows how to perform regressions of the form

Y = X1

Y= X2

Y = X3

...

but it should be clear how to modify the technique to model 

Y1 = X

Y2 = X

Y3  = X

...

 

dammie_101
Obsidian | Level 7

Thank you very much Rick!

 

This looks very much like the help I need.

 

I'm grateful!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 4 replies
  • 1545 views
  • 2 likes
  • 3 in conversation