0% found this document useful (0 votes)
56 views

DPB 1013 - Statistic Correlation and Linear Regression

This document discusses correlation and linear regression. It defines correlation as the relationship between two variables, which can be either positive (an increase in one causes an increase in the other) or negative (an increase in one causes a decrease in the other). It introduces Pearson's correlation coefficient and Spearman's rank correlation coefficient as methods to measure the strength of this relationship. It also discusses linear regression, defining the regression line and providing the formulas to calculate the slope and y-intercept of the line of best fit for a set of data.

Uploaded by

Adriana Zolkeply
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

DPB 1013 - Statistic Correlation and Linear Regression

This document discusses correlation and linear regression. It defines correlation as the relationship between two variables, which can be either positive (an increase in one causes an increase in the other) or negative (an increase in one causes a decrease in the other). It introduces Pearson's correlation coefficient and Spearman's rank correlation coefficient as methods to measure the strength of this relationship. It also discusses linear regression, defining the regression line and providing the formulas to calculate the slope and y-intercept of the line of best fit for a set of data.

Uploaded by

Adriana Zolkeply
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

DPB 1013 - STATISTIC

CHAPTER 5
CORRELATION AND
LINEAR REGRESSION
1
LEARNING OBJECTIVES

 Able to explain the concept of correlation


 Able to calculate Pearson’s correlation coefficient and
interpret the result
 Able to calculate Spearman’s rank correlation coefficient
and interpret the result
 Able to determine the regression equation for a set of
data and interpret the equation
 Able to use the regression equation to make forecast for
valid value of independent variable

2
INTRODUCTION

 Increase of one variable cause another variable to


increase, these two variable having a positive linear
relationship

 An increase of one variable cause another variable to


decrease, these two variable having a negative linear
relationship

3
SCATTER DIAGRAM
y

Positive linear relationship

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

 The function of linear correlation and


coefficient is to measure and evaluate the
strength of relationship
 There are two methods use :
i. Pearson’s product moment correlation
coefficient
ii. Spearman’s rank correlation 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

-1.0 < r < 1.0

Close to -1.0  strong negative relationship


 increase in one variable will cause
another variable to decrease

Close to 1.0  strong positive relationship


 increase in one variable will cause
another variable to increase

Close to 0  no linear relationship


 increase or decrease of one variable will
9 not affect other variable
 Example

Here is the data collected by a production manager


for a car parts company on the quantity of daily
output and average costs involved in production
work.

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)

Calculate the product moment correlation


coefficient. Based on calculations made, provide
conclusions about the relationship between the
quantity produced at a cost.
10
Solution :

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

-1.0 < p < 1.0

Close to -1.0  strong negative relationship


 increase in one variable will cause
another variable to decrease

Close to 1.0  strong positive relationship


 increase in one variable will cause
another variable to increase

Close to 0  no linear relationship


 increase or decrease of one variable will
14 not affect other variable
Example
 Five students A, B, C,D and E are ranked in two subjects,
Statistics and Accounting with the following results

Calculate the Spearman rank correlation coefficient and


provide conclusions about the results of calculations
obtained.
Student A B C D E
Statistic 1 2 3 4 5
Accounting 3 1 4 2 5

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

Find the spearman’s rank correlation coefficient.

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

Value of y where the Changes of y per unit


regression line intersect change in x
with axis-y

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

You might also like