1
$\begingroup$

I've created a histogram as well as a QQPlot from the residuals of my Regression Model:

Mean: 0.35 Standard Deviation: 18.14

QQPlot Histogram

Judging from these plots, is it okay to say that my residuals are normally distributed? Or what else can I draw from these plots?

Update: Created the Histogram using

ns.distplot(x, hist=True)

Here's the result: https://i.imgur.com/xWdchCB.png

$\endgroup$
5
  • $\begingroup$ I think it is fair to say that you residuals are normally distributed. $\endgroup$
    – Peter
    Dec 24, 2020 at 13:51
  • $\begingroup$ thanks for your reply! The outlier in the bottom left corner worries me a little, what can be the reason for this? $\endgroup$
    – 0009
    Dec 24, 2020 at 13:58
  • $\begingroup$ I added a new Histogram that I created using: ns.distplot(x, hist=True) $\endgroup$
    – 0009
    Dec 24, 2020 at 17:23
  • $\begingroup$ The outlier (one I guess) is really in the left tail of the distribution. I don‘t know what you are up to, but I think it is still save to claim that the errors are well approximated by a normal distribution. $\endgroup$
    – Peter
    Dec 24, 2020 at 17:47
  • $\begingroup$ I see, thanks! The thing that worries me is that the tests for normal distribution don't 'classify' my data as normally distributed. But I've researched a little and found that those tests aren't necessarily useful when it comes to determining whether data is normally distributed. Would you agree with that? (Check, for example the answer from Julio below= $\endgroup$
    – 0009
    Dec 24, 2020 at 22:42

1 Answer 1

0
$\begingroup$

You can perform a statistical test to confirm your data is normally distributed Try:

from scipy import stats

np.random.seed(42)
x = np.random.normal(2, 1, size=1000)
k2, p = stats.normaltest(x)
alpha = 0.001
print("p = {:g}".format(p))

if p < alpha:  # null hypothesis: x comes from a normal distribution
    print("The null hypothesis can be rejected")
else:
    print("The null hypothesis cannot be rejected")

This function tests the null hypothesis that a sample comes from a normal distribution. It is based on D’Agostino and Pearson’s test that combines skew and kurtosis to produce an omnibus test of normality.

$\endgroup$
12
  • $\begingroup$ Thanks for the reply! I get the following results: p = 3.24783e-17 The null hypothesis can be rejected Is it safe to say that the data does not follow a normal distribution even though the plots look like it does? $\endgroup$
    – 0009
    Dec 24, 2020 at 16:57
  • $\begingroup$ I also added the new Histogram created using ns.distplot(x, hist=True) $\endgroup$
    – 0009
    Dec 24, 2020 at 17:23
  • $\begingroup$ @0009 Formal hypothesis for distribution fits it surprisingly unhelpful. See this answer from today: stats.stackexchange.com/a/502264/247274. $\endgroup$
    – Dave
    Dec 24, 2020 at 23:06
  • $\begingroup$ thank you very much, that is very helpful! This means that I can deduce normal distribution just from my histogram and QQPlot? $\endgroup$
    – 0009
    Dec 26, 2020 at 14:44
  • $\begingroup$ 0009 - What you stated in the last comment is completely out of reason. And Dave's situation is not an argument to establish that you should not use a statistical test since in there, It is only shown a single case in which a single test failed to correctly assess normality, what does not mean any test is useless $\endgroup$
    – Multivac
    Dec 26, 2020 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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