To calculate the regression line using the Z-score approach, you'll need some to generate some tables:
x | (x - xmean) | Zx | (x-xmean)^2 | y | (y-ymean) | Zy | (y-ymean)^2 | Zx Zy |
5 | 6 | |||||||
1 | 0 | |||||||
10 | 8 | |||||||
4 | 6 | |||||||
20 | 20 |
[That last row gives the totals.] Thus xmean = 20/4 = 5.0 and ymean = 20/4 = 5.0.
x | (x - xmean) | Zx | (x-xmean)^2 | y | (y-ymean) | Zy | (y-ymean)^2 | Zx Zy |
5 | 0 | 0 | 6 | 1 | 1 | |||
1 | -4 | 16 | 0 | -5 | 25 | |||
10 | 5 | 25 | 8 | 3 | 9 | |||
4 | 1 | 1 | 6 | 1 | 1 | |||
20 | 0 | 42 | 20 | 0 |
36 |
Thus the standard deviation of x is sqrt(42/(4-1))=sqrt(14) = 3.74, while the standard deviation of y is sqrt(36/(4-1))= sqrt(12) = 3.46.
Now we can calculate Zx = ( x - 5.0) / 3.74 and Zy = (y - 5.0) / 3.46.
x | (x - xmean) | Zx | (x-xmean)^2 | y | (y-ymean) | Zy | (y-ymean)^2 | Zx Zy |
5 | 0 | 0.00 | 0 | 6 | 1 | 0.29 | 1 | 0.000 |
1 | -4 | -1.07 | 16 | 0 | -5 | -1.44 | 25 | 1.543 |
10 | 5 | 1.34 | 25 | 8 | 3 | 0.87 | 9 | 1.158 |
4 | 1 | -0.27 | 1 | 6 | 1 | 0.29 | 1 | -0.077 |
20 | 0 | 0 | 42 | 20 | 0 |
0 | 36 | 2.623 |
Finally, we have the correlation r = 2.623 / (4-1) = 0.874.
With these numbers calculated, we can proceed to calculate the regression line (on the original scale) here.