# How can I check if my data-frame is normally distributed in R?

I have a data frame with 7 columns that holds numerical and integer values where some columns, even though numerical, are binary values (e.g. a dummy variable for sex; $$0=\text{male}$$, $$1=\text{female}$$).

I was asked to check if my data frame is normally distributed and if not I have to normalize it. I found that there’s two ways to check: either by visualization, or by testing. However I tried both I didn’t get the outcome I want!

• Welcome to CV. Since you’re new here, you may want to take our tour, which has information for new users. I am sure the answers below would be helpful, but you somehow answered the question in the title: you know how to check normality. However, the tests failed and visualization did not help. So, maybe you would like to edit the title to better reflect your problem. – T.E.G. Jul 1 '19 at 9:07
• @Norah Binary variables cannot be normal. Integer variables cannot actually be normal. Variables that are necessarily either positive or non-negative cannot be normal. It would be pointless to try to check what cannot be true. Even continuous variates with infinite range are almost certainly not normal. This may be of little consequence - and trying to transform your variables to achieve normality is almost certainly misguided. What led you to believe you need any of your variables to be normally distributed? – Glen_b Jul 1 '19 at 10:35
• A point of information: whoever asked you to check that your entire data frame was "normally distributed" doesn't know what they were asking, or perhaps you mis-heard them. You can check the distribution of the variables in your data frame (aka the columns). – Weiwen Ng Jul 1 '19 at 12:07

Welcome to CV!

There are several issues with your suggested approach:

• Contrary to what the name suggests, normalization will not turn an arbitrarily distributed variable into a normally distributed one.
• Neither can normality testing tell you that your data are normally distributed (only whether there is a significant deviation from normality).
• Finally, data need rarely be normally distributed. It is also unlikely any of your data truly are normally distributed in the first place. You mentioned an integer variable, this can't be exactly normal, because the normal distribution is continuous, from $$-\infty$$ to $$+\infty$$. The same goes for the binary variable. Rather, it is common for models to assume the conditional distribution of the outcome variable to be approximately normally distributed.

As to what approach is best, you may want to have a look here for starters.