# I log transformed my dependent variable, can I use GLM normal distribution with LOG link function?

I have a question concerning Generalized Linear Models (GLM).My dependent variable (DV) is continuous and not normal. So I log transformed it (still not normal but improved it).

I want to relate the DV with two categorical variables and one continuous covariable. For this I want to conduct a GLM (I am using SPSS) but I am unsure how to decide on the distribution and function to choose.

I have conducted Levene's nonparametric test and I have homogeneity of variances so I am inclined to use the normal distribution. I have read that for linear regression the data does not need to be normal, the residuals do. So, I have printed the standardized Pearson residuals and predicted values for linear predictor from each GLM individually (GLM normal identity function and normal log function). I have conducted normality tests (histogram and Shapiro-Wilk) and plotted residuals against predicted values (to check for randomness and variance) for both individually. Residuals from identity function are not normal but residuals from log function are normal. I am inclined to choose normal with log link function because the Pearson residuals are normally distributed.

So my questions are:

• Can I use GLM normal distribution with LOG link function on a DV that has already been log transformed?
• Is the variance homogeneity test sufficient to justify using normal distribution?
• Is the residual checking procedure correct to justify choosing the link function model?

Image of the DV distribution on the left and residuals from the GLM normal with log link function on the right. • It's not quite clear what you mean by this: "So, I have compared the Pearson residuals from GLM with normal identity function and normal log function." Jun 13, 2013 at 8:27
• Thank you for your comment. I meant that I have printed the residuals and predicted values from each GLM (identity and log) individually and checked for normality and plotted standardized Pearson residuals against predicted values for each model individually. For the identity function, residuals are not normal, whereas for the log function, residuals are normal. Jun 13, 2013 at 8:33
• How does a plot of standardized Pearson residuals against predicted values indicate whether or not the data are actually normal? Jun 13, 2013 at 8:40
• I checked for normality by plotting the histogram of the residuals and conducting Shapiro-Wilk (P > 0.05 for the log function). Then I plotted residuals against predicted values to see if they were randomly distributed and to check the variance. (sorry for not saying important information, is the first time I am posting) Jun 13, 2013 at 8:47
• I guess that "identity function" is a homophone slip here for "density function". Jun 13, 2013 at 10:09

Can I use GLM normal distribution with LOG link function on a DV that has already been log transformed?

Yes; if the assumptions are satisfied on that scale

Is the variance homogeneity test sufficient to justify using normal distribution?

Why would equality of variance imply normality?

Is the residual checking procedure correct to justify choosing the link function model?

You should beware of using both histograms and goodness of fit tests to check the suitability of your assumptions:

1) Beware using the histogram for assessing normality. (Also see here)

In short, depending on something as simple as a small change in your choice of binwidth, or even just the location of the bin boundary, it's possible to get quite different impresssions of the shape of the data: That's two histograms of the same data set. Using several different binwidths can be useful in seeing whether the impression is sensitive to that.

2) Beware using goodness of fit tests for concluding that the assumption of normality is reasonable. Formal hypothesis tests don't really answer the right question.

e.g. see the links under item 2. here

About the variance, that was mentioned in some papers using similar datasets "because distributions had homogeneous variances a GLM with a Gaussian distribution was used". If this is not correct, how can I justify or decide the distribution?

In normal circumstances, the question isn't 'are my errors (or conditional distributions) normal?' - they won't be, we don't even need to check. A more relevant question is 'how badly does the degree of non-normality that's present impact my inferences?"

I suggest a kernel density estimate or normal QQplot (plot of residuals vs normal scores). If the distribution looks reasonably normal, you have little to worry about. In fact, even when it's clearly non-normal it still may not matter very much, depending on what you want to do (normal prediction intervals really will rely on normality, for example, but many other things will tend to work at large sample sizes)

Funnily enough, at large samples, normality becomes generally less and less crucial (apart from PIs as mentioned above), but your ability to reject normality becomes greater and greater.

Edit: the point about equality of variance is that really can impact your inferences, even at large sample sizes. But you probably shouldn't assess that by hypothesis tests either. Getting the variance assumption wrong is an issue whatever your assumed distribution.

I read that scaled deviance should be around N-p for the model for a good fit right?

When you fit a normal model it has a scale parameter, in which case your scaled deviance will be about N-p even if your distribution isn't normal.

in your opinion the normal distribution with log link is a good choice

In the continued absence of knowing what you're measuring or what you're using the inference for, I still can't judge whether to suggest another distribution for the GLM, nor how important normality might be to your inferences.

However, if your other assumptions are also reasonable (linearity and equality of variance should at least be checked and potential sources of dependence considered), then in most circumstances I'd be very comfortable doing things like using CIs and performing tests on coefficients or contrasts - there's only a very slight impression of skewness in those residuals, which, even if it's a real effect, should have no substantive impact on those kinds of inference.

In short, you should be fine.

(While another distribution and link function might do a little better in terms of fit, only in restricted circumstances would they be likely to also make more sense.)

• Thanks again! About the variance, that was mentioned in some papers using similar datasets "because distributions had homogeneous variances a GLM with a Gaussian distribution was used". If this is not correct, how can I justify or decide the distribution? Concerning the residual normal distribution, it means it is more appropriate right? I read that scaled deviance should be around N-p for the model for a good fit right? The value is the same for both GLMs and around N-p. I have also identified the most suitable model in the model using the AIC criteria. Not sure if this is what you meant. Jun 13, 2013 at 9:27
• see the discussion in my edits above Jun 13, 2013 at 9:39
• Thanks @Glen_b for the nice explanation. The histogram I also tested using Shapiro-Wilk, won't this consider everything? I plotted Q-Q plotted expected normal and Observed Pearson residual values and the points +- fit the line, except in the tips where they go slightly upwards. Is this what you meant? The distribution of the residuals looks normal, so I can proceed? (even if the logged DV is not normal) (I am still reading the links but wanted to ask this) Jun 13, 2013 at 9:54
• "because normal QQ plot were normally distributed for this model?" ... I might say "QQ plot of residuals suggests that the assumption of normality is reasonable" or "residuals appear reasonably close to normal". If your audience expects hypothesis tests, you might still quote one (but that doesn't alter the fact that they're not particularly helpful). "The problem with the dataset is that in the histogram of the DV" ... there's no assumption about the distribution of the unconditional DV or any of the IVs. Jun 13, 2013 at 10:45
• See the additional discussion at the bottom of my answer. Sorry I didn't answer earlier, but I was sleeping. On the other question, the reason why I asked was that the two models share most of their assumptions, and so pretty much all of this discussion is relevant to that question - even if the DV is different. It's not exactly the same situation (and so should be a new question), but this question should be linked from it, so you can ask questions in the context of this discussion, such as whether there are any different or additional issues. Jun 13, 2013 at 21:55