In: Math
2. Consider the following data:
x= 1, 2, 3, 4, 5
y =3, 2, 4, 6, 5
By hand, not using Matlab, and showing your work:
(a) Compute the correlation coefficient.
(b) Find the least-squares line.
(c) Find the standard deviation around the least-squares line.
(a) The correlation coefficient is 0.8.
(b) The least-squares line is:
y = a + bx = 1.6 + 0.8x
(c) Standard deviation = 1.58
The calculations are:
x | y | (x-xMean) | (y-yMean) | (x-xMean)*(y-yMean) | (x-xMean)² | zx | zy | zx*zy | |
1 | 3 | -2 | -1 | 2 | 4 | -1.26491 | -0.63246 | 0.8 | |
2 | 2 | -1 | -2 | 2 | 1 | -0.63246 | -1.26491 | 0.8 | |
3 | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
4 | 6 | 1 | 2 | 2 | 1 | 0.632456 | 1.264911 | 0.8 | |
5 | 5 | 2 | 1 | 2 | 4 | 1.264911 | 0.632456 | 0.8 | |
Mean | 3 | 4 | 0 | 0 | 8 | 10 | 3.2 | ||
Std Dev. | 1.581139 | 1.581139 | |||||||
b | 0.8 | ||||||||
a | 1.6 | ||||||||
r | 0.8 |
The formulas are:
Correlation coefficient = zx*zy/n-1 n = 5 in this case