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
- /
- Re: Need help with PROC GENMOD /Gamma distribution with log link

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 03-27-2011 08:49 PM
(2670 views)

Hi,

I am building a multivariable model using proc genmod (gamma and a log link), and I have a major explanatory variable (X1, which is 5-level category variable) and a few covariates.

When I got the output, I had estimates for intercept B0, B1(X1), and estimates for other covairables....but I could not find the overall mean value for the dependent variable in the whole model. Also, I want to calculate the group means by variable X1 in the model.

Are there any ways to calculate the overall mean of dependent variable and the group means by X1 in the gamma and a log link model?

Thanks a lot!

I am building a multivariable model using proc genmod (gamma and a log link), and I have a major explanatory variable (X1, which is 5-level category variable) and a few covariates.

When I got the output, I had estimates for intercept B0, B1(X1), and estimates for other covairables....but I could not find the overall mean value for the dependent variable in the whole model. Also, I want to calculate the group means by variable X1 in the model.

Are there any ways to calculate the overall mean of dependent variable and the group means by X1 in the gamma and a log link model?

Thanks a lot!

4 REPLIES 4

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

In order to produce estimates of the response for each level of X1, you need to specify X1 as a categorical variable and include an LSMEANS statement which names X1 as the effect of interest. Since you have specified a log link, you will want to include the ILINK option on the LSMEANS statement. I trust that you have a recent update to SAS so that the ILINK option is available to you.

Providing specific help would be much easier if you were to provide more details about your problem, including the version of SAS which you have available as well as code which you have submitted.

Providing specific help would be much easier if you were to provide more details about your problem, including the version of SAS which you have available as well as code which you have submitted.

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

Thank you very much for explanation. Now I understand how to get the group means!

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

Here is one simple example, with trt for a factor (categorical variable) and x for a covariable (continuous).

proc genmod data=ra;

class trt;

model y = trt x / dist=gamma link=log ;

lsmeans trt / ilink at x=-1;

run;

With LSMEANS, you get estimated means (based on the model) for each covariable at its overall mean. At least you do with MIXED and GLIMMIX, and I assume this holds with GENMOD. You may want the estimated values at a different value for the covariable. Here I asked for the values when x=-1 (example).

proc genmod data=ra;

class trt;

model y = trt x / dist=gamma link=log ;

lsmeans trt / ilink at x=-1;

run;

With LSMEANS, you get estimated means (based on the model) for each covariable at its overall mean. At least you do with MIXED and GLIMMIX, and I assume this holds with GENMOD. You may want the estimated values at a different value for the covariable. Here I asked for the values when x=-1 (example).

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

That works! Thank you so much!

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

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.