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

Chapter 4 - Correlation

Uploaded by

maizon.darus
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Chapter 4 - Correlation

Uploaded by

maizon.darus
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Chapter 4

Correlation

Limkokwing University of Creative Technology (LUCT)


INTRODUCTION
• Sometimes two variables are found to relate to each
other in some ways. A change of one variable might cause
another variable to change due to the influence of the first
variable on the second variable.
• For example, an increase in the price of sugar may
cause the price of certain foods to increase. Higher
sugar prices cause the production costs of these foods to
increase, therefore food manufacturers have to increase
their selling price.
• The same applies when petroleum price increases.
Petroleum price affects the prices of other commodities,
products and services, resulting in a series of chain
reactions. Higher fuel prices cause energy prices to
increase, therefore producers need to increase the selling
price of their products and services to cover the escalating
operating costs.
INTRODUCTION
• From the above examples we can conclude two
things. First, when an increase in one variable causes
another variable to increase, these two variables are
said to have a positive linear relationship, for
example, sugar price and food price.

• Secondly, an increase of one variable may cause


another variable to decrease, for example, the
relationship between energy prices and companies’
profits. These two variables are said to have a
negative relationship.
• Correlation analysis is a statistical method used to
measure the strength of the relationship between two
variables.
Linear Correlation Coefficient using
Pearson’s Product Moment
• Correlation is to measure the strength of the linear
relationship between 2 random variables, say X and Y using
Pearson’s Product Moment Correlation Coefficient 𝑟 .

𝑟 = 𝑐𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑐𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡
𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑏𝑠𝑒𝑟𝑣𝑎𝑡𝑖𝑜𝑛𝑠
෍ 𝑥𝑦 = 𝑠𝑢𝑚 𝑜𝑓 𝑡ℎ𝑒 𝑝𝑟𝑜𝑑𝑢𝑐𝑡 𝑜𝑓 𝑥 𝑎𝑛𝑑 𝑦
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

Since the value of r is close to 1.0, we conclude that


there is very strong positive linear relationship
between the variables x and y.
Linear Correlation Coefficient
Linear Correlation Coefficient using
Spearman’s Rank
• Correlation is to measure the strength of the linear
relationship between 2 random variables, say X and Y using
Spearman’s Rank Correlation Coefficient ρ .
2
6Σ𝑑𝑖
ρ=1−
𝑛(𝑛2 − 1)
𝑟 = 𝑐𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑐𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡
𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑏𝑠𝑒𝑟𝑣𝑎𝑡𝑖𝑜𝑛𝑠
𝑑𝑖 = 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑡𝑤𝑜 𝑟𝑎𝑛𝑘𝑠
The properties of r are:
a) -1  ρ  1
b) if ρ  0, it indicates a positive linear relationship
between X and Y.
c) if ρ  0, it indicates a negative linear relationship
between X and Y.
d) if ρ = 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 ρ is near zero, X and Y has a weak linear
relationship; when ρ is near –1 or 1, X and Y has
a strong (perfect) linear relationship.
Example: Calculate Spearman’s rank correlation
coefficient ρ, for the following set of data.
Subject A B C D E
Statistics 1 2 3 4 5
Computer 3 1 4 2 5
Programming
Solution:
Expand the table to include the values of 𝑑𝑖 and 𝑥𝑦.
Let statistics = x, and
Computer programming = y
Subject A B C D E
Statistics 1 2 3 4 5
Computer Programming 3 1 4 2 5
𝑑𝑖 = 𝑥 − 𝑦 -2 1 -1 2 0
𝑑𝑖 2 4 1 1 4 0 Σ𝑑𝑖 2 =10

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

You might also like