Suppose that we have two vectors $x=(x_1,\ldots,x_n),y=(y_1,\ldots,y_n)$ is the following correct about their Pearson correlation coefficient?
$\operatorname{corr}(x,y)=\operatorname{corr}(x+a,y+b)$ where $a$ and $b$ are non-zero real numbers.
Suppose that we have two vectors $x=(x_1,\ldots,x_n),y=(y_1,\ldots,y_n)$ is the following correct about their Pearson correlation coefficient?
$\operatorname{corr}(x,y)=\operatorname{corr}(x+a,y+b)$ where $a$ and $b$ are non-zero real numbers.
Copyright © 2021 JogjaFile Inc.
Yes. This is because if $\mu_x$ is the mean of $x$, then $\mu_x^*=\mu_x+a$ is the mean of $x+a$. In the calculation of the correlation you subtract the mean. So if you define $x^*=x+a$ and $y^*=y+b$, then it can easily be seen:
$$ \begin{align} \frac{E[(x-\mu_x)(y-\mu_y)]}{\sigma_x\sigma_y}=\frac{E[((x+a)-(\mu_x+a))((y+b)-(\mu_y+b))]}{\sigma_x\sigma_y}=\frac{E[(x^*-\mu^*_x)(y^*-\mu^*_y)]}{\sigma_x\sigma_y} \end{align} $$