07-29-2015 10:51 AM
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
08-04-2015 05:55 AM
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?
08-05-2015 09:19 AM
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.
08-01-2015 11:42 AM
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 :
model y = x1 x2 / dist=gamma link=log;