Calculate the correlation coefficient from the following data, and interpret it.
X | 1 | 3 | 5 | 7 | 9 | 11 | 13 |
Y | 12 | 10 | 8 | 6 | 4 | 2 | 0 |
Solution
x_{i} | y_{i} | x_{i}^{2} | y_{i}^{2} | x_{i}y_{i} | |
1 | 12 | 1 | 144 | 12 | |
3 | 10 | 9 | 100 | 30 | |
5 | 8 | 25 | 64 | 40 | |
7 | 6 | 49 | 36 | 42 | |
9 | 4 | 81 | 16 | 36 | |
11 | 2 | 121 | 4 | 22 | |
13 | 0 | 169 | 0 | 0 | |
Total | 49 | 42 | 455 | 364 | 182 |
From the table, we have
n = 7, `sum"x"_"i"` = 49, `sum"y"_"i"` = 42, `sum"x"_"i"^2` = 455, `sum"y"_"i"^2` = 364, `sum"x"_"i""y"_"i"^2` = 182
∴ `bar"x" = (sum"x"_"i")/"n" = 49/7` = 7,
`bar"y" = (sum"y"_"i")/"n" = 42/7` = 6
Cov (X, Y) = `1/"n" sum"x"_"i""y"_"i" - bar"x" bar"y"`
= `1/7 xx 182 - (7 xx 6)`
= 26 − 42
∴ Cov (X, Y) = – 16
`sigma_"x"^2 = (sum"x"_"i"^2)/"n" - (bar"x")^2`
= `455/7 - (7)^2`
= 65 – 49
∴ `sigma_"x"^2` = 16
∴ `sigma_"x"` = 4
`sigma_"y"^2 = (sum"y"_"i"^2)/"n" - (bar"y")^2`
= `364/7 - (6)^2`
= 52 – 36
`sigma_"y"^2` = 16
∴ `sigma_"y"` = 4
Thus, the coefficient of correlation between X and Y is
r = `("Cov (X, Y)")/(sigma_"x" sigma_"y")`
= `(-16)/(4 xx 4)`
= – 1
∴ The value of r indicates perfect negative correlation between x and y.