Simple Linear Regression Overview
Simple Linear Regression Overview
Topic 8
Simple Linear Regression
Reference
Levine, D.M., Kathryn, A.S. and David, F.S. Business Statistics: A First Course, Pearson
Education Ltd, Chapter 2 & 3 & 12
1
Outline
Scatter Plot
Covariance and the Coefficient of Correlation
Simple Linear Regression
Least Squares Estimation
Predictions in Regression Analysis
Coefficient of Determination
Inferences about the Slope
Applications of Linear Regression
2
Association Between Two Numerical
Variables
To visualize the relationship between two numerical
variables
Using scatter plot
To measure the degree of linear association
Using coefficient of correlation
To forecast one variable for given values of the other
Using regression model
Examples
Apartment price vs. Gross floor area
Weekly sales for chain stores vs. Number of customers
3
Association Between Two Numerical
Variables Cont’d
4
Association Between Two Numerical
Variables – Example Cont’d
The dots on the scatter plot lie “close to” a straight line
with a positive slope
We say that these two variables, height and weight, have
a positive linear association
6
Association Between Two Numerical
Variables – Example Cont’d
If the dots on the scatter plot lie “close to” a straight line
with negative slope, we say that the variables exhibit a
negative linear association
8
Covariance
Population covariance
∑
Sample covariance
∑
10
Covariance
Cont’d
11
Covariance
Cont’d
12
Covariance
Cont’d
13
Covariance – Example
Cont’d
16
Coefficient of Correlation
17
Coefficient of Correlation
Cont’d
∑ ∑
∑ ∑
An estimator of 𝜌
The sign of ( ) is the same as that of ( )
As the denominator of 𝜌 is always non‐negative
18
Coefficient of Correlation – Example
22
Coefficient of Correlation
Cont’d
23
Diversifying Your Investments
24
Diversifying Your Investments
Cont’d
Source: Yohoo!Finance
25
Calculating Coefficient of Correlation
in Excel
Find “Data Analysis” in the “Data” menu bar
Choose “Correlation” at
Data Cells
“Data Analysis” browser
Output Cell
26
Diversifying Your Investments
Cont’d
Cisco Systems Walt Disney General Electric Exxon Mobil TECO Energy Dell
Cisco Systems 1
Walt Disney 0.5512 1
General Electric 0.7461 0.5110 1
Exxon Mobil 0.3625 0.4701 0.7024 1
TECO Energy ‐0.1211 0.3432 0.1477 0.2828 1
Dell 0.0630 0.2906 0.1448 ‐0.0445 ‐0.1768 1
Which two would you select if your goal is to have one stock go
up when the other goes down?
27
Linear Regression Model
28
Linear Regression Model
Cont’d
29
Linear Regression Model
Cont’d
30
Linear Regression Model
Cont’d
32
Linear Regression Model
Cont’d
all , it implies Y
y
6
5
4
exactly
3
2
1
0
0 1 2 3 4 5 6 7
X
x
observed pairs ( 𝑖 , 𝑖 ), = 1, …, , Y6
8
7
y
cannot be drawn on a straight line 5
4
3
Xx
4 5 6 7
6
5
4
3
2
1 B
0
0 1 2 3 4 5 6 7
Xx
35
Least Squares Estimation
Cont’d
Y 6
5
4
3 C
2
1
0
0 1 2 3 4 5 6 7
Xx
36
Least Squares Estimation
Cont’d
Min. SSE =
Least‐squares criterion is about finding such for 𝑏0 and 𝑏1
The resulting line is often called the least‐squares regression line
38
Least Squares Estimation
Cont’d
39
Least Squares Estimation
Cont’d
40
Least Squares Estimation – Example
𝑿 5 𝒀 7 ∑ 𝟎 ∑ 𝟑𝟒 ∑ 𝟎 ∑ 𝟓𝟒 ∑ 𝟑𝟕 41
Least Squares Estimation – Example
Cont’d
Therefore
or
44
Interpreting the Estimated
Coefficients – Example Cont’d
45
Interpreting the Estimated
Coefficients – Example Cont’d
46
Developing Regression Model
in Excel
Find “Data Analysis” in the “Data” menu bar
47
Developing Regression Model
in Excel Cont’d
Output Cell
48
Developing Regression Model
in Excel Cont’d
Output
SSE
𝒃𝟎
𝒃𝟏
49
Coefficient of Determination
50
Coefficient of Determination
Cont’d
51
Coefficient of Determination
Cont’d
52
Coefficient of Determination
Cont’d
𝑿 5 𝒀 7 ∑ 𝟎 ∑ 𝟏𝟑. 𝟕𝟑𝟓𝟒
54
Coefficient of Determination –
Example Cont’d
55
Coefficient of Determination
Cont’d
56
Inferences about the Slope
At times, tests concerning are of interest, particularly
one of the forms: H0: vs H1:
If , there is no linear relationship between and
The means of the probability distribution of 𝑌 are all equal,
namely 𝐸 𝑌 𝑋 𝑥 𝛽 0𝑥 𝛽 for all levels of 𝑋
A change in 𝑋 does not induce any change in 𝑌
Similar to those discussed in Topics 6 & 7, we need to
consider the sampling distribution of , the least squares
point estimate of , in order to perform the inferences
on
57
Inferences about the Slope
Cont’d
Sampling distribution of 1
Since the 𝑌𝑖 are normal, the estimator 𝑏1 is also normal. It can be
shown that 𝑏1 has mean and variance
𝐸 𝑏 𝛽 𝜎 ∑
61
Inferences about the Slope –
Exercise Cont’d
62
Inferences about the Slope
Cont’d
64
Developing Regression Model
in Excel
Data
Level of confidence
65
Developing Regression Model
in Excel Cont’d
Output
|𝒓𝑿𝒀 |
𝑹𝟐
𝑺𝒆
𝒏
SSE
SST
𝒃𝟎
𝒃𝟏 𝑺𝒃𝟏
* Before inputting the new data set, always clear previous data: SHIFT 9 1 EXE
67
Applications of Linear Regression
68
Time Series Model
69
Hong Kong Population
7000
6000
Population Size ('000)
5000
4000
3000
2000
1000
0
1960 1970 1980 1990 2000 2010 2020
Year
1.
2.
So, 𝑏 3465.7677 thousands is the predicted Hong Kong
population size for the year 1960 (𝑋 = 0)
𝑏 72.2625 thousands is the predicted average annual
increment in population size
3.
73
Hong Kong Population
Cont’d
74
Hong Kong Population
Cont’d
75
Multiple Linear Regression
77
Centa‐City Index
Source: [Link]
home‐market‐smashes‐through‐record
78
Centa‐City Index
Cont’d
79
Centa‐City Index
Cont’d
80
Centa‐City Index
Cont’d
81
Centa‐City Index
Cont’d
• More information
• [Link]
82
• [Link]