# Find the correlation coefficient

In studying the relation between the two variables $x$ and $y$ , if the equation of the regression line of $y$ on $x$ was $$y=0.421x+0.67$$ and the equation of the regression line of $x$ on $y$ was $$x=1.58y+3.9$$ \Find\ \ The linear correlation coefficient between $x$ and $y$ My solution is $$r= \pm\sqrt{0.421\times 1.58}= \pm0.8155$$ Does my solution correct or i would not take the negative value into account ?

• How did you arrive at that solution? – Jon Bown May 22 '18 at 22:40
• From the formula of the regression coefficient if we multiply the two equations of the regression coefficient in the two cases we will get the square of the formula of the linear correlation coefficient @JonBown – Hussien Mohamed May 22 '18 at 22:43

You are right, but you can find the sign too.

The correlation coefficient of $x$ and $y$ is $\dfrac{\operatorname{cov}(x,y)}{\sqrt{\operatorname{var}(x)\operatorname{var}(y)}}$.

The slope in the regression $y=ax+b$ is given by $a=\dfrac{\operatorname{cov}(x,y)}{\operatorname{var}(x)}$.

Likewise, the slope in the regression $x=a'y+b'$ is given by $a'=\dfrac{\operatorname{cov}(x,y)}{\operatorname{var}(y)}$.

Hence the correlation coefficient is $\pm\sqrt{aa'}$. But it's also of the same sign as $a$ (or $a'$), hence positive here.

• do you mean the sign of the correlation coefficient is always the same the sign of any one the two regression coefficients ?@Jean-Claude Arbaut – Hussien Mohamed May 22 '18 at 22:47
• @HussienMohamed From the formula, yes, because $var(x)$ is always positive. The sign of the correlation tells you if the relation is increasing or decreasing. – Stop hurting Monica May 22 '18 at 22:48
• Thank, but i have another question , why if y=f(x) is the equation of the regression line of y on x $$f^{-1}(y) =x$$ is not the equation of the regression line of x on y ? @Jean - Claude – Hussien Mohamed May 22 '18 at 22:53
• @HussienMohamed Because in the least squares regression of $y$ vs $x$, you measure errors parallel to the $y$ axis. The other regression measures errors parallel to the $x$ axis. Not the same errors, hence not the same regression. There is a variant called Deming regression where you measure errors by orthogonal projection on the regression line: then the relation you seek is true. – Stop hurting Monica May 22 '18 at 22:56
• Thank you sir @Jean - Claude – Hussien Mohamed May 22 '18 at 22:58

The two least-squares line are:

$$y=0.421x+0.67 \\ x=1.58y+3.9$$

You should have $$\frac{y-\nu}{\tau} = \rho\left( \frac{x-\mu} \sigma \right) \\ \frac{x-\mu}\sigma = \rho\left( \frac{y-\nu} \tau \right)$$ where

• $\mu$ is the average $x$-value,
• $\nu$ is the average $y$-value,
• $\sigma$ is the standard deviation of the $x$-values,
• $\tau$ is the standard deviation of the $y$-values,
• $\rho$ is the correlation.

Thus \begin{align} & \frac{\rho\tau} \sigma = 0.421, \\[10pt] & \frac{\rho\sigma} \tau = 1.58. \end{align} Multiplying left sides and right sides, you get $\rho^2 = 0.421\times 1.58.$

But notice also that $\rho$ must be positive since the slopes are positive.