lecture 4: multiple ols regression

80
Lecture 4: Multiple OLS Regression Introduction to Econometrics,Fall 2020 Zhaopeng Qu Nanjing University 10/15/2020 Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 1 / 79

Upload: others

Post on 26-Dec-2021

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 4: Multiple OLS Regression

Lecture 4: Multiple OLS RegressionIntroduction to Econometrics,Fall 2020

Zhaopeng Qu

Nanjing University

10/15/2020

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 1 / 79

Page 2: Lecture 4: Multiple OLS Regression

1 Review for the previous lectures

2 Multiple OLS Regression: Introduction

3 Multiple OLS Regression: Estimation

4 Partitioned Regression: OLS Estimators in Multiple Regression

5 Measures of Fit in Multiple Regression

6 Categoried Variable as independent variables in Regression

7 Multiple Regression: Assumption

8 Properties of OLS Estimators in Multiple Regression

9 Multiple OLS Regression and Causality

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 2 / 79

Page 3: Lecture 4: Multiple OLS Regression

Review for the previous lectures

Section 1

Review for the previous lectures

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 3 / 79

Page 4: Lecture 4: Multiple OLS Regression

Review for the previous lectures

Simple OLS formula

The linear regression model with one regressor is denoted by

๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐‘ข๐‘–

Where๐‘Œ๐‘– is the dependent variable(Test Score)๐‘‹๐‘– is the independent variable or regressor(Class Size orStudent-Teacher Ratio)๐‘ข๐‘– is the error term which contains all the other factors besides ๐‘‹that determine the value of the dependent variable, ๐‘Œ , for a specificobservation, ๐‘–.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 4 / 79

Page 5: Lecture 4: Multiple OLS Regression

Review for the previous lectures

The OLS Estimator

The estimators of the slope and intercept that minimize the sum ofthe squares of ๏ฟฝ๏ฟฝ๐‘–,thus

๐‘Ž๐‘Ÿ๐‘” ๐‘š๐‘–๐‘›๐‘0,๐‘1

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ2๐‘– = ๐‘š๐‘–๐‘›

๐‘0,๐‘1

๐‘›โˆ‘๐‘–=1

(๐‘Œ๐‘– โˆ’ ๐‘0 โˆ’ ๐‘1๐‘‹๐‘–)2

are called the ordinary least squares (OLS) estimators of ๐›ฝ0 and๐›ฝ1.

OLS estimator of ๐›ฝ1:

๐‘1 = ๐›ฝ1 = โˆ‘๐‘›๐‘–=1(๐‘‹๐‘– โˆ’ ๐‘‹)(๐‘Œ๐‘– โˆ’ ๐‘Œ )

โˆ‘๐‘›๐‘–=1(๐‘‹๐‘– โˆ’ ๐‘‹)(๐‘‹๐‘– โˆ’ ๐‘‹)

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 5 / 79

Page 6: Lecture 4: Multiple OLS Regression

Review for the previous lectures

Least Squares Assumptions

Under 3 least squares assumptions,1 Assumption 12 Assumption 23 Assumption 3

the OLS estimators will be1 unbiased2 consistent3 normal sampling distribution

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 6 / 79

Page 7: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Section 2

Multiple OLS Regression: Introduction

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 7 / 79

Page 8: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Violation of the first Least Squares Assumption

Recall simple OLS regression equation

๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐‘ข๐‘–

Question: What does ๐‘ข๐‘– represent?Answer: contains all other factors(variables) which potentially affect๐‘Œ๐‘–.

Assumption 1๐ธ(๐‘ข๐‘–|๐‘‹๐‘–) = 0

It states that ๐‘ข๐‘– are unrelated to ๐‘‹๐‘– in the sense that,given a value of๐‘‹๐‘–,the mean of these other factors equals zero.But what if they (or at least one) are correlated with ๐‘‹๐‘–?

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 8 / 79

Page 9: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Example: Class Size and Test Score

Many other factors can affect studentโ€™s performance in the school.

One of factors is the share of immigrants in the class(school,district). Because immigrant children may have different backgroundsfrom native children, such as

parentsโ€™education levelfamily income and wealthparenting styletraditional culture

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 9 / 79

Page 10: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Scatter Plot: The share of immigrants and STR

14

16

18

20

22

24

26

0 25 50 75the share of immigrants

stud

entโˆ’

teac

her

ratio

higher share of immigrants, bigger class sizeZhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 10 / 79

Page 11: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Scatter Plot: The share of immigrants and STR

630

660

690

0 25 50 75the share of immigrants

test

sco

res

higher share of immigrants, lower testscoreZhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 11 / 79

Page 12: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

The share of immigrants as an Omitted Variable

Class size may be related to percentage of English learners andstudents who are still learning English likely have lower test scores.

In other words, the effect of class size on scores we had obtained insimple OLS may contain an effect of immigrants on scores.

It implies that percentage of English learners is contained in ๐‘ข๐‘–, inturn that Assumption 1 is violated, more precisely,the estimates of

๐›ฝ1 and ๐›ฝ0 are biased and inconsistent.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 12 / 79

Page 13: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias: IntroductionAs before, ๐‘‹๐‘– and ๐‘Œ๐‘– represent STR and Test Score.

Besides, ๐‘Š๐‘– is the variable which represents the share of Englishlearners.

Suppose that we have no information about it for some reasons, thenwe have to omit in the regression.

Then we have two regression:True model(Long regression):

๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐›พ๐‘Š๐‘– + ๐‘ข๐‘–

where ๐ธ(๐‘ข๐‘–|๐‘‹๐‘–, ๐‘Š๐‘–) = 0OVB model(Short regression):

๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐‘ฃ๐‘–

where ๐‘ฃ๐‘– = ๐›พ๐‘Š๐‘– + ๐‘ข๐‘–Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 13 / 79

Page 14: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias: Biasedness

Let us see what is the consequence of OVB

๐ธ[ ๐›ฝ1] = ๐ธ[โˆ‘(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ)(๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐‘ฃ๐‘– โˆ’ (๐›ฝ0 + ๐›ฝ1๐‘‹ + ๐‘ฃ))โˆ‘(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ)(๐‘‹๐‘– โˆ’ ๐‘‹)

]

= ๐ธ[โˆ‘(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ)(๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐›พ๐‘Š๐‘– + ๐‘ข๐‘– โˆ’ (๐›ฝ0 + ๐›ฝ1๐‘‹ + ๐›พ๐‘Š + ๐‘ข))โˆ‘(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ)(๐‘‹๐‘– โˆ’ ๐‘‹)

]

Skip Several steps in algebra which is very similar to procedures for provingunbiasedness of ๐›ฝ1,using the Law of Iterated Expectation(LIE) again.At last, we get (Please prove it by yourself)

๐ธ[ ๐›ฝ1] = ๐›ฝ1 + ๐›พ๐ธ[โˆ‘(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ)(๐‘Š๐‘– โˆ’ ๏ฟฝ๏ฟฝ)โˆ‘(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ)(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ) ]

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 14 / 79

Page 15: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias: Biasedness

As proving unbiasedness of ๐›ฝ1,we can know

If ๐‘Š๐‘– is unrelated to ๐‘‹๐‘–,then ๐ธ[ ๐›ฝ1] = ๐›ฝ1, because

๐ธ[โˆ‘(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ)(๐‘Š๐‘– โˆ’ ๏ฟฝ๏ฟฝ)โˆ‘(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ)(๐‘‹๐‘– โˆ’ ๏ฟฝ๏ฟฝ) ] = 0

If ๐‘Š๐‘– is not determinant of ๐‘Œ๐‘–, which means that

๐›พ = 0

,then ๐ธ[ ๐›ฝ1] = ๐›ฝ1, too.

Only if both two conditions above are violated simultaneously, then๐›ฝ1 is biased, which is normally called Omitted Variable Bias(OVB).

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 15 / 79

Page 16: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias(OVB): inconsistency

Recall: simple OLS is consistency when n is large, thus ๐‘๐‘™๐‘–๐‘š ๐›ฝ1 = ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–,๐‘Œ๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ(๐‘‹๐‘–)

๐‘๐‘™๐‘–๐‘š ๐›ฝ1 = ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Œ๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

= ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, (๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐‘ฃ๐‘–))๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

= ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, (๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐›พ๐‘Š๐‘– + ๐‘ข๐‘–))๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

= ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐›ฝ0) + ๐›ฝ1๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘‹๐‘–) + ๐›พ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Š๐‘–) + ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘ข๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

= ๐›ฝ1 + ๐›พ ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Š๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 16 / 79

Page 17: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias(OVB): inconsistency

Recall: simple OLS is consistency when n is large, thus ๐‘๐‘™๐‘–๐‘š ๐›ฝ1 = ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–,๐‘Œ๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ(๐‘‹๐‘–)

๐‘๐‘™๐‘–๐‘š ๐›ฝ1 = ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Œ๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

= ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, (๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐‘ฃ๐‘–))๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

= ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, (๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐›พ๐‘Š๐‘– + ๐‘ข๐‘–))๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

= ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐›ฝ0) + ๐›ฝ1๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘‹๐‘–) + ๐›พ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Š๐‘–) + ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘ข๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

= ๐›ฝ1 + ๐›พ ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Š๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 16 / 79

Page 18: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias(OVB): inconsistency

Thus we obtain

๐‘๐‘™๐‘–๐‘š ๐›ฝ1 = ๐›ฝ1 + ๐›พ ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Š๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ๐‘‹๐‘–

๐›ฝ1 is still consistentif ๐‘Š๐‘– is unrelated to X, thus ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Š๐‘–) = 0if ๐‘Š๐‘– has no effect on ๐‘Œ๐‘–, thus ๐›พ = 0

If both two conditions above hold simultaneously, then ๐›ฝ1 isinconsistent.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 17 / 79

Page 19: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias(OVB):Directions

If OVB can be possible in our regression,then we should guess thedirections of the bias, in case that we canโ€™t eliminate it.

Summary of the bias when ๐‘ค๐‘– is omitted in estimating equation

๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Š๐‘–) > 0 ๐ถ๐‘œ๐‘ฃ(๐‘‹๐‘–, ๐‘Š๐‘–) < 0๐›พ > 0 Positive bias Negative bias๐›พ < 0 Negative bias Positive bias

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 18 / 79

Page 20: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias: Examples

Question: If we omit following variables, then what are the directionsof these biases? and why?

1 Time of day of the test2 Parking lot space per pupil3 Teachersโ€™ Salary4 Family income5 Percentage of English learners(the Share of Immigrants)

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 19 / 79

Page 21: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias: ExamplesRegress Testscore on Class size

#### Call:## lm(formula = testscr ~ str, data = ca)#### Residuals:## Min 1Q Median 3Q Max## -47.727 -14.251 0.483 12.822 48.540#### Coefficients:## Estimate Std. Error t value Pr(>|t|)## (Intercept) 698.9330 9.4675 73.825 < 2e-16 ***## str -2.2798 0.4798 -4.751 2.78e-06 ***## ---## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#### Residual standard error: 18.58 on 418 degrees of freedom## Multiple R-squared: 0.05124, Adjusted R-squared: 0.04897## F-statistic: 22.58 on 1 and 418 DF, p-value: 2.783e-06

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 20 / 79

Page 22: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias: ExamplesRegress Testscore on Class size and the percentage of English learners

#### Call:## lm(formula = testscr ~ str + el_pct, data = ca)#### Residuals:## Min 1Q Median 3Q Max## -48.845 -10.240 -0.308 9.815 43.461#### Coefficients:## Estimate Std. Error t value Pr(>|t|)## (Intercept) 686.03225 7.41131 92.566 < 2e-16 ***## str -1.10130 0.38028 -2.896 0.00398 **## el_pct -0.64978 0.03934 -16.516 < 2e-16 ***## ---## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#### Residual standard error: 14.46 on 417 degrees of freedom## Multiple R-squared: 0.4264, Adjusted R-squared: 0.4237## F-statistic: 155 on 2 and 417 DF, p-value: < 2.2e-16

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 21 / 79

Page 23: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Omitted Variable Bias: Examples่กจ 2: Class Size and Test Score

Dependent variable:testscr

(1) (2)str โˆ’2.280โˆ—โˆ—โˆ— โˆ’1.101โˆ—โˆ—โˆ—

(0.480) (0.380)el_pct โˆ’0.650โˆ—โˆ—โˆ—

(0.039)Constant 698.933โˆ—โˆ—โˆ— 686.032โˆ—โˆ—โˆ—

(9.467) (7.411)Observations 420 420R2 0.051 0.426

Note: โˆ—p<0.1; โˆ—โˆ—p<0.05; โˆ—โˆ—โˆ—p<0.01

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 22 / 79

Page 24: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Introduction

Warp Up

OVB bias is the most possible bias when we run OLS regression usingnonexperimental data.

OVB bias means that there are some variables which should havebeen included in the regression but actually was not.

Then the simplest way to overcome OVB: Put omitted variables intothe regression, which means our regression model is

๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹๐‘– + ๐›พ๐‘Š๐‘– + ๐‘ข๐‘–

The strategy can be denoted as controlling informally, whichintroduces the more general regression model: Multiple OLSRegression.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 23 / 79

Page 25: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Estimation

Section 3

Multiple OLS Regression: Estimation

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 24 / 79

Page 26: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Estimation

Multiple regression model with k regressors

The multiple regression model is

๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹1,๐‘– + ๐›ฝ2๐‘‹2,๐‘– + ... + ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘– + ๐‘ข๐‘–, ๐‘– = 1, ..., ๐‘› (4.1)

where

๐‘Œ๐‘– is the dependent variable๐‘‹1, ๐‘‹2, ...๐‘‹๐‘˜ are the independent variables(includes one is our ofinterest and some control variables)๐›ฝ๐‘–, ๐‘— = 1...๐‘˜ are slope coefficients on ๐‘‹๐‘– corresponding.๐›ฝ0 is the estimate intercept, the value of Y when all ๐‘‹๐‘— = 0, ๐‘— = 1...๐‘˜๐‘ข๐‘– is the regression error term, still all other factors affect outcomes.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 25 / 79

Page 27: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Estimation

Interpretation of coefficients ๐›ฝ๐‘–, ๐‘— = 1...๐‘˜

๐›ฝ๐‘— is partial (marginal) effect of ๐‘‹๐‘— on Y.

๐›ฝ๐‘— = ๐œ•๐‘Œ๐‘–๐œ•๐‘‹๐‘—,๐‘–

๐›ฝ๐‘— is also partial (marginal) effect of ๐ธ[๐‘Œ๐‘–|๐‘‹1..๐‘‹๐‘˜].

๐›ฝ๐‘— = ๐œ•๐ธ[๐‘Œ๐‘–|๐‘‹1, ..., ๐‘‹๐‘˜]๐œ•๐‘‹๐‘—,๐‘–

it does mean that we are estimate the effect of X on Y when โ€œotherthings equalโ€, thus the concept of ceteris paribus.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 26 / 79

Page 28: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Estimation

OLS Estimation in Multiple Regressors

As in a Simple OLS Regression, the estimators of Multiple OLSRegression is just a minimize the following question

๐‘Ž๐‘Ÿ๐‘”๐‘š๐‘–๐‘› โˆ‘๐‘0,๐‘1,...,๐‘๐‘˜

(๐‘Œ๐‘– โˆ’ ๐‘0 โˆ’ ๐‘1๐‘‹1,๐‘– โˆ’ ... โˆ’ ๐‘๐‘˜๐‘‹๐‘˜,๐‘–)2

where ๐‘0 = ๐›ฝ1, ๐‘1 = ๐›ฝ2, ..., ๐‘๐‘˜ = ๐›ฝ๐‘˜ are estimators.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 27 / 79

Page 29: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Estimation

OLS Estimation in Multiple Regressors

Similarly in Simple OLS, based on F.O.C,the multiple OLS estimators๐›ฝ0, ๐›ฝ1, ..., ๐›ฝ๐‘˜ are obtained by solving the following system of normal

equations

๐œ•๐œ•๐‘0

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ2๐‘– = โˆ‘ (๐‘Œ๐‘– โˆ’ ๐›ฝ0 โˆ’ ๐›ฝ1๐‘‹1,๐‘– โˆ’ ... โˆ’ ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘–) = 0

๐œ•๐œ•๐‘1

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ2๐‘– = โˆ‘ (๐‘Œ๐‘– โˆ’ ๐›ฝ0 โˆ’ ๐›ฝ1๐‘‹1,๐‘– โˆ’ ... โˆ’ ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘–)๐‘‹1,๐‘– = 0

โ‹ฎ =โ‹ฎ =โ‹ฎ๐œ•

๐œ•๐‘๐‘˜

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ2๐‘– = โˆ‘ (๐‘Œ๐‘– โˆ’ ๐›ฝ0 โˆ’ ๐›ฝ1๐‘‹1,๐‘– โˆ’ ... โˆ’ ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘–)๐‘‹๐‘˜,๐‘– = 0

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 28 / 79

Page 30: Lecture 4: Multiple OLS Regression

Multiple OLS Regression: Estimation

OLS Estimation in Multiple RegressorsSimilar to in Simple OLS, the fitted residuals are

๐‘ข๐‘– = ๐‘Œ๐‘– โˆ’ ๐›ฝ0 โˆ’ ๐›ฝ1๐‘‹1,๐‘– โˆ’ ... โˆ’ ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘–

Therefore, the normal equations also can be written as

โˆ‘ ๐‘ข๐‘– = 0โˆ‘ ๐‘ข๐‘–๐‘‹1,๐‘– = 0

โ‹ฎ =โ‹ฎโˆ‘ ๐‘ข๐‘–๐‘‹๐‘˜,๐‘– = 0

While it is convenient to transform equations above using matrixalgebra to compute these estimators, we can use partitionedregression to obtain the formula of estimators without usingmatrices.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 29 / 79

Page 31: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Section 4

Partitioned Regression: OLS Estimators inMultiple Regression

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 30 / 79

Page 32: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Partitioned regression: OLS estimatorsA useful representation of ๐›ฝ๐‘— could be obtained by the partitionedregression.

The OLS estimator of ๐›ฝ๐‘—; ๐‘— = 1, 2...๐‘˜ can be computed in threesteps:

1 Regress ๐‘‹๐‘— on ๐‘‹1, ๐‘‹2, ...๐‘‹๐‘—โˆ’1, ๐‘‹๐‘—+1, ๐‘‹๐‘˜, thus๐‘‹๐‘—,๐‘– = ๐›พ0 + ๐›พ1๐‘‹1๐‘– + ... + ๐›พ๐‘—โˆ’1๐‘‹๐‘—โˆ’1,๐‘– + ๐›พ๐‘—+1๐‘‹๐‘—+1,๐‘–... + ๐›พ๐‘˜๐‘‹๐‘˜,๐‘– + ๐‘ฃ๐‘—๐‘–

2 Obtain the residuals from the regression above,denoted as ๏ฟฝ๏ฟฝ๐‘—,๐‘– = ๐‘ฃ๐‘—๐‘–3 Regress ๐‘Œ on ๏ฟฝ๏ฟฝ๐‘—,๐‘–

The last step implies that the OLS estimator of ๐›ฝ๐‘— can be expressedas follows

๐›ฝ๐‘— = โˆ‘๐‘›๐‘–=1 (๏ฟฝ๏ฟฝ๐‘—๐‘– โˆ’ ๏ฟฝ๏ฟฝ๐‘—๐‘–)(๐‘Œ๐‘– โˆ’ ๐‘Œ )

โˆ‘๐‘›๐‘–=1 (๏ฟฝ๏ฟฝ๐‘—๐‘– โˆ’ ๏ฟฝ๏ฟฝ๐‘—๐‘–)2

= โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ๐‘—๐‘–๐‘Œ๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

๐‘—๐‘–

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 31 / 79

Page 33: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Partitioned regression: OLS estimatorsSuppose we want to obtain an expression for ๐›ฝ1.

Then the first step: regress ๐‘‹1,๐‘– on other regressors, thus

๐‘‹1,๐‘– = ๐›พ0 + ๐›พ2๐‘‹2,๐‘– + ... + ๐›พ๐‘˜๐‘‹๐‘˜,๐‘– + ๐‘ฃ๐‘–

Then, we can obtain

๐‘‹1,๐‘– = ๐›พ0 + ๐›พ2๐‘‹2,๐‘– + ... + ๐›พ๐‘˜๐‘‹๐‘˜,๐‘– + ๏ฟฝ๏ฟฝ1,๐‘–

where ๏ฟฝ๏ฟฝ1,๐‘– is the fitted OLS residual,thus ๏ฟฝ๏ฟฝ๐‘—,๐‘– = ๐‘ฃ1๐‘–

Then we could prove that

๐›ฝ1 = โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘Œ๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1,๐‘–

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 32 / 79

Page 34: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Proof of Partitioned regression result(1)

Recall ๐‘ข๐‘– are the residuals for the Multiple OLS regression equation,thus

๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹1,๐‘– + ๐›ฝ2๐‘‹2,๐‘– + ... + ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘– + ๏ฟฝ๏ฟฝ๐‘–

Then we haveโˆ‘ ๏ฟฝ๏ฟฝ๐‘– = โˆ‘ ๏ฟฝ๏ฟฝ๐‘–๐‘‹๐‘—๐‘– = 0, ๐‘— = 1, 2, ..., ๐‘˜

Likewise,๏ฟฝ๏ฟฝ1๐‘– are the residuals for the partitioned regression equation on๐‘‹2๐‘–..., ๐‘‹๐‘˜๐‘–, then we have

โˆ‘ ๏ฟฝ๏ฟฝ1๐‘– = โˆ‘ ๏ฟฝ๏ฟฝ1๐‘–๐‘‹2,๐‘– = ... = โˆ‘ ๏ฟฝ๏ฟฝ1๐‘–๐‘‹๐‘˜,๐‘– = 0

Additionally, because๏ฟฝ๏ฟฝ1,๐‘– = ๐‘‹1,๐‘– โˆ’ ๐›พ0 โˆ’ ๐›พ2๐‘‹2,๐‘– โˆ’ ... โˆ’ ๐›พ๐‘˜๐‘‹๐‘˜,๐‘–, then

โˆ‘ ๏ฟฝ๏ฟฝ๐‘–๏ฟฝ๏ฟฝ๐‘—๐‘– = 0

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 33 / 79

Page 35: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Proof of Partitioned regression result(2)

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘Œ๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1,๐‘–= โˆ‘ ๏ฟฝ๏ฟฝ1,๐‘–( ๐›ฝ0 + ๐›ฝ1๐‘‹1,๐‘– + ๐›ฝ2๐‘‹2,๐‘– + ... + ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘– + ๏ฟฝ๏ฟฝ๐‘–)

โˆ‘ ๏ฟฝ๏ฟฝ21,๐‘–

= ๐›ฝ0โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

+ ๐›ฝ1โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘‹1,๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

+ ...

+ ๐›ฝ๐‘˜โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘‹๐‘˜,๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

+ โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๏ฟฝ๏ฟฝ๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1,๐‘–

= ๐›ฝ1โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘‹1,๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 34 / 79

Page 36: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Proof of Partitioned regression result(3)

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ1,๐‘–๐‘‹1,๐‘– =๐‘›

โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ1,๐‘–( ๐›พ0 + ๐›พ2๐‘‹2,๐‘– + ... + ๐›พ๐‘˜๐‘‹๐‘˜,๐‘– + ๏ฟฝ๏ฟฝ1,๐‘–)

= ๐›พ0 โ‹… 0 + ๐›พ2 โ‹… 0 + ... + ๐›พ๐‘˜ โ‹… 0 + โˆ‘ ๏ฟฝ๏ฟฝ21,๐‘–

= โˆ‘ ๏ฟฝ๏ฟฝ21,๐‘–

Thenโˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘Œ๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

= ๐›ฝ1โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘‹1,๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

= ๐›ฝ1

Identical argument works for ๐‘— = 2, 3, ..., ๐‘˜, thus

๐›ฝ๐‘— = โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ๐‘—,๐‘–๐‘Œ๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

๐‘—,๐‘–๐‘“๐‘œ๐‘Ÿ ๐‘— = 1, 2, .., ๐‘˜

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 35 / 79

Page 37: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

The intuition of Partitioned regression

Partialling Out

First, we regress ๐‘‹๐‘— against the rest of the regressors (and aconstant) and keep ๏ฟฝ๏ฟฝ๐‘— which is the โ€œpartโ€ of ๐‘‹๐‘— that is uncorrelated

Then, to obtain ๐›ฝ๐‘— , we regress Y against ๏ฟฝ๏ฟฝ๐‘— which is โ€œcleanโ€ fromcorrelation with other regressors.

๐›ฝ๐‘— measures the effect of ๐‘‹1 after the effects of ๐‘‹2, ..., ๐‘‹๐‘˜ have beenpartialled out or netted out.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 36 / 79

Page 38: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Test Scores and Student-Teacher Ratios

Now we put two additional control variables into our OLS regressionmodel

๐‘‡ ๐‘’๐‘ ๐‘ก๐‘ ๐‘๐‘œ๐‘Ÿ๐‘’ = ๐›ฝ0 + ๐›ฝ1๐‘†๐‘‡ ๐‘… + ๐›ฝ2๐‘’๐‘™๐‘๐‘๐‘ก + ๐›ฝ3๐‘Ž๐‘ฃ๐‘”๐‘–๐‘›๐‘ + ๐‘ข๐‘–

elpct: the share of English learners as an indicator for immigrants

avginc: average income of the district as an indicator for familybackgrounds

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 37 / 79

Page 39: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Test Scores and Student-Teacher Ratios(2)

tilde.str <- residuals(lm(str ~ el_pct, data=ca))mean(tilde.str) # should be zero

## [1] -1.0111e-16sum(tilde.str) # also is zero

## [1] -4.240358e-14

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 38 / 79

Page 40: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Test Scores and Student-Teacher Ratios(3)

Multiple OLS estimator

๐›ฝ๐‘— = โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ๐‘—,๐‘–๐‘Œ๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

๐‘—,๐‘–๐‘“๐‘œ๐‘Ÿ ๐‘— = 1, 2, .., ๐‘˜

sum(tilde.str*ca$testscr)/sum(tilde.str^2)

## [1] -1.101296

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 39 / 79

Page 41: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Test Scores and Student-Teacher Ratios(4)reg3 <- lm(testscr ~ tilde.str,data = ca)summary(reg3)

#### Call:## lm(formula = testscr ~ tilde.str, data = ca)#### Residuals:## Min 1Q Median 3Q Max## -48.693 -14.124 0.988 13.209 50.872#### Coefficients:## Estimate Std. Error t value Pr(>|t|)## (Intercept) 654.1565 0.9254 706.864 <2e-16 ***## tilde.str -1.1013 0.4986 -2.209 0.0277 *## ---## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#### Residual standard error: 18.97 on 418 degrees of freedom## Multiple R-squared: 0.01154, Adjusted R-squared: 0.009171## F-statistic: 4.878 on 1 and 418 DF, p-value: 0.02774Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 40 / 79

Page 42: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Test Scores and Student-Teacher Ratios(5)reg4 <- lm(testscr ~ str+el_pct,data = ca)summary(reg4)

#### Call:## lm(formula = testscr ~ str + el_pct, data = ca)#### Residuals:## Min 1Q Median 3Q Max## -48.845 -10.240 -0.308 9.815 43.461#### Coefficients:## Estimate Std. Error t value Pr(>|t|)## (Intercept) 686.03225 7.41131 92.566 < 2e-16 ***## str -1.10130 0.38028 -2.896 0.00398 **## el_pct -0.64978 0.03934 -16.516 < 2e-16 ***## ---## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#### Residual standard error: 14.46 on 417 degrees of freedom## Multiple R-squared: 0.4264, Adjusted R-squared: 0.4237## F-statistic: 155 on 2 and 417 DF, p-value: < 2.2e-16Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 41 / 79

Page 43: Lecture 4: Multiple OLS Regression

Partitioned Regression: OLS Estimators in Multiple Regression

Test Scores and Student-Teacher Ratios(6)่กจ 3: Class Size and Test Score

Dependent variable:testscr

(1) (2)tilde.str โˆ’1.101โˆ—โˆ—

(0.499)str โˆ’1.101โˆ—โˆ—โˆ—

(0.380)el_pct โˆ’0.650โˆ—โˆ—โˆ—

(0.039)Constant 654.157โˆ—โˆ—โˆ— 686.032โˆ—โˆ—โˆ—

(0.925) (7.411)Observations 420 420R2 0.012 0.426Adjusted R2 0.009 0.424

Note: โˆ—p<0.1; โˆ—โˆ—p<0.05; โˆ—โˆ—โˆ—p<0.01Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 42 / 79

Page 44: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Section 5

Measures of Fit in Multiple Regression

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 43 / 79

Page 45: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Measures of Fit: The ๐‘…2

Decompose ๐‘Œ๐‘– into the fitted value plus the residual ๐‘Œ๐‘– = ๐‘Œ๐‘– + ๏ฟฝ๏ฟฝ๐‘–

The total sum of squares (TSS): ๐‘‡ ๐‘†๐‘† = โˆ‘๐‘›๐‘–=1(๐‘Œ๐‘– โˆ’ ๐‘Œ )2

The explained sum of squares (ESS): โˆ‘๐‘›๐‘–=1( ๐‘Œ๐‘– โˆ’ ๐‘Œ )2

The sum of squared residuals (SSR): โˆ‘๐‘›๐‘–=1( ๐‘Œ๐‘– โˆ’ ๐‘Œ๐‘–)2 = โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ2๐‘–

And๐‘‡ ๐‘†๐‘† = ๐ธ๐‘†๐‘† + ๐‘†๐‘†๐‘…

The regression ๐‘…2 is the fraction of the sample variance of ๐‘Œ๐‘–explained by (or predicted by) the regressors.

๐‘…2 = ๐ธ๐‘†๐‘†๐‘‡ ๐‘†๐‘† = 1 โˆ’ ๐‘†๐‘†๐‘…

๐‘‡ ๐‘†๐‘†

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 44 / 79

Page 46: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Measures of Fit in Multiple RegressionWhen you put more variables into the regression, then ๐‘…2 alwaysincreases when you add another regressor. Because in general theSSR will decrease.

Consider two models๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹1๐‘– + ๐‘ข๐‘–

๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹1๐‘– + ๐›ฝ2๐‘‹2๐‘– + ๐‘ฃ๐‘–

Recall: about two residuals ๏ฟฝ๏ฟฝ๐‘– and ๐‘ฃ๐‘–, we have๐‘›

โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ๐‘– =๐‘›

โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ๐‘–๐‘‹1๐‘– = 0๐‘›

โˆ‘๐‘–=1

๐‘ฃ๐‘– =๐‘›

โˆ‘๐‘–=1

๐‘ฃ๐‘–๐‘‹1๐‘– =๐‘›

โˆ‘๐‘–=1

๐‘ฃ๐‘–๐‘‹2๐‘– = 0

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 45 / 79

Page 47: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Measures of Fit in Multiple Regression

we will show that ๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ2๐‘– โ‰ฅ

๐‘›โˆ‘๐‘–=1

๐‘ฃ2๐‘–

therefore ๐‘…2๐‘ฃ โ‰ฅ ๐‘…2

๐‘ข, thus ๐‘…2 the regression with one regressor is lessor equal than ๐‘…2 that corresponds to the regression with tworegressors.

This conclusion can be generalized to the case of ๐‘˜ + 1 regressors.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 46 / 79

Page 48: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Measures of Fit in Multiple Regression

At first we would like to know โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ๐‘– ๐‘ฃ๐‘–

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ๐‘– ๐‘ฃ๐‘– =๐‘›

โˆ‘๐‘–=1

(๐‘Œ๐‘– โˆ’ ๐›ฝ0 โˆ’ ๐›ฝ1๐‘‹1๐‘–) ๐‘ฃ๐‘–

=๐‘›

โˆ‘๐‘–=1

๐‘Œ๐‘– ๐‘ฃ๐‘– โˆ’ ๐›ฝ0๐‘›

โˆ‘๐‘–=1

๐‘ฃ๐‘– โˆ’ ๐›ฝ1๐‘›

โˆ‘๐‘–=1

๐‘‹1 ๐‘ฃ๐‘–

=๐‘›

โˆ‘๐‘–=1

๐‘Œ๐‘– ๐‘ฃ๐‘– โˆ’ ๐›ฝ0 โ‹… 0 โˆ’ ๐›ฝ1 โ‹… 0

=๐‘›

โˆ‘๐‘–=1

( ๐›ฝ0 + ๐›ฝ1๐‘‹1๐‘– + ๐›ฝ2๐‘‹2๐‘– + ๐‘ฃ๐‘–) ๐‘ฃ๐‘–

= โˆ‘๐‘–=1

๐‘ฃ๐‘– ๐‘ฃ๐‘–

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 47 / 79

Page 49: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Measures of Fit in Multiple Regression

Then we can obtain

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ2๐‘– โˆ’

๐‘›โˆ‘๐‘–=1

๐‘ฃ2๐‘– =

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ2๐‘– +

๐‘›โˆ‘๐‘–=1

๐‘ฃ2๐‘– โˆ’ 2

๐‘›โˆ‘๐‘–=1

๐‘ฃ2๐‘–

=๐‘›

โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ2๐‘– +

๐‘›โˆ‘๐‘–=1

๐‘ฃ2๐‘– โˆ’ 2

๐‘›โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ๐‘– ๐‘ฃ๐‘–

=๐‘›

โˆ‘๐‘–=1

(๏ฟฝ๏ฟฝ๐‘– โˆ’ ๐‘ฃ๐‘–)2 โ‰ฅ 0

- Therefore ๐‘…2๐‘ฃ โ‰ฅ ๐‘…2

๐‘ข, thus ๐‘…2 the regression with one regressor is less orequal than ๐‘…2 that corresponds to the regression with two regressors.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 48 / 79

Page 50: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Measures of Fit: The Adjusted ๐‘…2

the Adjusted ๐‘…2,is a modified version of the ๐‘…2 that does notnecessarily increase when a new regressor is added.

๐‘…2 = 1 โˆ’ ๐‘› โˆ’ 1๐‘› โˆ’ ๐‘˜ โˆ’ 1

๐‘†๐‘†๐‘…๐‘‡ ๐‘†๐‘† = 1 โˆ’ ๐‘ 2

๏ฟฝ๏ฟฝ๐‘ 2

๐‘Œ

because ๐‘›โˆ’1๐‘›โˆ’๐‘˜โˆ’1 is always greater than 1, so ๐‘…2 < ๐‘…2

adding a regressor has two opposite effects on the ๐‘…2.๐‘…2 can be negative.

Remind: neither ๐‘…2 nor ๐‘…2 is not the golden criterion for good orbad OLS estimation.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 49 / 79

Page 51: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Standard Error of the Regression

Recall: SER(Standard Error of the Regression)SER is an estimator of the standard deviation of the ๐‘ข๐‘–, which aremeasures of the spread of the Yโ€™s around the regression line.

Because the regression errors are unobserved, the SER is computedusing their sample counterparts, the OLS residuals ๐‘ข๐‘–

๐‘†๐ธ๐‘… = ๐‘ ๏ฟฝ๏ฟฝ = โˆš๐‘ 2๏ฟฝ๏ฟฝ

where ๐‘ 2๏ฟฝ๏ฟฝ = 1

๐‘›โˆ’๐‘˜โˆ’1 โˆ‘ ๐‘ข2๐‘– = ๐‘†๐‘†๐‘…๐‘›โˆ’๐‘˜โˆ’1

๐‘› โˆ’ ๐‘˜ โˆ’ 1 because we have ๐‘˜ + 1 stricted conditions in the F.O.C.Inanother word,in order to construct ๐‘ข2๐‘–, we have to estimate ๐‘˜ + 1parameters,thus ๐›ฝ0, ๐›ฝ1, ..., ๐›ฝ๐‘˜

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 50 / 79

Page 52: Lecture 4: Multiple OLS Regression

Measures of Fit in Multiple Regression

Example: Test scores and Student Teacher Ratios

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 51 / 79

Page 53: Lecture 4: Multiple OLS Regression

Categoried Variable as independent variables in Regression

Section 6

Categoried Variable as independent variables inRegression

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 52 / 79

Page 54: Lecture 4: Multiple OLS Regression

Categoried Variable as independent variables in Regression

A Special Case: Categorical Variable as ๐‘‹

Recall if ๐‘‹ is a dummy variable, then we can put it into regressionequation straightly.

What if ๐‘‹ is a categorical variable?Question: What is a categorical variable?

For example, we may define ๐ท๐‘– as follows:

๐ท๐‘– =โŽง{โŽจ{โŽฉ

1 small-size class if ๐‘†๐‘‡ ๐‘… in ๐‘–๐‘กโ„Ž school district < 182 middle-size class if 18 โ‰ค ๐‘†๐‘‡ ๐‘… in ๐‘–๐‘กโ„Ž school district < 223 large-size class if ๐‘†๐‘‡ ๐‘… in ๐‘–๐‘กโ„Ž school district โ‰ฅ 22

(4.5)

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 53 / 79

Page 55: Lecture 4: Multiple OLS Regression

Categoried Variable as independent variables in Regression

A Special Case: Categorical Variable as ๐‘‹

Naive Solution: a simple OLS regression model

๐‘‡ ๐‘’๐‘ ๐‘ก๐‘†๐‘๐‘œ๐‘Ÿ๐‘’๐‘– = ๐›ฝ0 + ๐›ฝ1๐ท๐‘– + ๐‘ข๐‘– (4.3)

Question: Can you explain the meanning of estimate coefficient ๐›ฝ1?

Answer: It doese not make sense that the coefficient of ๐›ฝ1 can beexplained as continuous variables.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 54 / 79

Page 56: Lecture 4: Multiple OLS Regression

Categoried Variable as independent variables in Regression

A Special Case: Categorical Variables as ๐‘‹The first step: turn a categorical variable(๐ท๐‘–) into multiple dummyvariables(๐ท1๐‘–, ๐ท2๐‘–, ๐ท3๐‘–)

๐ท1๐‘– = {1 small-sized class if ๐‘†๐‘‡ ๐‘… in ๐‘–๐‘กโ„Ž school district < 180 middle-sized class or large-sized class if not

๐ท2๐‘– = {1 middle-sized class if 18 โ‰ค ๐‘†๐‘‡ ๐‘… in ๐‘–๐‘กโ„Ž school district < 220 large-sized class or small-sized class if not

๐ท3๐‘– = {1 large-sized class if ๐‘†๐‘‡ ๐‘… in ๐‘–๐‘กโ„Ž school district โ‰ฅ 220 middle-sized class or small-sized class if not

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 55 / 79

Page 57: Lecture 4: Multiple OLS Regression

Categoried Variable as independent variables in Regression

A Special Case: Categorical Variables as ๐‘‹

We put these dummies into a multiple regression

๐‘‡ ๐‘’๐‘ ๐‘ก๐‘†๐‘๐‘œ๐‘Ÿ๐‘’๐‘– = ๐›ฝ0 + ๐›ฝ1๐ท1๐‘– + ๐›ฝ2๐ท2๐‘– + ๐›ฝ3๐ท3๐‘– + ๐‘ข๐‘– (4.6)

Then as a dummy variable as the independent variable in a simpleregression The coefficients (๐›ฝ1, ๐›ฝ2, ๐›ฝ3) represent the effect of everycategorical class on ๐‘ก๐‘’๐‘ ๐‘ก๐‘ ๐‘๐‘œ๐‘Ÿ๐‘’ respectively.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 56 / 79

Page 58: Lecture 4: Multiple OLS Regression

Categoried Variable as independent variables in Regression

A Special Case: Categorical Variables as ๐‘‹

In practice, we canโ€™t put all dummies into the regression, but onlyhave ๐‘› โˆ’ 1 dummies unless we will suffer perfect multi-collinearity.

The regression may be like as

๐‘‡ ๐‘’๐‘ ๐‘ก๐‘†๐‘๐‘œ๐‘Ÿ๐‘’๐‘– = ๐›ฝ0 + ๐›ฝ1๐ท1๐‘– + ๐›ฝ2๐ท2๐‘– + ๐‘ข๐‘– (4.6)

The default intercept term, ๐›ฝ0,represents the large-sized class.Then,the coefficients (๐›ฝ1, ๐›ฝ2) represent ๐‘ก๐‘’๐‘ ๐‘ก๐‘ ๐‘๐‘œ๐‘Ÿ๐‘’ gaps betweensmall_sized, middle-sized class and large-sized class,respectively.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 57 / 79

Page 59: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Section 7

Multiple Regression: Assumption

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 58 / 79

Page 60: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Multiple Regression: Assumption

Assumption 1: The conditional distribution of ๐‘ข๐‘– given ๐‘‹1๐‘–, ..., ๐‘‹๐‘˜๐‘–has mean zero,thus

๐ธ[๐‘ข๐‘–|๐‘‹1๐‘–, ..., ๐‘‹๐‘˜๐‘–] = 0

Assumption 2: (๐‘Œ๐‘–, ๐‘‹1๐‘–, ..., ๐‘‹๐‘˜๐‘–) are i.i.d.Assumption 3: Large outliers are unlikely.Assumption 4: No perfect multicollinearity.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 59 / 79

Page 61: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Perfect multicollinearity

Perfect multicollinearity arises when one of the regressors is a perfectlinear combination of the other regressors.

Binary variables are sometimes referred to as dummy variables

If you include a full set of binary variables (a complete and mutuallyexclusive categorization) and an intercept in the regression, you willhave perfect multicollinearity.

eg. female and male = 1-femaleeg. West, Central and East China

This is called the dummy variable trap.

Solutions to the dummy variable trap: Omit one of the groups or theintercept

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 60 / 79

Page 62: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Perfect multicollinearityregress Testscore on Class size and the percentage of English learners

#### Call:## lm(formula = testscr ~ str + el_pct, data = ca)#### Residuals:## Min 1Q Median 3Q Max## -48.845 -10.240 -0.308 9.815 43.461#### Coefficients:## Estimate Std. Error t value Pr(>|t|)## (Intercept) 686.03225 7.41131 92.566 < 2e-16 ***## str -1.10130 0.38028 -2.896 0.00398 **## el_pct -0.64978 0.03934 -16.516 < 2e-16 ***## ---## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#### Residual standard error: 14.46 on 417 degrees of freedom## Multiple R-squared: 0.4264, Adjusted R-squared: 0.4237## F-statistic: 155 on 2 and 417 DF, p-value: < 2.2e-16Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 61 / 79

Page 63: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Perfect multicollinearityadd a new variable nel=1-el_pct into the regression

#### Call:## lm(formula = testscr ~ str + nel_pct + el_pct, data = ca)#### Residuals:## Min 1Q Median 3Q Max## -48.845 -10.240 -0.308 9.815 43.461#### Coefficients: (1 not defined because of singularities)## Estimate Std. Error t value Pr(>|t|)## (Intercept) 685.38247 7.41556 92.425 < 2e-16 ***## str -1.10130 0.38028 -2.896 0.00398 **## nel_pct 0.64978 0.03934 16.516 < 2e-16 ***## el_pct NA NA NA NA## ---## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#### Residual standard error: 14.46 on 417 degrees of freedom## Multiple R-squared: 0.4264, Adjusted R-squared: 0.4237## F-statistic: 155 on 2 and 417 DF, p-value: < 2.2e-16

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 62 / 79

Page 64: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Perfect multicollinearity่กจ 4: Class Size and Test Score

Dependent variable:testscr

(1) (2)str โˆ’1.101โˆ—โˆ—โˆ— โˆ’1.101โˆ—โˆ—โˆ—

(0.380) (0.380)nel_pct 0.650โˆ—โˆ—โˆ—

(0.039)el_pct โˆ’0.650โˆ—โˆ—โˆ—

(0.039)Constant 686.032โˆ—โˆ—โˆ— 685.382โˆ—โˆ—โˆ—

(7.411) (7.416)Observations 420 420R2 0.426 0.426

Note: โˆ—p<0.1; โˆ—โˆ—p<0.05; โˆ—โˆ—โˆ—p<0.01Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 63 / 79

Page 65: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Multicollinearity

Multicollinearity means that two or more regressors are highly correlated,but one regressor is NOT a perfect linear function of one or more of theother regressors.

multicollinearity is NOT a violation of OLS assumptions.It does not impose theoretical problem for the calculation of OLSestimators.

But if two regressors are highly correlated, then the the coefficient onat least one of the regressors is imprecisely estimated (high variance).

to what extent two correlated variables can be seen as โ€œhighlycorrelatedโ€?

rule of thumb: correlation coefficient is over 0.8.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 64 / 79

Page 66: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Venn Diagrams for Multiple Regression Model

In a simple model (y on X),OLS uses โ€˜Blueโ€˜ + โ€˜Redโ€˜ toestimate ๐›ฝ.When y is regressed on Xand W: OLS throws awaythe red area and just usesblue to estimate ๐›ฝ.Idea: Red area iscontaminated(we do notknow if the movements iny are due to X or to W).

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 65 / 79

Page 67: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Venn Diagrams for Multicollinearity

less information (compare the Blue and Green areas in both figures) isused, the estimation is less precise.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 66 / 79

Page 68: Lecture 4: Multiple OLS Regression

Multiple Regression: Assumption

Multiple Regression: Test Scores and Class Size่กจ 5: Class Size and Test Score

testscr(1) (2) (3)

str โˆ’2.280โˆ—โˆ—โˆ— โˆ’1.101โˆ—โˆ—โˆ— โˆ’0.069(0.480) (0.380) (0.277)

el_pct โˆ’0.650โˆ—โˆ—โˆ— โˆ’0.488โˆ—โˆ—โˆ—

(0.039) (0.029)avginc 1.495โˆ—โˆ—โˆ—

(0.075)Constant 698.933โˆ—โˆ—โˆ— 686.032โˆ—โˆ—โˆ— 640.315โˆ—โˆ—โˆ—

(9.467) (7.411) (5.775)N 420 420 420R2 0.051 0.426 0.707Adjusted R2 0.049 0.424 0.705

Notes: โˆ—โˆ—โˆ—Significant at the 1 percent level.โˆ—โˆ—Significant at the 5 percent level.โˆ—Significant at the 10 percent level.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 67 / 79

Page 69: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

Section 8

Properties of OLS Estimators in MultipleRegression

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 68 / 79

Page 70: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

Properties of OLS estimators: Unbiasedness(1)Use partitioned regression formula

๐›ฝ1 = โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘Œ๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1,๐‘–

Substitute๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐‘‹1,๐‘– + ๐›ฝ2๐‘‹2,๐‘– + ... + ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘– + ๐‘ข๐‘–, ๐‘– = 1, ..., ๐‘›,then

๐›ฝ1 = โˆ‘ ๏ฟฝ๏ฟฝ1,๐‘–(๐›ฝ0 + ๐›ฝ1๐‘‹1,๐‘– + ๐›ฝ2๐‘‹2,๐‘– + ... + ๐›ฝ๐‘˜๐‘‹๐‘˜,๐‘– + ๐‘ข๐‘–)โˆ‘ ๏ฟฝ๏ฟฝ2

1,๐‘–

= ๐›ฝ0โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

+ ๐›ฝ1โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘‹1,๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

+ ...

+ ๐›ฝ๐‘˜โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘‹๐‘˜,๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

+ โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘ข๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1,๐‘–Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 69 / 79

Page 71: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

Properties of OLS estimators: Unbiasedness(2)

Because๐‘›

โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ1,๐‘– =๐‘›

โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ1,๐‘–๐‘‹๐‘—,๐‘– = 0 , ๐‘— = 2, 3, ..., ๐‘˜๐‘›

โˆ‘๐‘–=1

๏ฟฝ๏ฟฝ1,๐‘–๐‘‹1,๐‘– = โˆ‘ ๏ฟฝ๏ฟฝ21,๐‘–

Therefore๐›ฝ1 = ๐›ฝ1 + โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘ข๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 70 / 79

Page 72: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

Properties of OLS estimators: Unbiasedness(3)Recall Assumption 1: ๐ธ[๐‘ข๐‘–|๐‘‹1๐‘–, ๐‘‹2๐‘–...๐‘‹๐‘˜๐‘–] = 0 and ๏ฟฝ๏ฟฝ1๐‘– is afunction of ๐‘‹2๐‘–...๐‘‹๐‘˜๐‘–

Then take expectations of ๐›ฝ1 and The Law of IteratedExpectations again

๐ธ[ ๐›ฝ1] = ๐ธ[๐›ฝ1 + โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘ข๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1,๐‘–] = ๐›ฝ1 + ๐ธ[โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘ข๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

]

= ๐›ฝ1 + ๐ธ[โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐ธ[๐‘ข๐‘–|๐‘‹2๐‘–...๐‘‹๐‘˜๐‘–]

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1,๐‘–]

= ๐›ฝ1

Identical argument works for ๐›ฝ2, ..., ๐›ฝ๐‘˜, thus

๐ธ[ ๐›ฝ๐‘—] = ๐›ฝ๐‘— where ๐‘— = 1, 2, ..., ๐‘˜Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 71 / 79

Page 73: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

Properties of OLS estimators: Consistency(1)

Recall๐›ฝ1 = โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘Œ๐‘–โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ21,๐‘–

Similar to the proof in the Simple OLS Regression,thus

๐›ฝ1 = โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ1,๐‘–๐‘Œ๐‘–

โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1,๐‘–=

1๐‘›โˆ’2 โˆ‘๐‘›

๐‘–=1 ๏ฟฝ๏ฟฝ1๐‘–๐‘Œ๐‘–1

๐‘›โˆ’2 โˆ‘๐‘›๐‘–=1 ๏ฟฝ๏ฟฝ2

1๐‘–= (

๐‘ ๏ฟฝ๏ฟฝ1๐‘Œ๐‘ 2

๏ฟฝ๏ฟฝ1

)

where ๐‘ ๏ฟฝ๏ฟฝ1๐‘Œ and ๐‘ 2๏ฟฝ๏ฟฝ1

are the sample covariance of ๏ฟฝ๏ฟฝ1 and ๐‘Œ and thesample variance of ๏ฟฝ๏ฟฝ1.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 72 / 79

Page 74: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

Properties of OLS estimators: Consistency(2)

Base on L.L.N(the law of large numbers) and random sample(i.i.d)

๐‘ ๏ฟฝ๏ฟฝ21

๐‘โŸถ ๐œŽ๏ฟฝ๏ฟฝ2

1= ๐‘‰ ๐‘Ž๐‘Ÿ(๏ฟฝ๏ฟฝ1)

๐‘ ๏ฟฝ๏ฟฝ1๐‘Œ๐‘

โŸถ ๐œŽ๏ฟฝ๏ฟฝ1๐‘Œ = ๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐‘Œ )

Combining with Continuous Mapping Theorem,then we obtain theOLS estimator ๐›ฝ1,when ๐‘› โŸถ โˆž

๐‘๐‘™๐‘–๐‘š ๐›ฝ1 = ๐‘๐‘™๐‘–๐‘š(๐‘ ๏ฟฝ๏ฟฝ1๐‘Œ๐‘ 2

๏ฟฝ๏ฟฝ1

) = ๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐‘Œ )๐‘‰ ๐‘Ž๐‘Ÿ(๏ฟฝ๏ฟฝ1)

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 73 / 79

Page 75: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

Properties of OLS estimators: Consistency(3)

๐‘๐‘™๐‘–๐‘š ๐›ฝ1 = ๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐‘Œ )๐‘‰ ๐‘Ž๐‘Ÿ(๏ฟฝ๏ฟฝ1)

= ๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, (๐›ฝ0 + ๐›ฝ1๐‘‹1๐‘– + ... + ๐›ฝ๐‘˜๐‘‹๐‘˜๐‘– + ๐‘ข๐‘–))๐‘‰ ๐‘Ž๐‘Ÿ(๏ฟฝ๏ฟฝ1)

= ๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐›ฝ0) + ๐›ฝ1๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐‘‹1๐‘–) + ... + ๐›ฝ๐‘˜๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐‘‹๐‘˜๐‘–) + ๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐‘ข๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ(๏ฟฝ๏ฟฝ1)

= ๐›ฝ1 + ๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐‘ข๐‘–)๐‘‰ ๐‘Ž๐‘Ÿ(๏ฟฝ๏ฟฝ1)

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 74 / 79

Page 76: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

Properties of OLS estimators: Consistency(4)

Based on Assumption 1: ๐ธ[๐‘ข๐‘–|๐‘‹1๐‘–, ๐‘‹2๐‘–...๐‘‹๐‘˜๐‘–] = 0And ๏ฟฝ๏ฟฝ1๐‘– is a function of ๐‘‹2๐‘–...๐‘‹๐‘˜๐‘–

Then๐ถ๐‘œ๐‘ฃ(๏ฟฝ๏ฟฝ1, ๐‘ข๐‘–) = 0

Then we can obtain๐‘๐‘™๐‘–๐‘š ๐›ฝ1 = ๐›ฝ1

Identical argument works for ๐›ฝ2, ..., ๐›ฝ๐‘˜,thus

๐‘๐‘™๐‘–๐‘š ๐›ฝ๐‘— = ๐›ฝ๐‘— where ๐‘— = 1, 2, ..., ๐‘˜

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 75 / 79

Page 77: Lecture 4: Multiple OLS Regression

Properties of OLS Estimators in Multiple Regression

The Distribution of Multiple OLS Estimators

Recall from last lecture:Under the least squares assumptions,the OLS estimators ๐›ฝ1 and ๐›ฝ0, areunbiased and consistent estimators of ๐›ฝ1 and ๐›ฝ0.In large samples, the sampling distribution of ๐›ฝ1 and ๐›ฝ0 is wellapproximated by a bivariate normal distribution.

Similarly as in the simple OLS, the multiple OLS estimators areaverages of the randomly sampled data, and if the sample size issufficiently large, the sampling distribution of those averages becomesnormal.

Because the multivariate normal distribution is best handledmathematically using matrix algebra, the expressions for the jointdistribution of the OLS estimators are deferred to Chapter 18(SWtextbook).

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 76 / 79

Page 78: Lecture 4: Multiple OLS Regression

Multiple OLS Regression and Causality

Section 9

Multiple OLS Regression and Causality

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 77 / 79

Page 79: Lecture 4: Multiple OLS Regression

Multiple OLS Regression and Causality

Independent Variable v.s Control VariablesGenerally, we would like to pay more attention to only oneindependent variable(thus we would like to call it treatmentvariable), though there could be many independent variables.

Because ๐›ฝ๐‘— is partial (marginal) effect of ๐‘‹๐‘— on Y.

๐›ฝ๐‘— = ๐œ•๐‘Œ๐‘–๐œ•๐‘‹๐‘—,๐‘–

which means that we are estimate the effect of X on Y when โ€œotherthings equalโ€, thus the concept of ceteris paribus.

Therefore,other variables in the right hand of equation, we call themcontrol variables, which we would like to explicitly hold fixed whenstudying the effect of ๐‘‹1 on Y.

More specifically,regression model turns into๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐ท๐‘– + ๐›พ2๐ถ2,๐‘– + ... + ๐›พ๐‘˜๐ถ๐‘˜,๐‘– + ๐‘ข๐‘–, ๐‘– = 1, ..., ๐‘›

Transform it into๐‘Œ๐‘– = ๐›ฝ0 + ๐›ฝ1๐ท๐‘– + ๐ถ2...๐‘˜,๐‘–๐›พโ€ฒ

2...๐‘˜ + ๐‘ข๐‘–, ๐‘– = 1, ..., ๐‘›

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 78 / 79

Page 80: Lecture 4: Multiple OLS Regression

Multiple OLS Regression and Causality

Good Controls and Bad Controls

Questions: Are โ€œmore controlsโ€ always better (or at least never worse)?Answer: It depends on. Because there are such things as Bad Controls,which means that when add a control(put a variable into the regression), itmay overcome the OVB bias but also bring more other bias.Good controls, are variables determining the treatment and correlated withthe outcome. And we can think of them as having been fixed at the timethe treatment variable was determined.Irrelevant controls, are variables uncorrelated with the treatment butcorrelated with the outcome. It may help reducing standard errors.Bad controls are not the factors we would like make fixed but theoutcomes of treatment.We will soon come back to discuss this topic again in Lecture 7.

Zhaopeng Qu (Nanjing University) Lecture 4: Multiple OLS Regression 10/15/2020 79 / 79