0% found this document useful (0 votes)
4 views16 pages

CORRELATION1

Uploaded by

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

CORRELATION1

Uploaded by

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

CORRELATION

This is defined as the relationship that exists between two or variables


which are usually the independent variable (X) and dependent
variable (Y).

A correlation coefficient is denoted “r” and defined by the formula


below;
𝑛 𝑛 𝑛
𝑛 𝑖=1 𝑥𝑦 − 𝑖=1 𝑋 𝑖=1 𝑌
r= , where n=number of
𝑛 𝑛 𝑛 𝑛
𝑛 𝑖=1 𝑋2− 𝑖=1 𝑋 2 𝑛 𝑖=1 𝑌2− 𝑖=1 𝑌 2

observations in the variables.

The above formula is also known as Pearson Product Moment


Correlation coefficient.

A correlation coefficient measures the degree of linear relationship

that exists between two variables and it takes the range of value

−1 ≤ 𝑟 ≤ +1.
CORRELATION
If X and Y have a strong negative linear correlation, r is close
to −1. If X and Y have a perfect positive linear correlation or
a perfect negative linear correlation, r is equal to +1 or −1
respectively. If there is no linear correlation or a weak linear
correlation, r is close to 0.

NOTE: If r is close to o, it does not mean that there is no

correlation between X and Y. It signifies there is no linear

relationship.
CORRELATION
Example 1

The data below shows the GDP (billion naira) and Carbon-dioxide emission (million metric
tones) for Nigeria. Determine whether there exists negative or positive linear correlation or
no linear correlation.

GDP X Carbondioxide Y
1.6 428.2
3.6 828.8
4.9 1214.2
1.1 444.6
0.9 264.0
2.9 415.3
2.7 571.8
2.3 454.9
1.6 358.7
1.5 573.5
CORRELATION
Solution

S/N GDP X Carbon XY 𝑿𝟐 𝒀𝟐


dioxide Y
1 1.6 428.2 685.12 2.56 183,355.24
2 3.6 828.8 2983.68 12.96 686,909.44
3 4.9 1214.2 5949.58 24.01 1,474,281.64
4 1.1 444.6 489.06 1.21 197,669.16
5 0.9 264.0 237.6 0.81 69,696
6 2.9 415.3 1204.37 8.41 172,474.09
7 2.7 571.8 1543.86 7.29 326,955.24
8 2.3 454.9 1046.27 5.29 206,934.01
9 1.6 358.7 573.92 2.56 128,665.69
10 1.5 573.5 860.25 2.25 328,902.25
Total 𝑿 𝒀 𝑿𝒀 𝑿𝟐 𝒀𝟐
= 𝟐𝟑. 𝟏 = 𝟓𝟓𝟓𝟒 = 𝟏𝟓, 𝟓𝟕𝟑. 𝟕𝟏 = 𝟔𝟕. 𝟑𝟓 = 𝟑, 𝟕𝟕𝟓, 𝟖𝟒𝟐. 𝟕𝟔

N= 10,

𝑛 𝑛 𝑛
𝑛 𝑖=1 𝑥𝑦 − 𝑖=1 𝑋 𝑖=1 𝑌
r=
𝑛 𝑛 2 𝑛 𝑋 2 − 𝑛 𝑛 2 𝑛 𝑌 2
𝑖=1 𝑋 − 𝑖=1 𝑖=1 𝑌 − 𝑖=1
Solution (Cont’d)

10 15,573.71 − 23.1 5554


r=
10 67.35 −23.12 10 3,77,842.76 −5554 2

27,439.7
r= = 0.882
139.89 6,911,5116

Interpretation: As the gross domestic product increases, the carbon dioxide emissions also

increase.
CORRELATION

Example 2

Find the coefficient of linear correlation between the variables

“X” and “Y” presented below.

X 1 3 4 6 8 9 11 14
Y 1 2 4 4 5 7 8 9
CORRELATION
Solution

S/N X Y XY 𝑿𝟐 𝒀𝟐
1 1 1 1 1 1
2 3 2 6 9 4
3 4 4 16 16 16
4 6 4 24 36 16
5 8 5 40 64 25
6 9 7 63 81 49
7 11 8 88 121 64
8 14 9 126 196 81
Total 𝑿 = 𝟓𝟔 𝒀 = 𝟒𝟎 𝑿𝒀 𝑿𝟐 𝒀𝟐
= 𝟑𝟔𝟒 = 𝟓𝟐𝟒 = 𝟐𝟓𝟔

𝑛 𝑛 𝑛
𝑛 𝑖=1 𝑥𝑦 − 𝑖=1 𝑋 𝑖=1 𝑌
r= , n=8
𝑛 𝑛 2 𝑛 𝑋 2 − 𝑛 𝑛 2 𝑛 𝑌 2
𝑖=1 𝑋 − 𝑖=1 𝑖=1 𝑌 − 𝑖=1
Solution (Cont’d)
8 364 − 56 40
r=
8 524 −56 2 8 256 −40 2

2912−2240 672 672


r= = =
√ 1,056 448 √473,088 687.814

r = 0.977

Interpretation

This indicates a very strong positive linear relationship between the variable. As “X”

increases, “Y” increases.


SPEARMAN RANK CORRELATION

Sometimes, we come across data that violate the assumptions

of parametric statistics. In such situation, the use of the parson

product moment correlation coefficient becomes

inappropriate. The Spearman rank correlation coefficient can

be used in such situations. The spearman rank correlation

coefficient involves ranking of the bivariate data set and in

cases where there are ties, the average of the rank is taken.

Spearman rank correlation coefficient takes values from -1 to

+1
SPEARMAN RANK CORRELATION

The spearman rank correlation coefficient denoted 𝑟 is

defined as;

6 𝑑2
𝑟 = 1 − 𝑛 (𝑛 2 −1)

Where d is the difference between the pair of ranks and n is

the sample size.


SPEARMAN RANK CORRELATION
Example

The table below shows the number of malaria infected individuals for

males and females. Obtain the spearman rank correlation coefficient.

S/N Male Female


1 35.8 36.4
2 36.3 36.9
3 36.8 37.3
4 37.3 37.6
5 37.4 38.0
6 37.4 38.4
7 37.2 38.0
8 37.6 38.4
SPEARMAN RANK CORRELATION
Solution

S/N Male Rank Female Rank d 𝑑2


1 35.8 1 36.4 1 0 0
2 36.3 2 36.9 2 0 0
3 36.8 3 37.3 3 0 0
4 37.3 5 37.6 4 1 1
5 37.4 6.5 38.0 5.5 1 1
6 37.4 6.5 38.4 7.5 -1 1
7 37.2 4 38.0 5.5 -1.5 2.25
8 37.6 8 38.4 7.5 0.5 0.25
𝑑2
= 5.5

n=8.

6 𝑑2
𝑟 =1−
𝑛(𝑛2 − 1)
Solution (Cont’d)

6(5.5)
𝑟 =1− = 0.935
8(82 − 1)

Interpretation: This shows a strong positive relationship

between male and female malaria infection


SPEARMAN RANK CORRELATION
Example 2

Calculate the spearman’s rank correlation coefficient between

antimalaria cost and sales from the following data;

S/N Antimalaria cost(x) Sales(y)


1 39 47
2 65 53
3 62 58
4 90 86
5 82 62
6 75 68
7 25 60
8 98 91
9 36 51
10 78 84
SPEARMAN RANK CORRELATION
Solution

S/N Antimalaria Sales(y) Rank(x) Rank d = 𝑑2


cost(x) (y) Rank(x)-
Rank(y)
1 39 47 8 10 -2 4
2 65 53 6 8 -2 4
3 62 58 7 7 0 0
4 90 86 2 2 0 0
5 82 62 3 5 -2 4
6 75 68 5 4 1 1
7 25 60 10 6 4 16
8 98 91 1 1 0 0
9 36 51 9 9 0 0
10 78 84 4 3 1 1
𝑑2
= 30
n=10

6 𝑑2
𝑟 =1−
𝑛(𝑛2 − 1)
Solution (Cont’d)

6(30)
r=1− 2
= 0.82
10(10 − 1)

You might also like