BookmarkSubscribeRSS Feed
Lidz
Calcite | Level 5

Which procedure to use to fit Log-Gamma distribution?

5 REPLIES 5
Rick_SAS
SAS Super FREQ

If you are talking about fitting a parametric model to univariate data, you can

1) use PROC IML to fit the maximum likelihood estimates for the log-gamma model: http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml.html

2) exponentiate and use PROC UNIVARIATE to fit a gamma distribution on the transformed data

Lidz
Calcite | Level 5

Thanks for reply!

Since I want to simulate random numbers from log-gamma. Is it okay if I take the Log of obsv, fit gamma using Proc Univariate and exponentiate the simulated random numbers to get log-gamma rand. no.s?

Rick_SAS
SAS Super FREQ

Yes. The result to keep in mind is that if X is log-gamma distributed, then Y = log(X) has a gamma distribution.  So yes, you can use PROC UNIVARIATE to fit  the parameters for Y.  Then you can use those parameters to simulate gamma data, and exponentiate those random variates to simulate the original data.

Lidz
Calcite | Level 5

Cool...thanks a lot!!!!!!

StatDave
SAS Super FREQ

If you are asking how to fit a log-linear model to a gamma-distributed response variable, you can do that in PROC GLIMMIX or PROC GENMOD.  For example, if Y is a gamma-distributed response, the following statements fit the model (with X1 and X2 as predictors) log(mean) = intercept + b1*x1 + b2*x2 :

proc genmod;

model y = x1 x2 / dist=gamma link=log;

run;

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 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
  • 5 replies
  • 2003 views
  • 1 like
  • 3 in conversation