# Transforming Power and Exponential Functions

• Suppose two variables x and y have no linear correlation. If we transform the data by replacing each y value with its base-10 logarithm, then will x and log $y$ also have zero correlation?
• In transforming a power function, does the base $c$ for log$_c$ $y$ and for log$_c$ $x$ matter? Can any $c$ greater than 0 be used?
• It's not clear what, exactly "no correlation (not necessarily linear)" encompasses. Do you intend independence or something weaker than independence? (and if so, what, exactly?) – Glen_b Apr 10 '16 at 23:47
• Sorry, I mean two variables with a Pearson's r of 0. – Auguste Baudin Apr 10 '16 at 23:58
• Do the questions in the second bullet point apply only to the situation in the first bullet point or is that an entirely new question? – Glen_b Apr 11 '16 at 0:05
• Two different questions. – Auguste Baudin Apr 11 '16 at 0:05

1. No -- the correlation can be non-zero.

Here's an example in R:

x = (0:10) + 0.003
y = 1 + (x-mean(x))^2
cor(x,y)
 -9.892917e-18
cor(log(x),log(y))
 -0.379543


Another example:

x = runif(1000000)
y = runif(1000000,0,sqrt(.25-(x-.5)^2)) Note that if $X$ and $Y$ are independent (and I assume positive, so you can take logs), then $\log(X)$ and $\log(Y)$ will also be independent, but in general it's not the case that you can take logs of uncorrelated variables and still have them uncorrelated.

1. Changing the base of the log only changes the result by a constant scaling factor. So anything that is unaffected by changing the scale will not be affected by changing the base of the logarithm.
• Thanks! Regarding the first answer, is this always the case? Or are there instances where transforming does not affect the correlation? – Auguste Baudin Apr 11 '16 at 0:34
• @auguste Yes, there are cases where transforming doesn't affect the correlation. For example, if the two variables are independent, it will always be the case. (This is why I was careful to ask about your intended meaning in the initial post.) – Glen_b Apr 11 '16 at 0:36