SlideShare a Scribd company logo
1 of 30
Download to read offline
CH04: Covariance and
Regression
IP Statistics/ Class 03
Eng. Osama Zaidiah
2013
1
Copyright Osama Zaidiah 2013 ©
Chapter Outline
CH04
Covariance
Covariance
Pearson’s
Covariance
Pearson’s
Covariance
Spearman’s
Covariance
Spearman’s
Covariance
Regression
Regression
y(x)
x(y)
2
Copyright Osama Zaidiah 2013 ©
PART 01: COVARIANCE
3
Copyright Osama Zaidiah 2013 ©
Covariance
• Covariance measures the relationship
between two or more variables.
• We use the letter „r‟ to measure covariance.
• „r‟ can have the following values:
– „r‟ is always between -1 and +1
– When „r‟ is close to +1 we have a positive
covariance
– When „r‟ is close to -1 we have a negative
covariance
– When „r‟ is close to 0 we have a zero covariance
4
Copyright Osama Zaidiah 2013 ©
Covariance
5
Copyright Osama Zaidiah 2013 ©
Covariance
• „r‟ can have the following values:
– „r‟ is always between -1 and +1
– When „r‟ is close to +1 we have a positive
covariance
– When „r‟ is close to -1 we have a negative
covariance
– When „r‟ is close to 0 we have a zero
covariance
6
Copyright Osama Zaidiah 2013 ©
How to measure Covariance?
• We have two measures for covariance:
– Pearson‟s Covariance Measure
– Spearman's Covariance Measure
7
Copyright Osama Zaidiah 2013 ©
Covariance: an Outline
Covariance
Pearson’s
Covariance
Spearman’s
Covariance
8
Copyright Osama Zaidiah 2013 ©
Pearson’s Covariance Measure
• Use the formula:
y
x
Pearson
n
y
y
x
x
r

 




 )
)(
(
9
Copyright Osama Zaidiah 2013 ©
Example: Pearson’s Covariance
• Since r is equal to
0.76, the relationship
is positive
x y x-x’ y-y’ 3 x 4
1 10 -2 -12 24
2 20 -1 -2 2
3 19 0 -3 0
4 26 1 4 4
5 35 2 13 26
56
76
.
0
6
.
73
56
2
.
9
6
.
1
5
56
2
.
9
,
6
.
1
56
)
)(
(
22
,
3













r
y
y
x
x
y
x
y
x 

10
Copyright Osama Zaidiah 2013 ©
In Class Example: Pearson’s
Covariance
• Find the value of „r‟
for the attached
data.
x y x-x’ y-y’ 3 x 4
1 35
2 26
3 19
4 20
5 10
2
.
9
,
6
.
1
22
,
3




y
x
y
x


11
Copyright Osama Zaidiah 2013 ©
In Class Example: Pearson’s
Covariance
• Since r is equal to -
0.76, the relationship
is negative.
x y x-x’ y-y’ 3 x 4
1 35 -2 13 -26
2 26 -1 4 -4
3 19 0 -3 0
4 20 1 -2 -2
5 10 2 -12 -24
-56
76
.
0
6
.
73
56
2
.
9
6
.
1
5
56
2
.
9
,
6
.
1
56
)
)(
(
22
,
3

















r
y
y
x
x
y
x
y
x 

12
Copyright Osama Zaidiah 2013 ©
Covariance: an Outline
Covariance
Pearson’s
Covariance
Spearman’s
Covariance
13
Copyright Osama Zaidiah 2013 ©
Spearman's Covariance Measure
• Use the formula:
• Where „d‟ is the difference of order
between the x and y points. (see
example)
)
1
(
6
1 2
2




n
n
d
rSpearman
14
Copyright Osama Zaidiah 2013 ©
Example: Spearman’s Covariance
• Since r is equal to
0.9, the relationship
is positive
x y Ox Oy d d2
1 10 5 5 0 0
2 20 4 3 1 1
3 19 3 4 -1 1
4 26 2 2 0 0
5 35 1 1 0 0
2
9
.
0
120
12
1
)
1
5
(
5
2
6
1
)
1
(
6
1
2
2
2











n
n
d
rSpearman
15
Copyright Osama Zaidiah 2013 ©
In Class Example: Spearman’s
Covariance
• Find the value of „r‟
for the attached
data.
x y Ox Oy d d2
1 35
2 26
3 19
4 20
5 10
16
Copyright Osama Zaidiah 2013 ©
In Class Example: Spearman’s
Covariance
x y Ox Oy d d2
1 35 5 1 4 16
2 26 4 2 2 4
3 19 3 4 -1 1
4 20 2 3 -1 1
5 10 1 5 -4 16
38
• Since r=-0.9 the
relationship is
negative
9
.
0
120
228
1
)
1
5
(
5
38
6
1
)
1
(
6
1
2
2
2












n
n
d
rSpearman
17
Copyright Osama Zaidiah 2013 ©
PART 02: SIMPLE LINEAR
REGRESSION
18
Copyright Osama Zaidiah 2013 ©
What is Regression?
• Regression is the process of fitting a
mathematical function to a set of data
points.
• In regression we seek to find the
relationship between two variables based
on data points we have.
19
Copyright Osama Zaidiah 2013 ©
Simple Linear Regression
20
Copyright Osama Zaidiah 2013 ©
Linear Regression: Two Methods
Linear
Regression
y(x) or y of x
y(x) or y of x
x(y) or x of y
x(y) or x of y
21
Copyright Osama Zaidiah 2013 ©
Linear Regression Equation: y(x)
• We can find the relationship between X
and Y:
• We call this the equation of y(x) “y of x”:
x
a
y
b
r
a
b
ax
y
x
y







22
Copyright Osama Zaidiah 2013 ©
Linear Regression Example: y(x)
5
.
2
5
.
2
)
(
:
5
.
2
3
5
.
2
10
)
2
(
5
.
2
6
.
1
5
8
.
0
)
1
(
:
8
.
0
6
.
1
,
3
/
5
0



















x
b
ax
x
y
Then
x
a
y
b
r
a
Then
r
x
y
x
y
x
y /
,
1
:
n
informatio
following
the
have
you
If




23
Copyright Osama Zaidiah 2013 ©
Linear Regression Exercise: y(x)
b
ax
x
y
Find
r
x
y x
y







)
(
7
.
0
4
.
1
,
4
/
6
17
y(x).
of
Equation
Regression
Linear
the
/
,
:
n
informatio
following
the
have
you
If


24
Copyright Osama Zaidiah 2013 ©
Linear Regression Exercise: y(x)
14
5
3
3
5
3
)
(
5
4
3
17
)
2
(
3
4
.
1
6
7
.
0
)
1
(
3
7
.
0
4
.
1
,
4
/
6
17



















y
x
x
x
y
b
a
x
y
Find
r
x
y x
y
then
3
If
when
of
value
the
/
,
:
n
informatio
following
the
have
you
If


25
Copyright Osama Zaidiah 2013 ©
Linear Regression: Two Methods
Linear
Regression
y(x) or y of x
y(x) or y of x
x(y) or x of y
x(y) or x of y
26
Copyright Osama Zaidiah 2013 ©
Linear Regression Equation: x(y)
• We can find the relationship between X
and Y:
• We call this the equation of y(x) “y of x”:
y
c
x
d
r
c
d
cy
x
y
x







27
Copyright Osama Zaidiah 2013 ©
Linear Regression Example: x(y)
6
.
5
26
.
0
)
(
:
6
.
5
10
26
.
0
3
)
2
(
26
.
0
5
6
.
1
8
.
0
)
1
(
:
8
.
0
6
.
1
,
3
/
5
0



















y
d
cy
y
x
Then
y
c
x
d
r
c
Then
r
x
y
y
x
x
y /
,
1
:
n
informatio
following
the
have
you
If




28
Copyright Osama Zaidiah 2013 ©
Linear Regression Exercise: x(y)
d
cy
y
x
Find
y
x
find
r
x
y x
y








)
(
10
7
.
0
4
.
1
,
4
/
6
17
x(y).
of
Equation
Regression
Linear
the
if
/
,
:
n
informatio
following
the
have
you
If


29
Copyright Osama Zaidiah 2013 ©
Linear Regression Exercise
88
.
1
28
.
1
6
.
1
28
.
1
10
16
.
0
28
.
1
16
.
0
:
28
.
1
16
*
16
.
0
4
)
2
(
16
.
0
6
4
.
1
7
.
0
)
1
(
:
10
7
.
0
4
.
1
,
4
/
6
17

























x
y
d
cy
x
Then
y
c
x
d
y
r
c
Then
y
x
find
r
x
y
x
x
y
if
/
,
:
n
informatio
following
the
have
you
If




30
Copyright Osama Zaidiah 2013 ©

More Related Content

Similar to CH04 Covariance and Regression- Marketing Strategies

T17 correlation
T17 correlationT17 correlation
T17 correlation
kompellark
 

Similar to CH04 Covariance and Regression- Marketing Strategies (20)

슬로우캠퍼스: scikit-learn & 머신러닝 (강박사)
슬로우캠퍼스:  scikit-learn & 머신러닝 (강박사)슬로우캠퍼스:  scikit-learn & 머신러닝 (강박사)
슬로우캠퍼스: scikit-learn & 머신러닝 (강박사)
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
correlation-analysis.pptx
correlation-analysis.pptxcorrelation-analysis.pptx
correlation-analysis.pptx
 
Correlations
CorrelationsCorrelations
Correlations
 
Unit 4_3 Correlation Regression.pptx
Unit 4_3 Correlation Regression.pptxUnit 4_3 Correlation Regression.pptx
Unit 4_3 Correlation Regression.pptx
 
Correlation analysis
Correlation analysisCorrelation analysis
Correlation analysis
 
UNIT 4.pptx
UNIT 4.pptxUNIT 4.pptx
UNIT 4.pptx
 
Regression Analysis.pdf
Regression Analysis.pdfRegression Analysis.pdf
Regression Analysis.pdf
 
correlation.final.ppt (1).pptx
correlation.final.ppt (1).pptxcorrelation.final.ppt (1).pptx
correlation.final.ppt (1).pptx
 
T17 correlation
T17 correlationT17 correlation
T17 correlation
 
Corr-and-Regress (1).ppt
Corr-and-Regress (1).pptCorr-and-Regress (1).ppt
Corr-and-Regress (1).ppt
 
Corr-and-Regress.ppt
Corr-and-Regress.pptCorr-and-Regress.ppt
Corr-and-Regress.ppt
 
Cr-and-Regress.ppt
Cr-and-Regress.pptCr-and-Regress.ppt
Cr-and-Regress.ppt
 
Corr-and-Regress.ppt
Corr-and-Regress.pptCorr-and-Regress.ppt
Corr-and-Regress.ppt
 
Corr-and-Regress.ppt
Corr-and-Regress.pptCorr-and-Regress.ppt
Corr-and-Regress.ppt
 
Corr-and-Regress.ppt
Corr-and-Regress.pptCorr-and-Regress.ppt
Corr-and-Regress.ppt
 
Correlation & Regression for Statistics Social Science
Correlation & Regression for Statistics Social ScienceCorrelation & Regression for Statistics Social Science
Correlation & Regression for Statistics Social Science
 
correlation-analysis-160424020323.pptx
correlation-analysis-160424020323.pptxcorrelation-analysis-160424020323.pptx
correlation-analysis-160424020323.pptx
 
Stat
StatStat
Stat
 
Corr And Regress
Corr And RegressCorr And Regress
Corr And Regress
 

Recently uploaded

Affiliate Marketing Basic Guide For Beginners _20240521_091615_0000.pdf
Affiliate Marketing Basic Guide For Beginners _20240521_091615_0000.pdfAffiliate Marketing Basic Guide For Beginners _20240521_091615_0000.pdf
Affiliate Marketing Basic Guide For Beginners _20240521_091615_0000.pdf
atinukehassan87
 

Recently uploaded (20)

Building Your Customer Base with MailPoet.pdf
Building Your Customer Base with MailPoet.pdfBuilding Your Customer Base with MailPoet.pdf
Building Your Customer Base with MailPoet.pdf
 
5 Benefits Of Using Digital Marketing.pptx
5 Benefits Of Using Digital Marketing.pptx5 Benefits Of Using Digital Marketing.pptx
5 Benefits Of Using Digital Marketing.pptx
 
BrightonSEO - Search Engine Omnipresence_ Why SEOs need to look beyond Google
BrightonSEO - Search Engine Omnipresence_ Why SEOs need to look beyond GoogleBrightonSEO - Search Engine Omnipresence_ Why SEOs need to look beyond Google
BrightonSEO - Search Engine Omnipresence_ Why SEOs need to look beyond Google
 
DM digital marketing service: grow your business & revenue
DM digital marketing service: grow your business & revenueDM digital marketing service: grow your business & revenue
DM digital marketing service: grow your business & revenue
 
Top SEO Trends to Embrace in 2024‎ ‎ ‎ ‎
Top SEO Trends to Embrace in 2024‎ ‎ ‎ ‎Top SEO Trends to Embrace in 2024‎ ‎ ‎ ‎
Top SEO Trends to Embrace in 2024‎ ‎ ‎ ‎
 
Top tips for effective SEO copywriting.pdf
Top tips for effective SEO copywriting.pdfTop tips for effective SEO copywriting.pdf
Top tips for effective SEO copywriting.pdf
 
Being a PMM with a multi-product portfolio - Product Marketing Summit
Being a PMM with a multi-product portfolio - Product Marketing SummitBeing a PMM with a multi-product portfolio - Product Marketing Summit
Being a PMM with a multi-product portfolio - Product Marketing Summit
 
How to Scale Your Digital Marketing Services in 2024
How to Scale Your Digital Marketing Services in 2024How to Scale Your Digital Marketing Services in 2024
How to Scale Your Digital Marketing Services in 2024
 
Link Building in 2024: What Works, What Doesn't, and What's Next
Link Building in 2024: What Works, What Doesn't, and What's NextLink Building in 2024: What Works, What Doesn't, and What's Next
Link Building in 2024: What Works, What Doesn't, and What's Next
 
The Future Normal - DIGGIT - Henry Coutinho-Mason.pdf
The Future Normal - DIGGIT - Henry Coutinho-Mason.pdfThe Future Normal - DIGGIT - Henry Coutinho-Mason.pdf
The Future Normal - DIGGIT - Henry Coutinho-Mason.pdf
 
Klaus Schweighofer, Zakaj je digitalizacija odlična priložnost za medije, Sty...
Klaus Schweighofer, Zakaj je digitalizacija odlična priložnost za medije, Sty...Klaus Schweighofer, Zakaj je digitalizacija odlična priložnost za medije, Sty...
Klaus Schweighofer, Zakaj je digitalizacija odlična priložnost za medije, Sty...
 
Affiliate Marketing Basic Guide For Beginners _20240521_091615_0000.pdf
Affiliate Marketing Basic Guide For Beginners _20240521_091615_0000.pdfAffiliate Marketing Basic Guide For Beginners _20240521_091615_0000.pdf
Affiliate Marketing Basic Guide For Beginners _20240521_091615_0000.pdf
 
Webinar: What the Hell is Legitimate Interest?
Webinar: What the Hell is Legitimate Interest?Webinar: What the Hell is Legitimate Interest?
Webinar: What the Hell is Legitimate Interest?
 
Content Segmentation for Organic Visibility
Content Segmentation for Organic VisibilityContent Segmentation for Organic Visibility
Content Segmentation for Organic Visibility
 
Leading Customer Retention Strategies for 2024
Leading Customer Retention Strategies for 2024Leading Customer Retention Strategies for 2024
Leading Customer Retention Strategies for 2024
 
SES London 2009 Beyond Linkbait Greg Jarboe.ppt
SES London 2009 Beyond Linkbait Greg Jarboe.pptSES London 2009 Beyond Linkbait Greg Jarboe.ppt
SES London 2009 Beyond Linkbait Greg Jarboe.ppt
 
Best Digital Expert Corporation of India
Best Digital Expert Corporation of IndiaBest Digital Expert Corporation of India
Best Digital Expert Corporation of India
 
Japanese Sauna Hat Trends - Totonoete Inc.
Japanese Sauna Hat Trends - Totonoete Inc.Japanese Sauna Hat Trends - Totonoete Inc.
Japanese Sauna Hat Trends - Totonoete Inc.
 
Digital PR & Content Marketing Lecture for Advanced Digital & Social Media St...
Digital PR & Content Marketing Lecture for Advanced Digital & Social Media St...Digital PR & Content Marketing Lecture for Advanced Digital & Social Media St...
Digital PR & Content Marketing Lecture for Advanced Digital & Social Media St...
 
ATRIUM GAMING : SLOT GACOR MUDAH MENANG TERBARU
ATRIUM GAMING : SLOT GACOR MUDAH MENANG TERBARUATRIUM GAMING : SLOT GACOR MUDAH MENANG TERBARU
ATRIUM GAMING : SLOT GACOR MUDAH MENANG TERBARU
 

CH04 Covariance and Regression- Marketing Strategies