Chapter 3 - Linear Regression
Chapter 3 - Linear Regression
Linear Regression
Model
Learning Objectives
• By the end of this lecture students will:
– understand the simple linear regression model
– understand the logic behind the method of
ordinary least squares (OLS) estimation
• The following notation will be used:
– y is the dependent or explained variable.
– X1, X2, Xk are the explanatory variables.
• Legendre and Gauss both applied the method to the problem of determining, from
astronomical observations, the orbits of bodies about the Sun. Gauss published a further
development of the theory of least squares in 1821, including a version of the Gauss-
Markov Theorem.
• His work was later extended by Udny Yule and Karl Pearson to a more general statistical
context. In the work of Yule and Pearson, the joint distribution of the response and
explanatory variables is assumed to be Gaussian.
• Since then, regression methods continue to be an area of active research and used in
numerous of applied research areas.
160
150
Consumption Y
140
130
120
110
100
110 120 130 140 150 160 170 180 190 200
where stands for the error term.
• Equation above is made up of deterministic component ( )
and stochastic component ( ). The deterministic component
determines the expected value of Y.
• This component tells us exactly by how much a change in X will be
reflected in the change in Y. However, in the real world, it is unlikely
that variation in Y is solely explained by variation in X. There are some
variations in Y that cannot be explained by the model.
• Econometric admit the existence of such unexplained variation by
explicitly including a stochastic component in the model.
X
Xi
Evan Lau for EBQ2074 (CHAP 3)
Ordinary Least Squares (OLS)
• OLS obtains the estimators ̂ and ̂
minimising the sum of squared residuals
(RSS) with respect to and :
N N
RSS ui (Yi X i )
ˆ 2
ˆ ˆ 2
i 1 i 1
• Partially differentiate RSS w.r.t. the
coefficients
RSS N
• (1) 2 (Yi ˆ ˆX i ) 0
ˆ i 1
RSS N
• (2) 2 (Yi ˆ ˆX i )( X i ) 0
ˆ i 1
( X i X )(Yi Y )
̂ i 1
N
i
( X
i 1
X ) 2
• and ˆ Y ˆX
• where Y and X are the sample means
Evan Lau for EBQ2074 (CHAP 3)
Supplementary of Chap3
ui = Yi - E(Y|Xi)
or Yi = E(Y|Xi) + u i
Shochastic error or
or Yi = 1 + 2 X + u i Stochastic disturbance
Y^ = 65 = ^ + ^ (80)
1 1 2
Y^ = 65 = ^ + ^ (80)
Estimated average: 2 1 2
Y^ = 65 = ^ + ^ (80)
3 1 2
Y^4 = 65 = ^1 + ^2 (80)
Y^5 = 65 = ^1 + ^2 (80)
Evan Lau for EBQ2074 (CHAP 3)
Y (SRF) ^Y = ^ + ^ x
1 2
Y4 .
{ E(Y|x)=1+2x
Y3 (PRF)
}
Y2 ^
^ u2
Y 2
u2
E(Y|x2) Page 45
Y1 .} u 1
x
x1 x2 x3 x4
The relationship among Yi, ui and the true regression line.
Evan Lau for EBQ2074 (CHAP 3)
SRF:
^ ^ ^
Yi = 1 + 2 Xi
^ ^
or Yi = 1 + 2Xi + u^ i Residual
or Yi = b1 + b2 Xi + ei
PRF:
E(Y|X) = 1 + 2 Xi
Yi = 1 + 2 Xi + u i Error term or
Disturbance
^
Yi = estimator of Yi (E(Y|xi)
^
i or bi = estimator of i
Evan Lau for EBQ2074 (CHAP 3)
Ordinary Least Squares (OLS) Method
Yi = 1 + 2Xi + ui
u i = Y i - 1 - 2X i
f ( )
= - 2 (Y i - 1 - 2Xi )
1
f ( )
= - 2 Xi (Yi - 1 - 2Xi )
2
Set each of these two derivatives equal to zero and
solve these two equations for the two unknowns: 1 2
Evan Lau for EBQ2074 (CHAP 3)
f()
= - 2 (Y i – b1 – b2Xi ) = 0
1
f()
= - 2 xi (Yi - b1 – b2Xi ) = 0
2
When these two terms are set to zero,
1 and 2 become b1 and b2 because they no longer
represent just any value of 1 and 2 but the special
values that correspond to the minimum of f() .
Evan Lau for EBQ2074 (CHAP 3)
- 2 (Y i - b1 – b2Xi ) = 0
- 2 Xi (Y i – b1 – b2Xi ) = 0
Xi Yi - b1 X i - b2 Xi
2
= 0
nb1 + b2 Xi = Y i
Xi + b2 Xi Xi Yi
2
b1 =
Evan Lau for EBQ2074 (CHAP 3)
n Xi b1
= Yi
i i
X X 2
b2 = Xi Yi
Solve the two unknowns
n Xi Yi - Xi Yi
b2 =
n i i
2 2
X - ( X )
(Xi - X )(Yi -Y) = xy
=
( i
X - X ) 2
x 2
b1 = Y - b2 x
Evan Lau for EBQ2074 (CHAP 3)
Y
Y4
. ^
Y = b1 + b2X
^
Y*
^*
Y3
.
{.
^u*
4
^*
^
Y* = b*1 + b* 2X
^*
Y1
. . 2 ^
u*3{ Y4
u*2 {. Y2
^ .
{
^
u*1
.
Y1
Y3
x1 x2 x3 x4 x
x t = years of experience
^
yt = predicted wage rate
^
If x t = 2 years, then yt = $7.00 per hour.
^
If x t = 3 years, then yt = $8.50 per hour.
Evan Lau for EBQ2074 (CHAP 3)