BookmarkSubscribeRSS Feed
Paulet
Calcite | Level 5

Hello everyone,

 

Some of my variables are not normally distributed, however, plotting the residuals against a Lognormal scale in a QQ plot works. But how can I back transform dist= LogN in glimmix? 

 

I also used the link fuction (link = identity) in glimmix, however, I then get the same values as with a normal distribution. Is it correct that with the link function you use a normal distribution? 

 

Thanks for the help! 

 

greetings,

 

 

 

7 REPLIES 7
Rick_SAS
SAS Super FREQ

If the residuals are lognormally distributed, you can create a new variable logY = log(Y) where Y is the response variable (which must be positive). This is different from a GLIM model that has a log link. To see the difference, see the article "Error distributions and exponential regression models"

 

Which model you choose depends on whether you believe that the effect of errors is multiplicative (the log(Y) model) or additive (the generalized linear model with a log link).. 

Paulet
Calcite | Level 5

Thanks for your reply.

 

However, would creating a new variable not be the same as using LOGN as a distribution in glimmix?

 

like:

 

Proc glimmix data = my data;
ID Idn;
class diet strain;
model variable = diet|strain / DDFM = KENWARDROGER dist=logn;
lsmeans diet|strain;
run;

Rick_SAS
SAS Super FREQ

However, would creating a new variable not be the same as using LOGN as a distribution in glimmix?

 

Yes, I think you are correct.

Paulet
Calcite | Level 5

Thank you! 

 

but sas cannot transform the results back with dist=logn right?

 

You have to do that manually? And how would you transform the standard error back. Because if it is just as simple as e^std.error, the std error that is transformed back will be a lot different then if you use the non transferred data. 

Rick_SAS
SAS Super FREQ

In general, there is no "back transformation" when you use the DIST= option. However, tor the DIST=lognormal, I guess you are asking if you can estimate the mean and variance of Y if you have estimates for log(Y). I believe the answer is yes, and the formulas are not difficult, but keeping everything straight can be a challenge.

 

The standard errors are more difficult to obtain. It is NOT exp(stdErr). The way to back-transform standard errors is to use the Delta method, but I do not have an example program that performs the computation. However, you could use bootstrap methods to estimate the standard errors.

 

From what I've seen in the past, it is not common to use DIST= and then try to transform the parameters to the normal distribution. A common scenario is to use a nonlinear LINK= transformation and then use the ILINK option to back-transform the estimates and standard errors. Would using the LINK= and ILINK options be an option for you?

 

Sorry that I don't know a special purpose SAS option or program that you can use.

Paulet
Calcite | Level 5

No, sorry. I indeed red your comments in different topics about the Link and ilink, however, in my case both will be exactly the same... I do not know why however.

Paulet
Calcite | Level 5

Maybe I can use link and Ilink, but the code for log normal it is identity? However, this is also right for gaussian right?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 7 replies
  • 1172 views
  • 1 like
  • 2 in conversation