2
$\begingroup$

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.

enter image description here

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?

Residuals vs Fitted

Scale Location

Residuals Leverage

$\endgroup$
7
  • $\begingroup$ The QQ plot cannot tell you anything at all about linearity. Could you please therefore clarify what it is that really concerns you? $\endgroup$
    – whuber
    Aug 18, 2023 at 14:21
  • $\begingroup$ 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. $\endgroup$
    – slicey
    Aug 18, 2023 at 14:51
  • $\begingroup$ 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. $\endgroup$
    – slicey
    Aug 18, 2023 at 14:51
  • $\begingroup$ "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. $\endgroup$
    – whuber
    Aug 18, 2023 at 15:05
  • 3
    $\begingroup$ 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. $\endgroup$
    – jbowman
    Aug 18, 2023 at 15:05

2 Answers 2

4
$\begingroup$

Adding to @Matenmakkers excellent answer:

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?

$\endgroup$
10
$\begingroup$

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.

$\endgroup$
7
  • 1
    $\begingroup$ Thank your for the detailed answer! $\endgroup$
    – slicey
    Aug 18, 2023 at 16:01
  • 3
    $\begingroup$ Good answer, and welcome to the site! $\endgroup$
    – jbowman
    Aug 18, 2023 at 16:14
  • 2
    $\begingroup$ @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. $\endgroup$
    – mkt
    Aug 18, 2023 at 19:36
  • 4
    $\begingroup$ 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. $\endgroup$ Aug 19, 2023 at 17:52
  • 2
    $\begingroup$ "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. $\endgroup$ Aug 20, 2023 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.