DPB 1013 - Statistic Correlation and Linear Regression
DPB 1013 - Statistic Correlation and Linear Regression
CHAPTER 5
CORRELATION AND
LINEAR REGRESSION
1
LEARNING OBJECTIVES
2
INTRODUCTION
3
SCATTER DIAGRAM
y
4
SCATTER DIAGRAM
y
Negative linear
relationship
5
SCATTER DIAGRAM
a) No correlation b) Positive correlation
x x x x x
x x x x x
x x x x x
x
xx
x x
C) Negative x x
correlation x x
x
6
LINEAR CORRELATION AND
COEFFICIENT
7
PEARSON’S PRODUCT MOMENT
CORRELATION COEFFICIENT
∑xy - ∑x∑y
r= n
2 2
∑x 2- (∑x) ∑y - (∑y)
2
n n
r = correlation coefficient
n = number of observations
∑xy= number of observations
8
Magnitude of the correlation
Quantity
(‘000 unit) 25 47 35 20 37 10 12 42
(x)
Cost
(RM ‘000) 2.4 5.8 3.2 2.5 4.0 0.5 1.8 5.6
(y)
x y X2 Y2 xy
25 2.4 625 5.76 60.0
47 5.8 2209 33.64 272.6
35 3.2 1225 10.24 112.0
20 2.5 400 6.25 50.0
37
Solution; 4.0 1369 16.00 148.0
10 0.5 100 0.25 5.0
12 1.8 144 3.24 21.6
42 5.6 1764 31.36 235.2
x=228 y=25.8 x2=7836 y2=106.74 xy=904.4
11
n=8
r=
r=
r=
r=
Conclusion: positive relationship
12
SPEARMAN’S RANK MOMENT
CORRELATION COEFFICIENT
𝟔∑ 𝒅 𝟐
𝝆=𝟏 −
𝒏(𝒏¿¿ 𝟐 −𝟏)¿
= correlation coefficient
n = number of observations
d = x-y
13
Magnitude of the correlation
15
Solution :
Student A B C D E
Statistic 1 2 3 4 5
Accounting 3 1 4 2 5
d -2 1 -1 2 0
d² 4 1 1 4 0 ∑=10
𝟔∑ 𝒅 𝟐
𝝆=𝟏 −
𝒏(𝒏¿¿ 𝟐 −𝟏)¿
𝟔 𝐱 𝟏𝟎
𝝆=𝟏 −
𝟓(𝟓¿¿ 𝟐 −𝟏)¿
𝟔𝟎
𝝆 =𝟏 −
𝟓(𝟐𝟒)
0.50
16
Example
The table below shows the interest rates for car loans and the
average number of customers who apply for loans in a month
from a finance company.
Interest 6.0 6.2 6.5 6.8 7.0 7.2 7.5 7.8 8.0 8.2 8.4 8.7
rate %, x
Number of 80 80 78 75 70 60 60 55 50 48 45 40
applicants, y
17
Solution:
x y Rank of Rank of d= -
x, y,
6.0 80 12 1.5 10.5 110.25
6.2 80 11 1.5 9.5 90.25
6.5 78 10 3 7 49
6.8 75 9 4 5 25
7.0 70 8 5 3 9
7.2 60 7 6.5 0.5 0.25
7.5 60 6 6.5 -0.5 0.25
7.8 55 5 8 -3 9
8.0 50 4 9 -5 25
8.2 48 3 10 -7 49
8.4 45 2 11 -9 81
8.7 40 1 12 -11 121
=569
𝟔∑ 𝒅 𝟐
𝝆=𝟏 −
𝒏(𝒏¿¿ 𝟐 −𝟏)¿
𝟔 𝐱 𝟓𝟔𝟗
𝝆=𝟏 −
𝟏𝟐(𝟏𝟐¿ ¿𝟐 −𝟏)¿
𝝆=−𝟎 . 𝟗𝟗𝟎
19
REGRESSION LINE
Linear regression equation can be written
in the form of :
y= a + bx
∑y ∑x n∑xy - ∑x∑y
a= -b b=
n n n∑x 2 - (∑x) 2
20
Example :
Find the least squares regression line of y on x for the
following data
x 3 6 9 11 16 18
y 2 8 11 14 19 21
21
Solution :
2
x y xy x
3 2 6 9
6 8 48 36
9 11 99 81
11 14 154 121
16 19 304 256
18 21 378 324
2
∑x=63 ∑y=75 ∑xy=989 ∑x =827
22
n∑xy - ∑x∑y
b=
n∑x 2 - (∑x) 2
= 6 (989) – 63x75
6 (827) – 632
=1209
993
Thus, y= a + bx
=1.22
y= -0.31+1.22x
∑y ∑x
a= -b
n n
= 75 63
- 1.22
6 6
=- 0.31
23