# Linear transformation effect on Pearson's r

To my understanding multiplying all x (or all y) values in a constant will not change |r|.

I'm looking for formal proof.

• It depends on how you define $r$. (In my definition, which is a common and well-known one, $|r|$ is automatically invariant under affine transformations. It is defined in terms of the standardized values of $x$ and $y$: it is the average of their products.) What is your definition?
– whuber
Sep 23, 2015 at 16:58
• I'm talking about Pearson's r Sep 23, 2015 at 17:16
• So am I. Exactly what is your definition of it?
– whuber
Sep 23, 2015 at 17:55
• I don't think that there's more than 1 definition to Pearson's r. There's a formula, right? Sep 23, 2015 at 18:24
• Sure there's more than one! The one I am quoting is from a popular elementary statistics book (Freedman, Pisani, and Purves, Statistics, any edition). Their definition is "Convert each variable to standard units. The average of the products gives the correlation coefficient." It is mathematically equivalent to any other formula for the correlation coefficient. One advantage it has is that it shows immediately that the correlation is unchanged by any transformation of the variables that does not change their standardized values. This includes positive rescaling as well as shifting.
– whuber
Sep 23, 2015 at 18:40

You can prove it yourself by considering how the sample means and variances change under affine transformations. For instance if $X_i \mapsto aX_i +b$, then the new sample mean is just $a \bar{X}+b$. Do the same for the sample variance now and put everything into the usual quotient for the (sample) product moment correlation coefficient:
$$r=\frac{\sum_{i=1}^n \left( X_i -\bar{X} \right) \left(Y_i -\bar{Y} \right)}{\sqrt{\sum_{i=1}^n \left(X_i-\bar{X} \right)^2 \sum_{i=1}^n \left( Y_i -\bar{Y} \right)^2}}$$