1
$\begingroup$
  • 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?
$\endgroup$
  • $\begingroup$ 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?) $\endgroup$ – Glen_b Apr 10 '16 at 23:47
  • $\begingroup$ Sorry, I mean two variables with a Pearson's r of 0. $\endgroup$ – Auguste Baudin Apr 10 '16 at 23:58
  • $\begingroup$ 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? $\endgroup$ – Glen_b Apr 11 '16 at 0:05
  • $\begingroup$ Two different questions. $\endgroup$ – Auguste Baudin Apr 11 '16 at 0:05
1
$\begingroup$
  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)
    [1] -9.892917e-18
     cor(log(x),log(y))
    [1] -0.379543
    

    Another example:

    x = runif(1000000)
    y = runif(1000000,0,sqrt(.25-(x-.5)^2))
    

    enter image description here

    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.
$\endgroup$
  • $\begingroup$ Thanks! Regarding the first answer, is this always the case? Or are there instances where transforming does not affect the correlation? $\endgroup$ – Auguste Baudin Apr 11 '16 at 0:34
  • $\begingroup$ @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.) $\endgroup$ – Glen_b Apr 11 '16 at 0:36

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.