Professional Documents
Culture Documents
Chapter 3 Econometrics
Chapter 3 Econometrics
Chapter 3
Linear Regression with One Regressor
1 Introduction
4 Measures of fit
1 Introduction
4 Measures of fit
• What are our priors? −→ Smaller class size are better for
learning outcomes (?)
• We are interested in
Change in TextScore △T extScore
β1 = =
Change in ClassSize △ClassSize
• But: The average test score in district i does not only depend
on the average class size
• It also depends on other factors such as:
• Quality of the teachers
• Student background
• Quality of text books
• ...
1 Introduction
4 Measures of fit
E(Y | X)
△Y △u
= β1 as long as =0
△X △X
• By how much does Y change if X is increased by 1 unit?
• It is only correct if all other things remain equal when X is
increased by 1 unit
• Conditional mean independence: E(u | X) = 0
• (Explanatory variable must not contain information about the
mean of the unobserved factors)
• Can we test this?
△Y △u
= β1 as long as =0
△X △X
• By how much does Y change if X is increased by 1 unit?
• It is only correct if all other things remain equal when X is
increased by 1 unit
• Conditional mean independence: E(u | X) = 0
• (Explanatory variable must not contain information about the
mean of the unobserved factors)
• Can we test this?
W agei = β0 + β1 Educi + ui
W agei = β0 + β1 Educi + ui
1 Introduction
4 Measures of fit
n
X n
X
min S(β0 , β1 ) = û2i = (Yi − Ŷi )2
β0 ,β1
i=1 i=1
Regression equation
An equation that expresses the linear relationship between two
variables
Pn
sy sxy i=1 xi yi − nX̄ Ȳ
OLS estimator of β1 → βˆ1 = rxy = 2 = P n 2 2
sx sx i=1 xi − nX̄
where:
• rxy = Correlation coefficient
• sy = Standard deviation of Y
• sx = Standard deviation of X
• sxy = Covariance between X and Y
βˆ0 = Ȳ − βˆ1 X̄
where:
• Ȳ = Sample mean of Y
• X̄ = Sample mean of X
• βˆ1 = Estimated slope of the regression line
Econometrics - Ch. 3 Miguel Ángel Borrella (UNAV)
OLS estimators of β1 and β0
Pn
sy sxy i=1 xi yi − nX̄ Ȳ
OLS estimator of β1 → βˆ1 = rxy = 2 = P n 2 2
sx sx i=1 xi − nX̄
where:
• rxy = Correlation coefficient
• sy = Standard deviation of Y
• sx = Standard deviation of X
• sxy = Covariance between X and Y
βˆ0 = Ȳ − βˆ1 X̄
where:
• Ȳ = Sample mean of Y
• X̄ = Sample mean of X
• βˆ1 = Estimated slope of the regression line
Econometrics - Ch. 3 Miguel Ángel Borrella (UNAV)
Why to use OLS estimators?
19.053
• Estimated slope = β̂1 = −2.28 = −0.2264 ∗ 1.8918
In Stata:
1 Introduction
4 Measures of fit
How well does the estimated regression line “fit” or explain the data?
1 Does the regressor X account for much or for little variation
in Y ? −→ The R2 measures the fraction of the variance of Y
that is explained by X
• It is unitless
• Ranges between 0 (no fit) and 1 (perfect fit)
¯= 1 Pn
• The second equality holds because û n i=1 ûi =0
• The divisor n − 2 is used because 2 degrees of freedom were
lost in estimating the two regression coefficients β0 and β1
• It measures the spread of the observations around the
regression line in the units of the dependent variable
• In other words: It measures the average “size” of the OLS
residual (the average “mistake” made by the OLS regression)
¯= 1 Pn
• The second equality holds because û n i=1 ûi =0
• The divisor n − 2 is used because 2 degrees of freedom were
lost in estimating the two regression coefficients β0 and β1
• It measures the spread of the observations around the
regression line in the units of the dependent variable
• In other words: It measures the average “size” of the OLS
residual (the average “mistake” made by the OLS regression)
1 Introduction
4 Measures of fit
Y = β0 + β1 X + U
E (Yi | Xi ) = E (β0 + β1 Xi + ui | Xi ) =
= β0 + β1 E (Xi | Xi ) + (ui | Xi ) = β0 + β1 Xi
Homoskedasticity graphically:
1 Introduction
4 Measures of fit
σY2
Ȳ is Best ≤ V ar(µ̂Y ) ∀ µ̂Y
V ar(Ȳ ) =
n
n
!
1X
Linear µ̂Y = Yi
n
i=1
Unbiased E(Ȳ ) = µY
Estimator of µY
• Moreover:
Ȳ − E(Ȳ )
By CLT: p ≃ N (0, 1)
V ar(Ȳ )
1 What is E(β̂1 )?
−→ If E(β̂1 ) = β1 , then OLS is unbiased (good thing!)
2 What is V ar(β̂1 )? (measure of sampling uncertainty)
−→ We need to derive a formula in order to compute the SE
of β1
3 What is the distribution of β̂1 in small samples?
−→ It is very complicated in general
4 What is the distribution of β̂1 in large samples?
−→ By the CLT, β̂1 is (approx) normally distributed
Yi = β0 + β1 Xi + ui
Ȳ = β0 + β1 X̄ + ū
Hence: Yi − Ȳ = β1 (Xi − X̄) + (ui − ū)
Thus:
Pn
Xi − X̄ Yi − Ȳ
βˆ1 = i=1
Pn 2
Xi − X̄
Pn Pi=1
n
Xi − X̄ β1 (Xi − X̄) + (ui − ū)
βˆ1 = i=1
Pn
i=1
2
Xi − X̄
i=1
Pn Pn
X i − X̄ Xi − X̄ X i − X̄ (ui − ū)
βˆ1 = β1 i=1Pn 2 + i=1 Pn 2
i=1 Xi − X̄ i=1 Xi − X̄
Pn
Xi − X̄ (ui − ū)
βˆ1 = β1 + i=1
Pn 2
i=1 Xi − X̄
Finally:
Pn
ˆ i=1 Xi − X̄ ui
β1 − β1 = Pn 2
i=1 Xi − X̄
Pn !
Xi − X̄ ui
E βˆ1 − β1 = E i=1
Pn 2
i=1 Xi − X̄
Pn !
X i − X̄ E (ui | Xi )
Using LIE: E βˆ1 − β1 = E i=1
Pn 2
i=1 Xi − X̄
E βˆ1 − β1 = 0, because LSR.3: E (ui | Xi = xi )
where vi ≈ (Xi − µX ) ui
Pn !
Xi − X̄ Y i − Ȳ
p − lim βˆ1 = p − lim i=1
Pn 2
i=1 Xi − X̄
1 Pn
p !
Xi − X̄ ui −→ 0
p − lim βˆ1 = β1 + p − lim n i=1
2 p
1 Pn
n i=1 Xi − X̄ −→ V ar(X)
1 V ar [(X − µ ) u ]
i X i
V ar βˆ1 = 2
n σ 2
X
where 2
σX = V ar(Xi )
Under SLR.6:
σu2 σu2
V ar βˆ1 = 2 = Pn 2
n ∗ σX Xi − X̄
i=1
Parallel conclusions hold for the OLS estimator β̂1 (and also for β̂0 ):
• Under SLR.1-SLR.5:
β̂1 is Best V ar(β̂1 ) ≤ V ar(β̃1 ) ∀ β̃1 −→ Efficient!
X
Linear ( Y1 , . . . ; Yn weighted by X1 , . . . , Xn )
Unbiased E(β̂1 ) = β1
Estimator of β1
• Moreover:
β̂1 − E(β̂1 )
By CLT: q ≃ N (0, 1)
V ar(β̂1 )
If SLR.1-SLR.5 hold, then in large samples β̂1 and β̂0 have a jointly
normal sampling distribution:
1 The large-sample normal distribution of β̂ is N
1 β1 , σβ̂2 ,
1
where the variance of this distribution is:
1 V ar [(X − µ ) u ]
i X i
V ar βˆ1 = 2
n σX 2
2 The large-sample normal distribution of β̂ is N β , σ 2 ,
0 0 β̂
0
where the variance of this distribution is:
1 V ar (H u )
ˆ i i µX
V ar β0 = where Hi = 1 − Xi
n E(H 2 ) 2 E(Xi2 )
i