Chapter 4 - Correlation
Chapter 4 - Correlation
Correlation
𝑟 = 𝑐𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑐𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡
𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑏𝑠𝑒𝑟𝑣𝑎𝑡𝑖𝑜𝑛𝑠
𝑥𝑦 = 𝑠𝑢𝑚 𝑜𝑓 𝑡ℎ𝑒 𝑝𝑟𝑜𝑑𝑢𝑐𝑡 𝑜𝑓 𝑥 𝑎𝑛𝑑 𝑦
The properties of r are:
a) -1 r 1
b) if r 0, it indicates a positive linear relationship
between X and Y.
c) if r 0, it indicates a negative linear relationship
between X and Y.
d) if r = 0, it implies that Y is unaffected (linearly) by
the change of X i.e. there is no linear
relationship between X and Y.
e) when r is near zero, X and Y has a weak linear
relationship; when r is near –1 or 1, X and Y has
a strong (perfect) linear relationship.
Example: Calculate Pearson’s product moment
correlation coefficient r, for the following set of
data.
x 3 5 8 10 13 15 18 20 28
y 30 35 41 50 51 60 65 66 70
Solution:
Expand the table to include the values of 𝑥 2 , 𝑦 2 and 𝑥𝑦.
𝒙 𝒚 𝒙𝟐 𝒚𝟐 𝒙𝒚
3 30 9 900 90
5 35 25 1225 175
8 41 64 1681 328
10 50 100 2500 500
13 51 169 2601 663
15 60 225 3600 900
18 65 324 4225 1170
20 66 400 4356 1320
28 70 784 4900 1960
σ 𝒙 = 𝟏𝟐𝟎 σ 𝒚 = 𝟒𝟔𝟖 σ 𝒙𝟐 = 𝟐𝟏𝟎𝟎 σ 𝒚𝟐 = 𝟐𝟓𝟗𝟖𝟖 σ 𝒙𝒚 = 𝟕𝟏𝟎𝟔
Apply the formula:
9 7106 − (120)(468)
𝑟= = 0.953
9 2100 − 1202 9 25988 − 4682
6Σ𝑑𝑖 2 6 10
ρ=1− 2 =1 − = 0.50
𝑛(𝑛 −1) 5 52 −1
The value of Spearman’s rank correlation coefficient is 0.50. this shows that there is a
Weak positive linear relationship between the scores of Statistics and Computer
Programming.
End of Chapter 4
☺