Chapter 2 P1
Chapter 2 P1
Chapter 2 P1
30/12/2020 1
Introduction
❑ Simple linear regression used one independent variable to explain the dependent
variable.
❑ Multiple linear regression uses two or more independent variables to describe the
dependent variable.
30/12/2020 2
Definition
The equation that describes how the dependent variable y is related to the
y = 0 + 1 x1 + 2 x2 + ... + k xk + (1)
where:
30/12/2020 3
Assumptions About the Error Term
30/12/2020 4
Estimate model parameters
Given observations ( yi , x1i , x2i ,,..., xki ) , i = 1, 2,..., n . The estimation method again is the
OLS, which produces estimates 0 , 1 , 2 ,..., k by minimizing
( y −
n
0 − 1 x1 − 2 x2 − ... − k xk )
2
i
i =1
i.e:
n
Min ( yi − 0 − 1 x1 − 2 x2 − ... − k xk )
i =1
2
( 2)
❑ The first order solution is to set the (k + 1) partial derivatives equal to zero.
❑ The solution is straightforward although the explicit form of the estimators
become complicated.
30/12/2020 5
Estimate model parameters
transposition
❑ In the same manner denote the data matrix on x-variables enhanced with ones
in the first column as an n (k + 1) matrix.
( 3)
where k < n.
30/12/2020 6
Estimate model parameters
➢ Then we can present the whole set of regression equations for the sample
y = X + ( 4)
30/12/2020 7
Estimate model parameters
y = X +
Where:
, ,
and
30/12/2020 8
Estimate model parameters
❑ The normal equations for the first order conditions of the minimization in matrix
form are simply: X t X ˆ = X t y
ˆ = ( X t X ) X t y
−1
( 5)
(
Where: ˆ = ˆ0 , ˆ1 ,..., ˆk )
❑ The fitted model is
30/12/2020 9
Interval estimation
i − ˆi
has a t-distribution with n-k-1 degrees of freedom
s i
ˆi t s ˆ (7)
, n − k −1 i
2
MSE
Where: sˆ =
i
( x − x )2
30/12/2020 10
Example 1
Let:
1 0 0 394.33
1 4 16 329.50
1 8 64 291.00
1 12 144 255.17
𝑋= 1 16 256 𝑎𝑛𝑑 𝑦 = 229.33
1 20 400 204.83
1 24 576 179.00
1 28 784 163.83
1 32 1024 150.33
According to formula 𝛽መ = 𝑋 ′ 𝑋 𝑋 ′ 𝑦
30/12/2020 11
Example 1
𝛽መ0
Finally, we calculate the vector of LS estimates 𝛽መ = 𝛽መ1
𝛽መ2
30/12/2020 12
Example 1
(𝑋 ′ 𝑋)−1 𝑋 ′ 𝑦
394.33
329.50
291.00
255.17 386.265
x 229.33 = −12.722
204.83 0.172
179.00
163.83
150.33
30/12/2020 13
Example 2
You work in advertising for the New York Times. You want to find the effect of ad size
and newspaper circulation on the number of ad responses.
30/12/2020 14
Example 2
1. Slope 𝛽መ1
2. Slope 𝛽መ0
Number of responses to ad is expected to increase by .2805 (28.05) for each 1 unit
(1,000) increase in circulation holding ad size constant
30/12/2020 15
Example 2
The years of experience, score on the aptitude test, and corresponding annual
4 78 24.0 9 88 38.0
7 100 43.0 2 73 26.6
1 86 23.7 10 75 36.2
5 82 34.3 5 81 31.6
8 86 35.8 6 74 29.0
10 84 38.0 8 87 34.0
0 75 22.2 4 79 30.1
1 80 23.1 6 94 33.9
6 83 30.0 3 70 28.2
6 91 33.0 3 89 30.0
30/12/2020 16
Example 2
Suppose we believe that salary (y) is related to the years of experience (x1)
and the score on the programmer aptitude test (x2) by the following
regression model:
where
y = annual salary ($1000)
x1 = years of experience
30/12/2020 17
Example 2
x1 x2 y 0 =
Computer Package
4 78 24 for Solving Multiple 1 =
7 100 43
Regression Problems 2 =
. . .
. . .
3 89 30
30/12/2020 18
Example 2
A B C D E
38
39 Coeffic. Std. Err. t Stat P-value
40 Intercept 3.17394 6.15607 0.5156 0.61279
41 Experience 1.4039 0.19857 7.0702 1.9E-06
42 Test Score 0.25089 0.07735 3.2433 0.00478
43
30/12/2020 19
Example 2
year of experience.
30/12/2020 20