Lecture 14 (6)
Lecture 14 (6)
Correlation
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 1
DEFINITION
A correlation exists between two variables when
the values of one variable are somehow
associated with the values of the other variable.
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 2
Linear Correlation
DEFINITION
A linear correlation exists between two variables
when there is a correlation and the plotted points
of paired data result in a pattern that can be
approximated by a straight line.
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 3
Scatter Diagram and correlation coefficient:
A scatter diagram reveals relationships or association
between two variables.
This diagram is drawn with two variables, usually the
first variable is independent 𝑋 and the second variable is
dependent 𝑌 on the first variable.
If the variables are correlated, the points will fall along
a line (or curve). The better the correlation, the tighter
the points will hug the line.
According to the type of correlation, scatter diagrams
can be divided into following categories:
Scatter Diagram with No Correlation
Scatter Diagram with perfect Linear Correlation
Scatter Diagram with Strong Linear Correlation
Scatter Diagram with Weak Linear Correlation
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 4
A perfect positive correlation is given A perfect negative correlation is Low positive correlation is given the
the value of 1. given the value of -1. value close to 0.
High positive correlation is given the High negative correlation is Low negative correlation is given
value close to 1. given the value close to -1. the value close to 0.
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 5
Correlation
Pearson correlation coefficient
The degree of relationship between the variables under consideration is
measure through the correlation analysis. The measure of correlation called
the correlation coefficient (r). Also called Pearson product-moment
correlation coefficient.
For a set of 𝑛 data points, the linear correlation coefficient is defined by
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 6
The values of the coefficient vary from –1, which indicates perfect
negative correlation, to +1, which indicates perfect positive correlation.
A value closer to 1 it indicates a strong positive relationship, a value of
0 indicates that there is no relationship. Values close to -1 signal a
strong negative relationship between the two variables.
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 7
This Correlation Coefficient takes values between (0-1),
positive Or negative. That is, r = ( from -1 up to +1).
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 8
Example :
X 7 4 4 20 10 12 0 11 10 9 2 1
Y 6 4 5 2 3 1 10 4 5 2 8 9
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 9
Solution
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 10
X Y XY X2 Y2
7 6 42 49 36
4 4 16 16 16
4 5 20 16 25
20 2 40 400 4
10 3 30 100 9
12 1 12 144 1
0 10 0 0 100
11 4 44 121 16
10 5 50 100 25
9 2 18 81 4
2 8 16 4 64
1 9 9 1 81
90 59 297 1032 381
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 11
σ𝒙σ𝒚
σ 𝒙𝒚 −
r= 𝟐
𝒏
𝟐
(σ 𝒙) (σ 𝒚)
[σ 𝒙𝟐 − ] [σ 𝒚𝟐 − ]
𝒏 𝒏
𝟐𝟗𝟕 −
90x59
𝟏𝟐
r=
𝟗𝟎𝟐 𝟓𝟗𝟐
[𝟏𝟎𝟑𝟐 − ][𝟑𝟖𝟏 − ]
𝟏𝟐 𝟏𝟐
r = −𝟎. 𝟖𝟎𝟖
Comment:
The linear correlation coefficient, r = −0.808, suggests a very strong
negative linear correlation between reading hours and score.
In particular, it indicates that as reading hours increases, there is a
strong tendency for score to decrease.
Because the correlation coefficient, r = −0.808, is quite close to −1,
the data points should be clustered closely about the regression line
Always Learning © 2023 Pearson Education Ltd. All Rights Reserved. Slide 12