27 Apr, 2016
This is how you compute the correlation $r$ of two variables $x$ and $y$.
$x$ | $y$ |
---|---|
1 | 3 |
2 | 2 |
3 | 1 |
$x$ | $y$ | |
---|---|---|
average | 2 | 2 |
SD | $\sqrt\frac{2}{3}$ | $\sqrt\frac{2}{3}$ |
$z_x$ | $z_y$ |
---|---|
$\frac{1-2}{\sqrt\frac{2}{3}} = -\sqrt\frac{3}{2}$ | $\frac{3-2}{\sqrt\frac{2}{3}} = \sqrt\frac{3}{2}$ |
0 | 0 |
$\frac{3-2}{\sqrt\frac{2}{3}} = \sqrt\frac{3}{2}$ | $\frac{1-2}{\sqrt\frac{2}{3}} = -\sqrt\frac{3}{2}$ |
Therefore, the correlation between $x$ and $y$ is -1.