Cours 2
Cours 2
Quentin Lippmann
1 / 46
1 Last Week
4 Let’s recap
2 / 46
Last Week
3 / 46
Last Week
3 / 46
Last Week
3 / 46
Last Week
3 / 46
Last Week
3 / 46
Last Week
3 / 46
Last Week
3 / 46
1 Last Week
4 Let’s recap
4 / 46
Non-linear relationships
• We obtain wage
= 12 + 0.8educ
• How do we interpret 0.8?
5 / 46
Non-linear relationships
• We obtain wage
= 12 + 0.8educ
• How do we interpret 0.8? When educ increases by 1, wage increases
by 0.8
• Does it seem correct?
5 / 46
Non-linear relationships
• We obtain wage
= 12 + 0.8educ
• How do we interpret 0.8? When educ increases by 1, wage increases
by 0.8
• Does it seem correct? No
5 / 46
Non-linear relationships
• We obtain wage
= 12 + 0.8educ
• How do we interpret 0.8? When educ increases by 1, wage increases
by 0.8
• Does it seem correct? No
5 / 46
Non-linear relationships
• We obtain wage
= 12 + 0.8educ
• How do we interpret 0.8? When educ increases by 1, wage increases
by 0.8
• Does it seem correct? No
5 / 46
Non-linear relationships
Proof
ln(Y ) = β0 + β1 X
6 / 46
Non-linear relationships
Proof
ln(Y ) = β0 + β1 X
∂(ln(Y )) 1 ∂Y ∂Y
= β1 ⇔ · = β1 ⇔ = β1 ∂X
∂X Y ∂X Y
6 / 46
Non-linear relationships
Proof
ln(Y ) = β0 + β1 X
∂(ln(Y )) 1 ∂Y ∂Y
= β1 ⇔ · = β1 ⇔ = β1 ∂X
∂X Y ∂X Y
6 / 46
Non-linear relationships
Proof
ln(Y ) = β0 + β1 X
∂(ln(Y )) 1 ∂Y ∂Y
= β1 ⇔ · = β1 ⇔ = β1 ∂X
∂X Y ∂X Y
6 / 46
Non-linear relationships
Proof
ln(Y ) = β0 + β1 X
∂(ln(Y )) 1 ∂Y ∂Y
= β1 ⇔ · = β1 ⇔ = β1 ∂X
∂X Y ∂X Y
6 / 46
Non-linear relationships
Proof
ln(Y ) = β0 + β1 X
∂(ln(Y )) 1 ∂Y ∂Y
= β1 ⇔ · = β1 ⇔ = β1 ∂X
∂X Y ∂X Y
7 / 46
Non-linear relationships
• How do we interpret β1 ?
8 / 46
Non-linear relationships
Percentage change in Y ∂Y /Y
Elasticity = =
Percentage change in X ∂X /X
• Derive log(salary ) with respect to log(sales) from the original
specification
8 / 46
To summarize
9 / 46
Non-linear relationships: squared terms
10 / 46
Non-linear relationships: squared terms
10 / 46
Non-linear relationships: squared terms
y = β0 + β1 X + β2 X 2 + u
10 / 46
Non-linear relationships: squared terms
y = β0 + β1 X + β2 X 2 + u
• Interpretation
∂y
= β1 + 2β2 X
∂X
10 / 46
Non-linear relationships: squared terms
An example
11 / 46
What does linear mean?
12 / 46
What does linear mean?
12 / 46
What does linear mean?
12 / 46
What does linear mean?
12 / 46
What does linear mean?
12 / 46
What does linear mean?
12 / 46
What does linear mean?
12 / 46
The unit of measurement
An example
The unit of measurement
An example
13 / 46
The unit of measurement
An example
13 / 46
The unit of measurement
An example
The unit of measurement
An example
13 / 46
An example
The unit of measurement
• How will β
c1 and β
c0 change?
14 / 46
An example
The unit of measurement
• How will β
c1 and βc0 change?
• We have: salary = 963191 + 18501roe
• β
c0 and β
c1 are multiplied by 1000
14 / 46
An example
The unit of measurement
• How will β
c1 and β
c0 change?
15 / 46
An example
The unit of measurement
• How will β
c1 and β c0 change?
• We have: salary
= 963.191 + 1850.1roe
• β
c1 is multiplied by 100
15 / 46
The unit of measurement
16 / 46
The unit of measurement
16 / 46
The unit of measurement
16 / 46
The unit of measurement
16 / 46
The unit of measurement
16 / 46
The unit of measurement
16 / 46
Time for a quizz
17 / 46
1 Last Week
4 Let’s recap
18 / 46
Expectation of OLS Estimators
19 / 46
Expectation of OLS Estimators
19 / 46
An example
• We are interested in the relationship between study time and test
scores
20 / 46
An example
• We are interested in the relationship between study time and test
scores
• Answer
21 / 46
An example
• Question: what do you think of these estimators?
• Answer
• Red =
21 / 46
An example
• Question: what do you think of these estimators?
• Answer
• Red = overestimation
• Green =
21 / 46
An example
• Question: what do you think of these estimators?
• Answer
• Red = overestimation
• Green = underestimation
• Blue =
21 / 46
An example
• Question: what do you think of these estimators?
• Answer
• Red = overestimation
• Green = underestimation
• Blue = wrong sign
21 / 46
An example
• It is unbiased
22 / 46
Unbiasedness of an estimator
E [θb] = θ
Implication:
23 / 46
Unbiasedness of an estimator
E [θb] = θ
Implication: if we repeat our sampling process many times and calculate
θb each time, the average of all these estimates would converge to the
true value θ
23 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
24 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
24 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
Y : On a scale of 1–10, how much do you like the campus?
Assume: Y = β0 + β1 X + ²
24 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
Y : On a scale of 1–10, how much do you like the campus?
Assume: Y = β0 + β1 X + ²
2 Using the full group: draw the OLS line ⇒ population line
24 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
Y : On a scale of 1–10, how much do you like the campus?
Assume: Y = β0 + β1 X + ²
2 Using the full group: draw the OLS line ⇒ population line
3 Take two random samples of 5 students and draw OLS lines ⇒ sample
line
24 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
Y : On a scale of 1–10, how much do you like the campus?
Assume: Y = β0 + β1 X + ²
2 Using the full group: draw the OLS line ⇒ population line
3 Take two random samples of 5 students and draw OLS lines ⇒ sample
line
• Questions
• How do the sample lines compare to the population line?
24 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
Y : On a scale of 1–10, how much do you like the campus?
Assume: Y = β0 + β1 X + ²
2 Using the full group: draw the OLS line ⇒ population line
3 Take two random samples of 5 students and draw OLS lines ⇒ sample
line
• Questions
• How do the sample lines compare to the population line?
• Why do the slopes differ?
24 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
Y : On a scale of 1–10, how much do you like the campus?
Assume: Y = β0 + β1 X + ²
2 Using the full group: draw the OLS line ⇒ population line
3 Take two random samples of 5 students and draw OLS lines ⇒ sample
line
• Questions
• How do the sample lines compare to the population line?
• Why do the slopes differ?
• If we averaged the slopes from all possible samples of size 5, where
would that average line be?
24 / 46
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
Y : On a scale of 1–10, how much do you like the campus?
Assume: Y = β0 + β1 X + ²
2 Using the full group: draw the OLS line ⇒ population line
3 Take two random samples of 5 students and draw OLS lines ⇒ sample
line
• Questions
• How do the sample lines compare to the population line?
• Why do the slopes differ?
• If we averaged the slopes from all possible samples of size 5, where
would that average line be?
24 / 46
Understanding unbiasedness
Let’s take an example
Understanding unbiasedness
Let’s take an example
1 Two quick questions:
X : How many minutes do you take to get to campus?
Y : On a scale of 1–10, how much do you like the campus?
Assume: Y = β0 + β1 X + ²
2 Using the full group: draw the OLS line ⇒ population line
3 Take two random samples of 5 students and draw OLS lines ⇒ sample
line
• Questions
• How do the sample lines compare to the population line?
• Why do the slopes differ?
• If we averaged the slopes from all possible samples of size 5, where
would that average line be?
24 / 46
Properties of Unbiased Estimators
Bias(θb) = E [θb] − θ = 0
25 / 46
Unbiasedness of OLS estimator
yi = β0 + β1 xi + ui
The OLS estimator for the slope (β1 ) is given by:
P
(xi − x )(yi − y )
βb1 =
(xi − x )2
P
26 / 46
Unbiasedness of OLS estimator
yi = β0 + β1 xi + ui
The OLS estimator for the slope (β1 ) is given by:
P
(xi − x )(yi − y )
βb1 =
(xi − x )2
P
(xi − x )((β0 + β1 xi + ui ) − y )
P
βb1 =
(xi − x )2
P
26 / 46
Unbiasedness of OLS estimator
yi = β0 + β1 xi + ui
The OLS estimator for the slope (β1 ) is given by:
P
(xi − x )(yi − y )
βb1 =
(xi − x )2
P
(xi − x )((β0 + β1 xi + ui ) − y )
P
βb1 =
(xi − x )2
P
2) Simplify:
(xi − x )(β0 + β1 xi + ui − y )
P
βb1 =
(xi − x )2
P
26 / 46
X
3) Note that (xi − x ) = 0, so the first term becomes zero:
β1 (xi − x )(xi ) + (xi − x )(ui )
P P
βb1 =
(xi − x )2
P
27 / 46
X
3) Note that (xi − x ) = 0, so the first term becomes zero:
β1 (xi − x )(xi ) + (xi − x )(ui )
P P
βb1 =
(xi − x )2
P
4) Simplify further: P
(xi − x )(ui )
β1 = β1 + P
b
(xi − x )2
27 / 46
X
3) Note that (xi − x ) = 0, so the first term becomes zero:
β1 (xi − x )(xi ) + (xi − x )(ui )
P P
βb1 =
(xi − x )2
P
4) Simplify further: P
(xi − x )(ui )
β1 = β1 + P
b
(xi − x )2
5) Now, let’s take the expected value of both sides:
P
(xi − x )(ui )
· ¸
E [ β1 ] = E β1 + P
b
(xi − x )2
·P
(xi − x )(ui )
¸
= β1 + E
(xi − x )2
P
27 / 46
X
3) Note that (xi − x ) = 0, so the first term becomes zero:
β1 (xi − x )(xi ) + (xi − x )(ui )
P P
βb1 =
(xi − x )2
P
4) Simplify further: P
(xi − x )(ui )
β1 = β1 + P
b
(xi − x )2
5) Now, let’s take the expected value of both sides:
P
(xi − x )(ui )
· ¸
E [ β1 ] = E β1 + P
b
(xi − x )2
·P
(xi − x )(ui )
¸
= β1 + E
(xi − x )2
P
27 / 46
X
3) Note that (xi − x ) = 0, so the first term becomes zero:
β1 (xi − x )(xi ) + (xi − x )(ui )
P P
βb1 =
(xi − x )2
P
4) Simplify further: P
(xi − x )(ui )
β1 = β1 + P
b
(xi − x )2
5) Now, let’s take the expected value of both sides:
P
(xi − x )(ui )
· ¸
E [ β1 ] = E β1 + P
b
(xi − x )2
·P
(xi − x )(ui )
¸
= β1 + E
(xi − x )2
P
7) Final step
P
(xi − x )(0)
E [βb1 ] = β1 + P = β1 + 0 = β1
(xi − x )2
27 / 46
Unbiasedness of OLS estimator
28 / 46
Variance of OLS estimator
29 / 46
Variance of OLS estimator
29 / 46
Variance of OLS estimator
• To what extent β
c1 can deviate from β1 on average?
30 / 46
Variance of OLS estimators
31 / 46
Variance of OLS Estimators
The OLS estimator for β1 is:
P
(xi − x )(yi − y )
βb1 =
(xi − x )2
P
32 / 46
Variance of OLS Estimators
The OLS estimator for β1 is:
P
(xi − x )(yi − y )
βb1 =
(xi − x )2
P
32 / 46
Variance of OLS Estimators
The OLS estimator for β1 is:
P
(xi − x )(yi − y )
βb1 =
(xi − x )2
P
2) Simplify: P
(xi − x )(ui − u)
βb1 = β1 +
(xi − x )2
P
32 / 46
Variance of OLS Estimators
The OLS estimator for β1 is:
P
(xi − x )(yi − y )
βb1 =
(xi − x )2
P
2) Simplify: P
(xi − x )(ui − u)
βb1 = β1 +
(xi − x )2
P
3) Therefore: P
(xi − x )(ui − u)
βb1 − β1 =
(xi − x )2
P
32 / 46
Variance of OLS Estimators
The OLS estimator for β1 is:
P
(xi − x )(yi − y )
βb1 =
(xi − x )2
P
2) Simplify: P
(xi − x )(ui − u)
βb1 = β1 +
(xi − x )2
P
3) Therefore: P
(xi − x )(ui − u)
βb1 − β1 =
(xi − x )2
P
32 / 46
Variance of OLS Estimators
5) Using the property Var (aX |Y ) = a2 Var (X |Y ) for constant a:
P
Var ( (xi − x )(ui − u)|X )
Var (βb1 |X ) =
[ (xi − x )2 ]2
P
33 / 46
Variance of OLS Estimators
5) Using the property Var (aX |Y ) = a2 Var (X |Y ) for constant a:
P
Var ( (xi − x )(ui − u)|X )
Var (βb1 |X ) =
[ (xi − x )2 ]2
P
6) Using conditionality on X:
(xi − x )2 Var (ui |X )
X X
Var ( (xi − x )(ui − u)|X ) =
33 / 46
Variance of OLS Estimators
5) Using the property Var (aX |Y ) = a2 Var (X |Y ) for constant a:
P
Var ( (xi − x )(ui − u)|X )
Var (βb1 |X ) =
[ (xi − x )2 ]2
P
6) Using conditionality on X:
(xi − x )2 Var (ui |X )
X X
Var ( (xi − x )(ui − u)|X ) =
7) Assuming homoscedasticity. Let σ2 = Var (ui |X ). Then:
σ2 (xi − x )2
P
Var (βb1 |X ) = P
[ (xi − x )2 ]2
33 / 46
Variance of OLS Estimators
5) Using the property Var (aX |Y ) = a2 Var (X |Y ) for constant a:
P
Var ( (xi − x )(ui − u)|X )
Var (βb1 |X ) =
[ (xi − x )2 ]2
P
6) Using conditionality on X:
(xi − x )2 Var (ui |X )
X X
Var ( (xi − x )(ui − u)|X ) =
7) Assuming homoscedasticity. Let σ2 = Var (ui |X ). Then:
σ2 (xi − x )2
P
Var (βb1 |X ) = P
[ (xi − x )2 ]2
8) Simplify:
σ2
Var (βb1 |X ) = P
(xi − x )2
Therefore, the conditional variance of βb1 given X is:
σ2
Var (βb1 |X ) = P
(xi − x )2
33 / 46
Variance of OLS estimators
• We have:
σ2
Var (βb1 |X ) = P
(xi − x )2
• We need to estimate σ2
34 / 46
Variance of OLS estimators
• We have:
σ2
Var (βb1 |X ) = P
(xi − x )2
• We need to estimate σ2
34 / 46
Variance of OLS estimators
• We have:
σ2
Var (βb1 |X ) = P
(xi − x )2
• We need to estimate σ2
34 / 46
Variance of OLS estimators
• We have yi = β0 + β1 xi + ui
35 / 46
Variance of OLS estimators
• We have yi = β0 + β1 xi + ui
• We also have: yi = β
c0 + β
c1 xi + ubi
35 / 46
Variance of OLS estimators
• We have yi = β0 + β1 xi + ui
• We also have: yi = β
c0 + β
c1 xi + ubi
• We obtain: ubi = yi − β
c0 − β
c1 xi = (β0 + β1 xi + ui ) − β
c0 − β
c1 xi
35 / 46
Variance of OLS estimators
• We have yi = β0 + β1 xi + ui
• We also have: yi = β
c0 + β
c1 xi + ubi
• We obtain: ubi = yi − β
c0 − β
c1 xi = (β0 + β1 xi + ui ) − β
c0 − β
c1 xi
• Which is equivalent to ubi = ui − (βc0 − β0 ) − (β
c1 − β1 )xi
35 / 46
Variance of OLS estimators
36 / 46
Variance of OLS estimators
36 / 46
Variance of OLS estimators
1 n
• We estimate σ2 with σ ui2
X
c2 = c
n − 2 i =1
36 / 46
Variance of OLS estimators
1 n
• We estimate σ2 with σ ui2
X
c2 = c
n − 2 i =1
• Why n-2?
n
X n
X
• We need ubi = 0 and xi ubi = 0
i =1 i =1
• We pick at least two residuals to satisfy these conditions
36 / 46
Variance of OLS estimators
2
c1 |X ) = P σ
• We have Var (β
(xi − x )2
d (βb1 |X ) = P σ
c2
• We estimate it with: Var
(xi − x )2
v
u
u σc2 σ
• We define the standard error se(β1 ) = t P
b
c
2
=P 1
(xi − x ) (xi − x ) 2
37 / 46
1 Last Week
4 Let’s recap
38 / 46
Let’s recap
39 / 46
Let’s recap
39 / 46
Let’s recap
39 / 46
Let’s recap
39 / 46
Let’s recap
39 / 46
Let’s recap
39 / 46
Let’s recap
Raw data
40 / 46
Let’s recap
Many estimators are possible (and bad)
41 / 46
Let’s recap
OLS estimator
42 / 46
Let’s recap
OLS Estimator is unbiased
43 / 46
Let’s recap
OLS Estimators can be imprecise depending on the
data
44 / 46
Formulas to know
• OLS Estimators
n
P
(xi − x )(yi − y )
• β
c1 = i =1
n
(xi − x )2
P
i =1
45 / 46
Formulas to know
• OLS Estimators
n
P
(xi − x )(yi − y )
• β
c1 = i =1
n
(xi − x )2
P
i =1
• β
c0 = y − β
c1 x
45 / 46
Formulas to know
• OLS Estimators
n
P
(xi − x )(yi − y )
• β
c1 = i =1
n
(xi − x )2
P
i =1
• β
c0 = y − β
c1 x
• Variances
1 X n
c2 =
• σ uc2
n − 2 i =1 i
45 / 46
Formulas to know
• OLS Estimators
n
P
(xi − x )(yi − y )
• β
c1 = i =1
n
(xi − x )2
P
i =1
• β
c0 = y − β
c1 x
• Variances
1 X n
c2 =
• σ uc2
n − 2 i =1 i
d (βb1 |X ) = P σ
c2
• Var
(xi − x )2
45 / 46
Formulas to know
• OLS Estimators
n
P
(xi − x )(yi − y )
• β
c1 = i =1
n
(xi − x )2
P
i =1
• β
c0 = y − β
c1 x
• Variances
1 X n
c2 =
• σ uc2
n − 2 i =1 i
d (βb1 |X ) = P σ
c2
• Var
(xi − x )2
n
σ 1
2 x2
c P
n i
d (βb0 |X ) = P
• Var i =1
(xi − x )2
45 / 46
Time for a quizz
46 / 46