# scale in R with no normal distribution

The function called scale, in R, does the same of subtracting the mean and dividing by the sd each element.

So the scale function allows to take in count differente parameter with different scale.

# Manually scaling (x - mean(x)) / sd(x)

# Default scaling scale(x)

But, does it make sense scale a variable if it doesn't have a normal distribution?

Andrea

• This is not a good question for stackoverflow since it is not a coding question. Apr 22, 2016 at 14:55
• It depends on your purpose. In general answer is no. But for representation - why not. Apr 22, 2016 at 15:27
• I'm not sure if this is the issue, but keep in mind that, if you've got data, you can compute the mean and standard deviation. Then you can subtract the mean from each point and divide by the standard deviation. Now you've got a new data set with mean 0 and standard deviation 1, which is often helpful and the reason we do scaling in the first place. As User7598 noted, scaling doesn't change many of the other useful things we want to know about that data, so it's a nice way to make your data more digestible without altering it in a bigger way (like doing a log transform). Apr 22, 2016 at 15:49
• @German "In general" the answer is yes! When the units in which we measure a variable are arbitrary--pounds or drams, angstroms or parsecs--then scaling the variable is an essential mechanism to convert between units. Only when the units have intrinsic meaning (such as counts) would the meaningfulness of scaling be questionable.
– whuber
Apr 22, 2016 at 16:23
• I think I would agree with you, @German, understanding that by "z-score" you mean computing a standardized value with the intention of referring it to a standard Normal distribution. But the current question appears to comprise a large set of more benign applications, ranging from standardizing regression residuals, to understanding correlation in terms of mean products of standardized variables, to stabilizing numerical algorithms, and many more situations where the Normal distribution is neither used nor considered relevant.
– whuber
Apr 22, 2016 at 22:09

Scaling a variable is a linear transformation and it will not change the distribution of the variable so it does not matter if the variable has a non-normal distribution.

You can confirm this by generating non-normally distributed data in R, such as: X=rnorm(10000,10,5)^2. Then, scale the variable "X" X.z = scale(x)

Comparing the two histograms: hist(X) vs. hist(X.z) you'll see the distributions are unchanged.

EDIT: As noted in the comments, scaling does influence the interpretation of the parameters when doing many statistical analyses (regression, PCA etc) so the decision to scale should be based on how you want to interpret your parameters.

However, scaling will not change the underlying distribution of the variable nor will it influence (positively or negatively) the violations of model assumptions. For example, an assumption of linear regression is normality of the residuals scaling a raw variable will not affect this normality.

• Although the shapes of distributions are unchanged by scaling, the distributions themselves are definitely changed. This might sound like a nit-pick until you contemplate operations like scaling a Poisson distribution: suddenly it's no longer a Poisson distribution at all.
– whuber
Apr 22, 2016 at 16:25
• If isn't a normal distribution, it isn't right to apply a scaling before a Principal Component Analisys process. Apr 27, 2016 at 16:35