# Help with the normality of the residuals of my regression model

I am doing a regression in R on the effects of EU and UN economic sanctions on GDP. My model looks like this:

lm(formula = log(GDP) ~ EU + UN + PTS + PolityV + GDPLag + Schooling +
Mortality + Resources + Population + Trade + factor(Country) +
factor(Year)

with log(GDP) being the logarithm of the real GDPpc in USD. EU and UN are dummy variables that are 1 when sanctions are in place. Then I have 2 variables to measure the conflicts in the countries, some economic control variables and a country and time dummy.

The problem that I have is with the general regression assumptions for a linear model. My model has hereroskedasticity and I am adding HC-robust standard errors for that. I am also adding the estimation with cluster-robust SE's on a country level, as often done in literature.

The main problem for me is the assumption of normal distribution of the residuals. I did a QQ plot and on that there is quite a heavy tail that can be seen. I also did a Shapiro-Wilk test, but I read that with a lot of observations, it is quite sensitive to extreme cases. My question is: are there any transformations or other methods that I could use to get a more normal distribution of the residuals?

• The QQ plot cannot tell you anything at all about linearity. Could you please therefore clarify what it is that really concerns you?
– whuber
Aug 18, 2023 at 14:21
• I am sorry, i got a bit confused while writing this post, i edited it already. The linearity should be fine considering the residuals vs fitted plot i attached. But as i understand it, the QQ plot of my model shows that that isnt a good normal distribution of my model, which would violate the according assumption. I already checked the extreme cases and the are cases like rwanda 1994 where the civil war influenced the GDP greatly, so no data errors. I also did a residuals vs leverage plot and a scale location plot which i attached. Aug 18, 2023 at 14:51
• So at the moment i am quite unsure how i would improve the results of the normal distribution of the residuals other that removing the extreme values. Aug 18, 2023 at 14:51
• "Improve" in what sense and for what purpose? Much of what you can do with regression does not require Normal errors and the rest only requires that the errors do not depart so much from Normality as to call into question your p-values, which depends on the tests you plan to do and the amount of data you have. You have plenty of data.
– whuber
Aug 18, 2023 at 15:05
• The "assumption that the residuals are normally distributed" is mostly a myth. OLS still works, and all the estimates are typically fine even with non-normal errors. In small samples - which you don't appear to have - Normality helps with ensuring that, e.g., t-statistics used for significance testing actually have t-distributions. Aug 18, 2023 at 15:05

I am not a fan of transforming variables just to meet statistical assumptions. You should transform variables for substantive reasons. Matenmakkers gives a good example of this in econometrics and the transform you already have seems to be along those lines, too.

Otherwise, use a model that accommodates the data. Two that do are robust regression and quantile regression. But you then have the problem of non-independent errors. I'm not sure if your solution is available for robust reg or quantile reg.

Also, I disagree with your professor about imputation. Did they give a reason why they don't want you to use it?

Normality of the error distribution is possibly the least important assumption of linear regression. All desirable properties of OLS and of the estimated coefficients still hold regardless of the error distribution. Residual normality is not one of the Gauss-Markov assumptions.

Normality is relevant only to inference on the regression coefficients, but with a large sample one can invoke the CLT so that the classical t-tests are still approximately correct. Your sample is more than large enough (3566 usable observations, from your output), so inference shouldn't be an issue. The only problem you could run into is if you want to make prediction intervals, which rely heavily on the error normality assumption. Because you have residuals with relatively high kurtosis, the calculated prediction interval will be too narrow.

There is a classical power transformation you can do on the dependent variable that sometimes improves error normality, namely the Box-Cox transformation, defined as

$$g(y_i) = \begin{cases} \frac{y_i^\lambda - 1}{\lambda} & \text{if}\ \lambda \neq 0\\ \ln(y_i) & \text{if}\ \lambda = 0 \end{cases}$$

$$\lambda$$ is then fitted with maximum likelihood, and typically one rounds it off a bit to get an interpretable power transformation. The boxcox function in the R package MASS does this for you. The $$\ln$$ is in there because $$y_i^0$$ is of course not a very interesting transformation, and because the derivative of $$\ln(x)$$ is $$1/x$$. This makes the natural logarithm fit very logically into $$x^2, x, \ln(x), x^{-1}, x^{-2}$$. Box-Cox also has some variance stabilizing properties, so it might even reduce your heteroscedasticity problems.

The thing with this transformation is that the interpretation of the coefficients changes of course, which might be undesirable for you, but this depends on the goal of the analysis. I know that in econometrics the log transform on y is often chosen specifically to be able to have an interpretation of relative increase/decrease in y.

Another, more complicated solution would be to use a different error distribution than the normal. This would be equivalent to a GLM with linear link function and a more flexible distribution on y, such as Tweedie regression, although I don't expect it to really make much of a difference in your case.

What does stand out in your output is that R is automatically removing 682 observations due to missingness. It's the default, but this is just about the worst way to deal with missing data. I would advise looking into multiple imputation methods (MICE package in R) or even just a simple mean/median imputation would be better than throwing all that data out. This is likely a much bigger concern than residual normality.

• Thank your for the detailed answer! Aug 18, 2023 at 16:01
• Good answer, and welcome to the site! Aug 18, 2023 at 16:14
• @slicey If you feel this has answered your question, consider accepting it by clicking on the tick mark to the left of the answer below the vote count.
– mkt
Aug 18, 2023 at 19:36
• In general, this is a good answer, +1. I disagree with your last paragraph. Imputation will simulate "knowledge" we don't have, so I would be very careful about it and rather recommend that OP should analyze whether data are MAR, MCAR etc. before they start drawing any conclusions. Aug 19, 2023 at 17:52
• "All desirable properties of OLS and of the estimated coefficients still hold regardless of the error distribution." Not quite. You need existing second moments, also for the CLT argument. In practice outliers can do a lot of harm. Aug 20, 2023 at 0:29