9
$\begingroup$

I am trying to figure out which regressors to include in my model and assess my model's adequacy. I know my data is skewed. My question is: should I do transformation first or model selection first?

enter image description here

When I fit the full model, i seem to have non-constant variance of the error and also deviance from normality. I have applied a log transformation of the response variable: This removes the non constancy of the error but adds a curvature in the qqplot. I would like to use my model for frequenstist prediction and baysian prediction. I am aware thet deviations from normality can cause inacurrate prediction results. What should I do about the non-normality?

I have conducted a Shapiro test- it has been rejected, therefore i conclude that there is enough evidence that the data are not normal.

enter image description here

EDIT: My sample size is 250. Can i ignore the non-normality because I have many observations?

The response variable is Salary: enter image description here

EDIT 2: Added Variable Plots (as kindly suggested by Whuber)

As far as I know Added variable plots are used to detect disproportionate influence of observations. I do not see anything suspicious here that would explain or suggest the indicated bimodality.

Am I missing something here?

enter image description here

$\endgroup$
5
  • $\begingroup$ what's the response variable? Is it a count (or possibly a count scaled by something)? $\endgroup$
    – Glen_b
    Commented Apr 10, 2017 at 10:38
  • $\begingroup$ @Glen_b, the response variable is Salary. I have added histogram and boxplot in the question under Edit. $\endgroup$
    – Nneka
    Commented Apr 10, 2017 at 11:51
  • $\begingroup$ Have you tried taking the log of salary and running the linear regression? $\endgroup$
    – Josh
    Commented Apr 10, 2017 at 11:58
  • $\begingroup$ @Josh I have... the normality problem has not been solved. (I have written this in the question. See the second set of graphs). $\endgroup$
    – Nneka
    Commented Apr 10, 2017 at 12:01
  • $\begingroup$ If you would like to learn a disciplined, practical, and robust approach to addressing these issues, please visit quantdec.com/misc/MAT8406/Meeting07 and link to the "diagnostic plots" document. It includes R code and references to R packages. $\endgroup$
    – whuber
    Commented Apr 10, 2017 at 16:52

3 Answers 3

8
$\begingroup$

Okay, a few things.

1) I always advise against using tests for normality. They answer a question you already know the answer to, i.e. "Is your data normal?" (The answer is no because nothing is normal) vs the question "Is the lack of normality going to be a problem?" which is the question you should be interested in.

2) The assumption of normality is not so much about the predictive performance, but rather the correctness of the inference you would perform (hypothesis tests and confidence intervals).

3) Some deviation from normality is okay, because we have asymptotics that drive test statistics to normality.

4) You QQ-plot does not appear to be severely not normal (although there might be some bimodality in your residuals. You may want to check if there is an omitted variable or something). As another commenter stated, the normality is the one that can kind of fail (can have mild - moderate deviations from it).

5) So to answer your question

(i) Yes, you do the log transform (or some other transformation) first.

(ii) Once you transform your variable the nonnormality EDIT may be worth looking to see why the residuals seem to be in two distinct clusters.

$\endgroup$
7
  • 2
    $\begingroup$ +1 Good advice. I'm unsure about the merits of your last conclusion, though, because it might be giving up too soon. The QQ plot rather strongly suggests two clusters of residuals. Pursuing that idea through further exploration may yield valuable insight. $\endgroup$
    – whuber
    Commented Apr 10, 2017 at 16:55
  • $\begingroup$ @whuber how should i proceeed in order to explore the bimodality? $\endgroup$
    – Nneka
    Commented Apr 11, 2017 at 5:20
  • $\begingroup$ @Josh: what do you mean with asymptotics that drive test statistics to normality? Can you elaborate please? $\endgroup$
    – Nneka
    Commented Apr 11, 2017 at 15:22
  • $\begingroup$ One way is to search for a (binary?) covariate that would be associated with the modes. Another is to perform a cluster analysis of the residuals. Further exploration can be helpful, such as added-variable plots. $\endgroup$
    – whuber
    Commented Apr 11, 2017 at 16:17
  • $\begingroup$ We know as your sample size grows larger, the standardized version of your least squares estimators begin to hold a standard normal distribution (under of course mild regularity conditions) . The is why the t test is robust and why mild to moderate deviations from normality don't affect a lot of the inference. $\endgroup$
    – Josh
    Commented Apr 11, 2017 at 18:31
2
$\begingroup$

Note: Linear regression does not have assumptions on response variable to be normally distributed. Instead, it has assumptions on residual needs to be normally distributed (See Gauss-Markov theorem). In addition, this assumption is the "least important one", i.e., can be violated and the model will work "fine".

They are different, one is on marginal distribution and another is the conditional distribution. An detailed example can be found here: Why linear regression has assumption on residual but generalized linear model has assumptions on response?

$\endgroup$
1
  • $\begingroup$ @hxd1001 thank you for your input. As fas as I know prediction intervals strongly depend on the normality of the errors, otherwise the model is likely to yield inaccurate results? Based on the QQ-plot I conclude my residuals are not normaly distibuted. Is this a problem? $\endgroup$
    – Nneka
    Commented Apr 10, 2017 at 16:14
0
$\begingroup$

I wouldn't worry about normality, at least, at this stage of your analysis. Try using log transformation on the dependent variable. Salary's a good candidate for log-transform. This removes skewness, then you'll be good to continue analysis.

$\endgroup$
2
  • $\begingroup$ I have done transformation on the dependent variable, which indeed fixed the non-constancy of error variance, but introduced curvature in the QQ-plot. My concern is that I want to use this model for prediction, which is strongly depend on the normality of the errors $\endgroup$
    – Nneka
    Commented Apr 10, 2017 at 16:16
  • 1
    $\begingroup$ How is your prediction dependent on normality? $\endgroup$
    – Aksakal
    Commented Apr 10, 2017 at 23:14

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.