0% found this document useful (0 votes)
15 views30 pages

Correlation and Regression 2 1

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)
15 views30 pages

Correlation and Regression 2 1

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/ 30

QUANTITATIVE METHODS FOR BUSINESS DECISIONS

(GSU 07204)

CORRELATION AND REGRESSION

MR. MOHAMED K. MWANGA

INSTITUTE OF ACCOUNTANCY ARUSHA


DEPARTMENT OF GENERAL STUDIES

April 18, 2023

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 1 / 30


Contents

1 CORRELATION

2 REGRESSION

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 2 / 30


CORRELATION

CORRELATION

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 3 / 30


CORRELATION

What is Correlation

Correlation is a statistical measure that


expresses the extent to which two variables are
linearly related.
It’s a common tool for describing simple
relationships without making a statement about
cause and effect.
In statistics, Correlation studies and measures
the direction and extent of relationship among
variables. So it measures co-variation.
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 4 / 30
CORRELATION

correlation Coefficient

Correlation is measured by correlation


coefficient r
The correlation coefficient is a statistical
measure of the strength of a linear relationship
between two variables.
Its values can range from -1 to 1.

The correlation coefficient describes how one


variable moves in relation to another.
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 5 / 30
CORRELATION

Types of Correlation

A correlation may be positive, negative or Zero


Correlation
Positive Correlation: when the values of the
two variables move in the same direction so
that an increase/decrease in the value of one
variable is followed by an increase/decrease in
the value of the other variable.

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 6 / 30


CORRELATION

Types of Correlation

Negative Correlation: when the values of the


two variables move in the opposite direction so
that an increase/decrease in the value of one
variable is followed by decrease/increase in the
value of the other variable.
No Correlation (Zero correlation): when there
is no linear dependence or no relation between
the two variables.
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 7 / 30
CORRELATION

Types of Correlation

Correlation may ne presented in a graph called


Scatter Plot.

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 8 / 30


CORRELATION

Calculation of the correlation coefficient

Correlation coefficient can be calculated using


several methods such as pearson correlation
coefficient and Spearman rank order method.
Pearson correlation coefficient
Pearson correlation coefficient is given as
P P P
n xy − x y
r=q P
[n x2 − ( x)2][n y 2 − ( y)2]
P P P

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 9 / 30


CORRELATION

Calculation of the correlation coefficient

Using the data below calculate the pearson correlation coefficient


Temperature °C Ice Cream Sales
14.2° $215
16.4° $325
11.9° $185
15.2° $332
18.5° $406
22.1° $522
19.4° $412
25.1° $614
23.4° $544
18.1° $421
22.6° $445
17.2° $408
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 10 / 30
CORRELATION

Calculation of the correlation coefficient

S/No x y xy x2 y2
1 14.2 215 3,053.0 201.64 46,225
2 16.4 325 5,330.0 268.96 105,625
3 11.9 185 2,201.5 141.61 34,225
4 15.2 332 5,046.4 231.04 110,224
5 18.5 406 7,511.0 342.25 164,836
6 22.1 522 11,536.2 488.41 272,484
7 19.4 412 7,992.8 376.36 169,744
8 25.1 614 15,411.4 630.01 376,996
9 23.4 544 12,729.6 547.56 295,936
10 18.1 421 7,620.1 327.61 177,241
11 22.6 445 10,057.0 510.76 198,025
12 17.2 408 7,017.6 295.84 166,464
Total 224.1 4,829 95,506.6 4,362.05 2,118,025
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 11 / 30
CORRELATION

Calculation of the correlation coefficient

From P P P
xy − x y n
r=q P
[n x2 − ( x)2 ][n y 2 − ( y)2 ]
P P P

n = 12
(12 × 95, 506.6) − (224.1 × 4, 829)
r=q
[(12 × 4, 362.05) − (224.1)2 ][(12 × 2, 118, 025) − (4, 829)2 ]

r = 0.958
This means there is a strong positive correlation between
temperature and icecream sales. Increase in temperature
lead to increase icecream sales.

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 12 / 30


CORRELATION

Quiz

John is excited about summer vacation. However, his


parents are worried since the teenager would be sitting
home and playing games on his mobile and switching
on the air conditioner the whole time. They noted the
various temperatures and the units consumed last year
and found interesting data. And they wanted to
anticipate their upcoming may month bill and expect
the temperature to be near 40◦ . Still, they want to
know if there is any correlation between temperature
and electricity bills.

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 13 / 30


CORRELATION

Quiz

Temperature (in ◦ ) Units Consumed Electricity Bill


24 80 2,490.00
27 82 2,550.00
30 84 2,610.00
31 101 3,170.00
34 110 3,890.00
35 115 4,290.00
38 140 6,390.00
40 142 6,441.00
42 156 7,155.00
45 157 7,206.00
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 14 / 30
CORRELATION

Spearman Rank Order Correlation

Spearman’s rank correlation measures the strength and


direction of association between two ranked variables.
It measures the strength and direction of the
association between two ranked variables.

It is given as
6 di 2
P
rs = 1 −
n(n2 − 1)
n =number of data points of the two variables
di = difference in ranks of the “ith” element

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 15 / 30


CORRELATION

Examples

The following are the marks of students for the two subjects
(History and Geography). Obtain a spearman correlation
coefficient.
History Geography
35 30
23 33
47 45
17 23
10 8
43 49
9 12
6 4
28 31

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 16 / 30


CORRELATION

Examples

from
6 di 2
P
rs = 1 −
n(n2 − 1)
History Rx Geography Ry di = Rx − Ry di 2
35 3 30 5 2 4
23 5 33 3 2 4
47 1 45 2 1 1
17 6 23 6 0 0
10 7 8 8 1 1
43 2 49 1 1 1
9 8 12 7 1 1
6 9 4 9 0 0
28 4 31 4 0 0
Total 12
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 17 / 30
CORRELATION

Examples

So,
6 × 12
rs = 1 −
9(92 − 1)
6 × 12
rs = 1 −
9 × 80

rs = 1 − 0.1
rs = 0.9
There is a strong positive correlation between the
marks of two subjects.
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 18 / 30
CORRELATION

Question

Calculate a Spearman rank-order correlation on data below


QM (mark) Research Methodology (mark)
56 66
75 77
45 40
75 60
64 66
64 56
58 59
80 77
75 67
61 63

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 19 / 30


REGRESSION

REGRESSION

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 20 / 30


REGRESSION

What is Regression

A regression is a statistical technique that relates a


dependent variable to one or more independent
(explanatory) variables.

A regression model is able to show whether changes


observed in the dependent variable are associated with
changes in one or more of the explanatory variables.

It is written as
y = ax + b
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 21 / 30
REGRESSION

Regression Coefficients by Least Square Method

It is written as
y = ax + b
Where P P P
n (xy) − x y
a= P P
n (x2 ) − ( x)2
And P P
y−a x
b=
n

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 22 / 30


REGRESSION

Example

Sales data of 10 months for a coffee house


situated near a prime location of a city
comprising the number of customers (in
hundreds) and monthly sales (in Thousand
Rupees) are given below. Find the simple linear
regression equation that fits the given data.

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 23 / 30


REGRESSION

Example

No of customers(In hundreds) Monthly Sales (in thousand


6 1
6.1 6
6.2 8
6.3 10
6.5 11
7.1 20
7.6 21
7.8 22
8 23
8.1 25
MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 24 / 30
REGRESSION

Example

S/No x y xy x2
1 6 1 6 36
2 6.1 6 36.6 37.21
3 6.2 8 49.6 38.44
4 6.3 10 63 39.69
5 6.5 11 71.5 42.25
6 7.1 20 142 50.41
7 7.6 21 159.6 57.76
8 7.8 22 171.6 60.84
9 8 23 184 64
10 8.1 25 202.5 65.61
Total 69.7 147 1,086.4 492.21

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 25 / 30


REGRESSION

Example

Where P P P
n (xy) − x y
a= P P
n (x2 ) − ( x)2
So P P
y−a x
b=
P P n P
Then
P 2 xy = 1086.4, x = 69.7, y = 147,
x = 492.21, n = 10

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 26 / 30


REGRESSION

Example

Where
(10 × 1086.4) − (69.7 × 147)
a= = 9.656
(10 × 492.21) − (69.7)2
So
147 − 9.656 × 69.7
b= = −52.6
10
So Regression line become
y = 9.656x − 52.6

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 27 / 30


REGRESSION

QUIZ

A statistician collected the sales data of a


restaurant near a metro station for 12 months.
The data comprising the number of customers
(in hundreds) and monthly sales (in thousand
Rupees) is given as follows. Find the fitted
simple linear regression equation for the given
data. What are the sales when there are 6000
customers.

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 28 / 30


REGRESSION

QUIZ

Month No of customers (00) Monthly sales(’000’Rs


1 4 1.8
2 6 3.5
3 6 5.8
4 8 7.8
5 10 8.7
6 14 9.8
7 18 10.7
8 20 11.5
9 22 12.9
10 26 13.6
11 28.0 14.2
12 20 15

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 29 / 30


Acknowledgement

Thank you!

MR. MOHAMED K. MWANGA ([email protected]) IAA April 18, 2023 30 / 30

You might also like