Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- GLIMMIX Procedure - modelling multiple variables

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 09-17-2019 05:07 AM
(1049 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

...

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you very much Rick!

This looks very much like the help I need.

I'm grateful!

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

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.