ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This...

26
18/10/2017 1 Theory (1/3) ADVANCED ECONOMETRICS I Instructor: Joaquim J. S. Ramalho E.mail: [email protected] Personal Website: http://home.iscte-iul.pt/~jjsro Office: D5.10 Course Website: http://home.iscte-iul.pt/~jjsro/advancedeconometricsi.htm Fénix: https://fenix.iscte-iul.pt/disciplinas/03089-1/2017-2018/1- semestre Joaquim J.S. Ramalho This course provides an introduction to the modern econometric techniques used in the analysis of cross-sectional and panel data in the area of microeconometrics: The interaction between theory and empirical econometric analysis is emphasized Students will be trained in formulating and testing economic models using real data Pre -requisites (recommended): Introductory Econometrics Grading: Two individual home works (50%) + Final (open book) exam (50%) Minimum grade at the exam of 7/20 No re-sit examinations Course Description 2 Advanced Econometrics I 2017/2018 Joaquim J.S. Ramalho i. Introduction 1. Linear Regression Analysis with Cross-Sectional Data 2. Econometric Models with Endogenous Explanatory Variables 3. Static and Dynamic Panel Data Models 4. Limited Dependent Variable Models Contents - Theory 3 Advanced Econometrics I 2017/2018

Transcript of ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This...

Page 1: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

1

Theory (1/3)

ADVANCED ECONOMETRICS I

Instructor: Joaquim J. S. Ramalho

E.mail: [email protected]

Personal Website: http://home.iscte-iul.pt/~jjsro

Office: D5.10

Course Website: http://home.iscte-iul.pt/~jjsro/advancedeconometricsi.htm

Fénix: https://fenix.iscte-iul.pt/disciplinas/03089-1/2017-2018/1-

semestre

Joaquim J.S. Ramalho

This course provides an introduction to the modern econometric techniques used in the analysis of cross-sectionaland panel data in the area of microeconometrics:

▪ The interaction between theory and empirical econometric analysis is emphasized

▪ Students will be trained in formulating and testing economic models using real data

Pre-requisites (recommended):▪ Introductory Econometrics

Grading:▪ Two individual home works (50%) + Final (open book) exam (50%)

– Minimum grade at the exam of 7/20

▪ No re-sit examinations

Course Description

2Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

i. Introduction

1. Linear Regression Analysis with Cross-Sectional Data

2. Econometric Models with Endogenous Explanatory Variables

3. Static and Dynamic Panel Data Models

4. Limited Dependent Variable Models

Contents - Theory

3Advanced Econometrics I2017/2018

Page 2: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

2

Joaquim J.S. Ramalho

Recommended:▪ Cameron, A. and P.K. Trivedi (2005), Microeconometrics: Methods and

Applications, Cambridge University Press

Others:

▪ Baltagi, B. (2013), Econometric Analysis of Panel Data, John Wiley andSons (5th Edition)

▪ Davidson, R. and J.G. MacKinnon (2003), Econometric Theory andMethods, Oxford University Press

▪ Greene, W. (2011), Econometric Analysis, Pearson (7th Edition)

▪ Verbeek, M. (2012), A Guide to Modern Econometrics, Wiley (4th Edition)

▪ Wooldridge, J.M. (2010), Econometric Analysis of Cross Section andPanel Data, MIT Press (2nd Edition)

▪ Wooldridge, J.M. (2012), Introductory Econometrics: A ModernApproach, South Western (5th Edition).

Textbooks

4Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

1. Determinants of Firm Debt

2. Estimating the Returns to Schooling

3. Explaining Individual Wages

4. Explaining Capital Structure

5. Modelling the Choice Between Two Brands

6. Health Care Expenses and Consultations

7. Explaining Firm’s Credit Ratings

8. Travel Mode Choice

9. Health Care Expenses and Consultations (revisited)

10. Determinants of Firm Debt (revisited)

Contents - Illustrations

5Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Recommended:▪ Stata: http://www.stata.com

▪ R: https://cran.r-project.org

Others:▪ Gauss: http://www.aptech.com/products/gauss-mathematical-and-

statistical-system

▪ Matlab: https://www.mathworks.com/products/matlab

Software

6Advanced Econometrics I2017/2018

Page 3: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

3

Joaquim J.S. Ramalho

i.1. Econometric Methodology

i.2. The Structure of Economic and Financial Data

i.3. Dependent Variables and Econometric Models

i.4. Types of Explanatory Variables

i. Introduction

7Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Econometrics:

Definition:▪ Application of statistical techniques to the analysis of economic,

financial, social... data aiming at estimating relationships between a dependent variable and a set of explanatory variables

Ultimate purpose:▪ Theory validation

▪ Prediction / Forecasting

▪ Policy recommendation

i. Introductioni.1. Econometric Methodology

8Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

i. Introductioni.1. Econometric Methodology

Model specification

Data collection

Model estimation

Model evaluation

Suitable modelUnsuitable model

Result interpretation

Theory validationPolicy

recommendationPrediction / Forecasting

9Advanced Econometrics I2017/2018

Page 4: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

4

Joaquim J.S. Ramalho

Cross-sectional data:

N cross-sectional units (individuals / firms / cities / ...)

1 time observation per unit

Time series:

1 unit

T time observations per unit

Panel data

N units

T time observations per unit

i. Introductioni.2. The Structure of Economic and Financial Data

10Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Main types of econometric models:

Regression Model: ▪ Aim: explaining 𝐸 𝑌|𝑋

Probabilistic model:▪ Aim: explaining 𝑃𝑟 𝑌|𝑋

▪ Usually incorporates also a regression model for 𝐸 𝑌|𝑋

Each type of econometric model has many variants

i. Introductioni.3. Dependent Variables and Econometric Models

𝑌: dependent variable

𝑋: explanatory variables

𝐸 𝑌|𝑋 : expected value for 𝑌 given 𝑋

𝑃𝑟 𝑌|𝑋 : probability of 𝑌 being equal to a specific value given 𝑋

11Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

i. Introductioni.3. Dependent Variables and Econometric Models

𝑌 Type of outcome Main model

] − ∞, +∞[ Unbounded data Linear

[0, +∞[ Nonnegative data Exponential

[0,1] Fractional data Fractional Logit,...

{0,1} Binary choices Logit,...

{0,1,2, … , 𝐽 − 1} Multinomial choices Multinomial logit,…

{0,1,2, … , 𝐽 − 1} Ordered choices Ordered logit,…

{0,1,2, … } Count data Poisson,…

The numeric characteristics of the dependent variablerestricts the variants that may be applied in each case:

12Advanced Econometrics I2017/2018

Page 5: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

5

Joaquim J.S. Ramalho

Model Transformations and Adaptations:

Bounded continuous outcomes may often be transformed in such a way that they give rise to unbounded outcomes whichmay be modelled using a linear model

Any econometric model may require adaptations: ▪ Data structure: cross-section, time series, panel

▪ Non-random samples: stratified, censored, truncated

▪ Measurement error

▪ Endogenous explanatory variables

▪ Corner solutions

i. Introductioni.3. Dependent Variables and Econometric Models

13Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Quantitative variables:

Levels (Euro, kilograms, meters,…)

Levels and squares

Logs

Growth rates

Per capita values

Qualitative variables

Binary (dummy) variables:𝑋 = 0,1

Interaction variables:𝑋 = 𝐷𝑢𝑚𝑚𝑦 𝑣𝑎𝑟. ∗ 𝑄𝑢𝑎𝑛𝑡𝑖𝑡𝑎𝑡𝑖𝑣𝑒 𝑜𝑟 𝑑𝑢𝑚𝑚𝑦 𝑣𝑎𝑟.

i. Introductioni.4. Types of Explanatory Variables

14Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

1.1. The Linear Regression Model

1.1.1. Specification

1.1.2. Estimation

1.1.3. Interpretation

1.1.4. Inference

1.2. Model Evaluation

1.2.1. RESET Test

1.2.2. Tests for Heteroskedascity

1.2.3. Chow Test

1. Linear Regression Analysis with Cross-Sectional Data

15Advanced Econometrics I2017/2018

Page 6: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

6

Joaquim J.S. Ramalho

Model Specification:

𝑌𝑖 = 𝛽0 + 𝛽1𝑋1𝑖 + ⋯ + 𝛽𝑘𝑋𝑘𝑖 + 𝑢𝑖 𝑖 = 1, ⋯ , 𝑁

𝑌 = 𝑋𝛽 + 𝑢 𝐸 𝑌|𝑋 = 𝑋𝛽

Assumptions:

1. Random sampling

2. 𝐸 𝑢|𝑋 = 0

3. No perfect colinearity

4. Homoskedasticity: 𝑉𝑎𝑟 𝑢|𝑋 = 𝜎2

5. Normality: 𝑢~𝑁𝑜𝑟𝑚𝑎𝑙 0, 𝜎2

1.1. The Linear Regression Model1.1.1. Specification

𝑢: error term

𝛽: parameters

𝑘: n. explanatory variables

𝑝: n. parameters

𝑁: n. observations

𝜎2: error variance

16Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Estimation method - Ordinary Least Squares (OLS):

𝑚𝑖𝑛

𝑖=1

𝑁

ො𝑢𝑖2 , ො𝑢𝑖 = 𝑌𝑖 − 𝑌𝑖 , 𝑌𝑖 = መ𝛽0 + መ𝛽1𝑋1 + ⋯ + መ𝛽𝑘𝑋𝑘

መ𝛽 = 𝑋′𝑋 −1𝑋′𝑦

Estimator properties:

Finite samples:

▪ Assumptions 1-3: Unbiasedness

▪ Assumptions 1-4: Unbiasedness and efficiency

▪ Assumptions 1-5: Unbiasedness, efficiency and normality

Asymptotically:▪ Assumptions 1-3: Consistency

▪ Assumptions 1-4: Consistency, efficiency and normality

1.1. The Linear Regression Model1.1.2. Estimation

ො𝑢: residual

𝑌: fitted value of 𝑌

መ𝛽: estimate for 𝛽

Stataregress Y 𝑋1 ⋯ 𝑋𝑘

17Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Effects from unitary changes in a given explanatoryvariable:

∆𝑋𝑗= 1 ⇒ ∆𝑌 = 𝛽𝑗

Needs adaptation for:▪ Transformed dependent variables

▪ Transformed quantitative explanatory variables

▪ Qualitative explanatory variables

Aims:

▪ Most of the time: testing whether the effect is null or significantlydifferent from zero → it is equivalent to test whether a parameter or a set of a parameters or a linear combination of parameters are significantly different from zero

▪ Most of the time: analyze the sign of the effect (null, positive, negative)

▪ Sometimes: calculate and analyze the magnitude of the effect

1.1. The Linear Regression Model1.1.3. Interpretation

18Advanced Econometrics I2017/2018

Page 7: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

7

Joaquim J.S. Ramalho

Variance of the parameter estimators:

Needed for performing hypothesis tests

Alternative estimators:▪ Standard – assumes homoskedasticity

▪ Robust – valid under both homoskedasticity and heteroskedasticity

▪ Cluster-robust – specific for panel data

▪ Bootstrap – simulated variance, always valid provided that bootstrapsamples are generated under appropriate assumptions

1.1. The Linear Regression Model1.1.4. Inference

Stataregress Y 𝑋1 … 𝑋𝑘

regress Y 𝑋1 … 𝑋𝑘 , vce(robust)regress Y 𝑋1 … 𝑋𝑘 , vce(cluster clustvar)regress Y 𝑋1 … 𝑋𝑘 , vce(bootstrap)

19Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Test for the individual significance of a parameter – ttest:

𝐻0: 𝛽𝑗 = 0

𝐻1: 𝛽𝑗 ≠ 0 or 𝐻1: 𝛽𝑗 > 0 or 𝐻1: 𝛽𝑗 < 0

𝑡 =መ𝛽𝑗

ො𝜎𝛽𝑗

~𝑡𝑁−𝑝

1.1. The Linear Regression Model1.1.4. Inference

Stataregress Y 𝑋1 … 𝑋𝑘

regress Y 𝑋1 … 𝑋𝑘 , vce(robust)regress Y 𝑋1 … 𝑋𝑘 , vce(cluster clustvar)regress Y 𝑋1 … 𝑋𝑘 , vce(bootstrap)

20Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Test for the joint significance of a set of parameters – F / Wald tests:

Model:𝑌 = 𝛽0 + 𝛽1𝑋1 + ⋯ +𝛽𝑔 𝑋𝑔 +𝛽𝑔+1 𝑋𝑔+1 + ⋯ + 𝛽𝑘𝑋𝑘 + 𝑣

Hypotheses:𝐻0: 𝛽𝑔+1 = ⋯ = 𝛽𝑘 = 0

𝐻1: No 𝐻0

Test:

𝐹 =𝑅2−𝑅∗

2

1−𝑅2

𝑁−𝑝

𝑞~𝐹𝑁−𝑝

𝑞→ valid only under homoskedasticity

𝑊 = 𝑁 መ𝛽∗′ Var መ𝛽∗

−1 መ𝛽∗~𝜒𝑞2 → general formula

1.1. The Linear Regression Model1.1.4. Inference

𝑅2: coefficient of determination of the modelunder H1

𝑅∗2: coefficient of determination of the model

under H1

𝑞: n. of parameters being tested

መ𝛽∗: vector of parameters to be tested

Stataregress Y 𝑋1 ⋯ 𝑋𝑔 𝑋𝑔+1 ⋯ 𝑋𝑘 ,…

test 𝑋𝑔+1 ⋯ 𝑋𝑘

21Advanced Econometrics I2017/2018

Page 8: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

8

Joaquim J.S. Ramalho

Specification tests:

Model functional form: RESET test

Heteroskedasticity: Breusch-Pagan (BP) test, White test,…

Structural breaks: Chow tests

1.2. Model Evaluation

22Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

RESET test:

Intuition:▪ Any model of the type 𝐸 𝑌|𝑋 = 𝑆 𝑋𝛽 may be approximated by

𝐸 𝑌|𝑋 = 𝑋𝛽 + σ𝑗=1∞ γj 𝑋 መ𝛽

𝑗+1

Implementation:▪ Estimate the original model

▪ Generate the variables 𝑋 መ𝛽2

, 𝑋 መ𝛽3

, 𝑋 መ𝛽4

, …

▪ Add the generated variables to the original model and estimate thefollowing auxiliary model:

𝑌 = 𝛽0 + 𝛽1𝑋1 + ⋯ + 𝛽𝑘𝑋𝑘 + γ1 𝑋 መ𝛽2

+ γ2 𝑋 መ𝛽3

+ γ3 𝑋 መ𝛽4

+ ⋯ + 𝑣

▪ Apply an F / Wald test for the significance of the added variables:

𝐻0: γ1 = γ2 = γ3 = ⋯ = 0 (suitable model functional form)

𝐻1: No 𝐻0 (unsuitable model functional form)

1.2. Model Evaluation1.2.1. RESET Test

Stata(only test version based on three fitted powers)regress Y 𝑋1 … 𝑋𝑘

estat ovtest

23Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

BP Test for Heteroskedasticity:

Intuition:▪ Because the mean of the error term is zero, the variance of the error

term is given by the sum of the squared error terms

▪ The squared residuals are an estimate of the squared error terms

Implementation:▪ Generate the variable ො𝑢2

▪ Replace 𝑌 by ො𝑢2 in the original model and estimate the followingauxiliary model:

ො𝑢2 = γ0 + γ1𝑋1 + ⋯ + γ𝑘𝑋𝑘 + 𝑣

▪ Apply an F / Wald test for the joint significance of the right-hand sidevariables of the previous auxiliary model:

𝐻0: γ1 = ⋯ = γ𝑘 = 0 (homoskedasticity)

𝐻1: Não 𝐻0 (heteroskedasticity)

1.2. Model Evaluation1.2.2. Tests for Heteroskedascity

Stataregress Y 𝑋1 … 𝑋𝑘

estat hettest, rhs fstat

24Advanced Econometrics I2017/2018

Page 9: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

9

Joaquim J.S. Ramalho

Chow Test for Structural Breaks:

Context:▪ Two groups of individuals / firms / ...: 𝐺𝐴, 𝐺𝐵

▪ It is suspected that the behaviour of the two groups in which regards thedependent variable may have different determinants

Implementation:

▪ Generate the dummy variable 𝐷 = ቊ1 if the individual belongs to 𝐺𝐴

0 if the individual belongs to 𝐺𝐵

▪ Estimate the original model ‘duplicated’:𝑌 = 𝜃0 + 𝜃1𝑋1 + ⋯ + 𝜃𝑘𝑋𝑘 + γ0𝐷 + γ1𝐷𝑋1 + ⋯ + γ𝑘𝐷𝑋𝑘 + 𝑣

▪ Apply an F / Wald test for the significance of the variables where 𝐷 ispresent:

𝐻0: γ1 = ⋯ = γ𝑘 = 0 (no structural break)

𝐻1: Não 𝐻0 (with a structural break)

1.2. Model Evaluation1.2.3. Chow Test

Stataregress Y 𝑋1…𝑋𝑘 𝐷 𝐷𝑋1…𝐷𝑋𝑘

test 𝐷 𝐷𝑋1 … 𝐷𝑋𝑘

25Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

2.1. Endogeneity

2.1.1. Definition and Consequences

2.1.2. Motivation: Omitted variables, Measurement Errors, Simultaneous

Equations

2.1.3. Solutions: Instrumental Variables, Panel Data

2.2. Methods based on Instrumental Variables

2.2.1. Two-Stage Least Squares

2.2.2. Generalized Method of Moments (GMM)

2.3. Specification Tests

2.3.1. Test for the Exogeneity of an Explanatory Variable

2.3.2. Test for the Exogeneity of the Instrumental Variables

2.3.3. Tests for Correlation between Instrumental Variables and Explanatory

Variables

2. Econometric Models with Endogenous Explanatory Variables

26Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Definitions:

Exogenous explanatory variables: 𝐸 𝑢|𝑋 = 0 → essentialassumption in any regression model

Endogenous explanatory variables: 𝐸 𝑢|𝑋 ≠ 0

Consequences:

Standard estimators become inconsistent

Motivation:

Omitted variables

Covariate measurement error

Simultaneity

2.1. Endogeneity2.1.1. Definition and Consequences

27Advanced Econometrics I2017/2018

Page 10: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

10

Joaquim J.S. Ramalho

Omitted variables - example:

True model: 𝑌 = 𝛽0 + 𝛽1𝑋1 + 𝛽2𝑋2 + 𝑣

Estimated model: 𝑌 = 𝛽0 + 𝛽1𝑋1 + 𝑢

As 𝑢 = 𝛽2𝑋2 + 𝑣:▪ If 𝑐𝑜𝑣 𝑋1, 𝑋2 = 0, then 𝐸 𝑢 𝑋1 = 0 → 𝑋1 is exogenous

▪ If 𝑐𝑜𝑣 𝑋1, 𝑋2 ≠ 0, then 𝐸 𝑢 𝑋1 ≠ 0 → 𝑋1 is endogenous

2.1. Endogeneity2.1.2. Motivation: Omitted variables, Measurement Errors, Simultaneous Equations

28Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Covariate measurement error - example:

True model: 𝑌 = 𝛽0 + 𝛽1𝑋1∗ + 𝑣

𝑒: measurement error

Instead of 𝑋1∗, it is observed 𝑋1= 𝑋1

∗ + 𝑒

Estimated model: 𝑌 = 𝛽0 + 𝛽1𝑋1 + 𝑢

As 𝑢 = 𝑣 − 𝛽1𝑒:▪ If 𝑐𝑜𝑣 𝑋1, 𝑒 = 0, then 𝐸 𝑢 𝑋1 = 0 → 𝑋1 is exogenous

▪ If 𝑐𝑜𝑣 𝑋1, 𝑒 ≠ 0, then 𝐸 𝑢 𝑋1 ≠ 0 → 𝑋1 is endogenous → mostcommon case because the measurement error is on 𝑋1

2.1. Endogeneity2.1.2. Motivation: Omitted variables, Measurement Errors, Simultaneous Equations

29Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Measurement error on 𝑌 has less serious consequences:

True model: 𝑌∗ = 𝛽0 + 𝛽1𝑋1 + 𝑣

Instead of 𝑌∗, it is observed 𝑌 = 𝑌∗ + 𝑒

Estimated model: 𝑌 = 𝛽0 + 𝛽1𝑋1 + 𝑢

As 𝑢 = 𝑣 + 𝑒:▪ In general, 𝑐𝑜𝑣 𝑋1, 𝑒 = 0 and 𝐸 𝑢 𝑋1 = 0, since the measurement

error is on 𝑌 and not in 𝑋1

▪ Hence, usually there are no endogeneity problems

▪ However, estimation is less precise, since the error term has now twocomponents

2.1. Endogeneity2.1.2. Motivation: Omitted variables, Measurement Errors, Simultaneous Equations

30Advanced Econometrics I2017/2018

Page 11: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

11

Joaquim J.S. Ramalho

Simultaneity - example:

True model: ቊSupply: 𝑄 = 𝛽0 + 𝛽1𝑃 + 𝑢Demand: 𝑄 = 𝛼0 + 𝛼1𝑃 + 𝑣

Estimated model: ቊSupply: 𝑄 = 𝛽0 + 𝛽1𝑃 + 𝑢Demand: 𝑄 = 𝛼0 + 𝛼1𝑃 + 𝑣

As:

൞𝑃 =

𝛼0 − 𝛽0

𝛽1 − 𝛼1+

𝑣 − 𝑢

𝛽1 − 𝛼1

𝑄 = ⋯

then 𝑃 is function of 𝑣 and 𝑢; hence:▪ 𝐸 𝑢 𝑃 ≠ 0 in the supply equation → 𝑃 is endogenous

▪ 𝐸 𝑣 𝑃 ≠ 0 in the demand equation → 𝑃 is endogenous

2.1. Endogeneity2.1.2. Motivation: Omitted variables, Measurement Errors, Simultaneous Equations

31Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

What to do in case of endogeneity:

Universal solution – methods based on ‘instrumental variables’:▪ Two-Stage Least Squares

▪ Generalized Method of Moments (GMM)

When data is in panel form and the endogeneity problem iscaused by omitted time-constant variables:▪ Methods based on the removal of the ‘fixed effects’

2.1. Endogeneity2.1.3. Instrumental Variables

32Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Instrumental variables:

Context:▪ 𝑌 = 𝛽0 + 𝛽1𝑋1 + 𝛽2𝑋2 + ⋯ + 𝛽𝑘𝑋𝑘 + 𝑢 (structural model)

▪ 𝐸 𝑢 𝑋1 ≠ 0 → 𝑋1 is endogenous

Definitions of instrumental variable (𝐼𝑉𝐴, … , 𝐼𝑉𝑀):▪ 𝐸 𝑢 𝐼𝑉𝐴 = ⋯ = 𝐸 𝑢 𝐼𝑉𝑀 = 0

▪ 𝑐𝑜𝑣 𝐼𝑉𝐴, 𝑋1 ≠ 0, …,𝑐𝑜𝑣 𝐼𝑉𝑀 , 𝑋1 ≠ 0

The number of instrumental variables must be equal or largerthan the number of endogenous explanatory variables

2.1. Endogeneity2.1.3. Instrumental Variables

33Advanced Econometrics I2017/2018

Page 12: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

12

Joaquim J.S. Ramalho

Implementation:1. Estimate the reduced form of the model by OLS:

ด𝑋1

End. Expl. Var.

= 𝜋0 + 𝜋2𝑋2 + ⋯ + 𝜋𝑘𝑋𝑘

Ex. Expl. Var.

+ 𝜋𝐴𝐼𝑉𝐴 + ⋯ + 𝜋𝑀𝐼𝑉𝑀

Instrumental Variables

+ 𝑤

and get 𝑋1 = ො𝜋0 + ො𝜋2𝑋2 + ⋯ + ො𝜋𝑘𝑋𝑘 + ො𝜋𝐴𝐼𝑉𝐴 + ⋯ + ො𝜋𝑀𝐼𝑉𝑀

2. Estimate the structural model, with 𝑋1 replaced by 𝑋1, byOLS:

𝑌 = 𝛽0 + 𝛽1𝑋1 + 𝛽2𝑋2 + ⋯ + 𝛽𝑘𝑋𝑘 + 𝑢

2.2. Methods based on Instrumental Variables2.2.1. Two-Stage Least Squares

Stata(by default, variances are estimated in a standard way; to use

another estimator, use the option vce(robust) or similar)ivregress 2sls Y (𝑋1= 𝐼𝑉𝐴… 𝐼𝑉𝑀) 𝑋2 … 𝑋𝑘

34Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Very general estimation method:▪ Applies to a large variety of cases

▪ Includes as particular cases OLS, maximum likelihood, etc.

Formulation:▪ Moment conditions: 𝐸 𝑔 𝑌, 𝑋, 𝐼𝑉; 𝛽 = 0

▪ 𝑠 moment conditions

▪ 𝑝 parameters: 𝛽0, 𝛽1, ⋯ , 𝛽𝑘

▪ Optimization:

– 𝑠 = 𝑝 → just-identified model: 𝑔 𝑌, 𝑋, 𝐼𝑉; መ𝛽 = 0

– 𝑠 > 𝑝 → overidentified model:min 𝐽 = 𝑔 𝑌, 𝑋, 𝐼𝑉; 𝛽 ′W𝑔 𝑌, 𝑋, 𝐼𝑉; 𝛽

where W is a weighting matrix; the first-order conditions are given by:

𝜕𝑔 𝑌, 𝑋, 𝐼𝑉; መ𝛽′

𝜕𝛽W𝑔 𝑌, 𝑋, 𝐼𝑉; መ𝛽 = 0

2.2. Methods based on Instrumental Variables2.2.2. Generalized Method of Moments (GMM)

35Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Choosing 𝑊 in overidentified models:To get efficient estimators, 𝑊 has to be defined as the inverseof the covariance matrix of the moment conditions:

𝑊 = Ω−1,

where:

Ω = 𝑉𝑎𝑟 𝑔 𝑌, 𝑋, 𝐼𝑉; 𝛽 = 𝐸 𝑔 𝑌, 𝑋, 𝐼𝑉; 𝛽 𝑔 𝑌, 𝑋, 𝐼𝑉; 𝛽 ′

2.2. Methods based on Instrumental Variables2.2.2. Generalized Method of Moments (GMM)

Stata(by default, variances are estimated in a standard way; to use

another estimator, use the option vce(robust) or similar)ivregress gmm Y (𝑋1= 𝐼𝑉𝐴… 𝐼𝑉𝑀) 𝑋2 … 𝑋𝑘

36Advanced Econometrics I2017/2018

Page 13: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

13

Joaquim J.S. Ramalho

Particular case – OLS:

Assumption: 𝐸 𝑢|𝑋 = 0 ⟹ 𝐸 𝑋′𝑢 = 0

𝑔 𝑌, 𝑋, 𝐼𝑉; 𝛽 = 𝑋′𝑢 = 𝑋′ 𝑦 − 𝑋𝛽

𝑠 = 𝑝 ⟹ 𝑋′ 𝑦 − 𝑋 መ𝛽 = 0

𝑋′ 𝑦 − 𝑋 መ𝛽 = 0

𝑋′𝑦 − 𝑋′𝑋 መ𝛽 = 0

𝑋′𝑋 መ𝛽 = 𝑋′𝑦

መ𝛽 = 𝑋′𝑋 −1𝑋′𝑦

2.2. Methods based on Instrumental Variables2.2.2. Generalized Method of Moments (GMM)

37Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Instrumental Variables (𝑠 = 𝑝):

Exogenous variables: 𝑍 = 𝑋2 ⋯ 𝑋𝑘 𝐼𝑉𝐴 ⋯ 𝐼𝑉𝑀

Assumption: 𝐸 𝑢|𝑍 = 0 ⟹ 𝐸 𝑍′𝑢 = 0

𝑔 𝑌, 𝑋, 𝐼𝑉; 𝛽 = 𝑍′𝑢 = 𝑍′ 𝑦 − 𝑋𝛽

If 𝑠 = 𝑝 ⟹ 𝑍′ 𝑦 − 𝑋 መ𝛽 = 0

መ𝛽 = 𝑍′𝑋 −1𝑍′𝑦

In this case, it is identical to the TSLS estimator

2.2. Methods based on Instrumental Variables2.2.2. Generalized Method of Moments (GMM)

38Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Instrumental Variables (𝑠 > 𝑝):

Optimization problem: min 𝐽 = 𝑦 − 𝑋𝛽 ′𝑍Ω−1𝑍′ 𝑦 − 𝑋𝛽

First-order conditions:

−𝑋′𝑍Ω−1𝑍′ 𝑦 − 𝑋 መ𝛽 = 0𝑋′𝑍Ω−1𝑍′𝑦 = 𝑋′𝑍Ω−1𝑍′𝑋 መ𝛽

መ𝛽 = 𝑋′𝑍Ω−1𝑍′𝑋−1

𝑋′𝑍Ω−1𝑍′𝑦

where Ω is a preliminar estimate of Ω = 𝐸 𝑍′𝑢𝑢′𝑍 ⟶estimation in two steps (Two-step GMM)

2.2. Methods based on Instrumental Variables2.2.2. Generalized Method of Moments (GMM)

39Advanced Econometrics I2017/2018

Page 14: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

14

Joaquim J.S. Ramalho

To estimate Ω, one may assume homoskedasticity, heteroskedasticity, cluster-type structures, etc.

The choice for Ω affects the analysis not only in terms ofparameter inference but also parameter value

Instead of a two-step procedure, it is possible to estimate Ωsimultaneously with 𝛽 → Continuously-updating GMM:▪ More complex, without an explicit solution for መ𝛽

▪ Less common than two-step GMM

2.2. Methods based on Instrumental Variables2.2.2. Generalized Method of Moments (GMM)

40Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Tests relevant for TSLS / GMM:Tests for the exogeneity of an explanatory variable▪ If the explanatory variable is exogenous, it is better to use OLS in order

to get efficient estimators

▪ Methods based on IV’s should be used only if really necessary, sincethere may be a substantial loss in precision

Tests for the exogeneity of the instrumental variables▪ To act as an IV, a variable has to be exogenous ⟶ when based on “IV’s”

that actually are endogenous, TSLS and GMM are inconsistent

Tests for correlation between instrumental variables and explanatory variables▪ To act as an IV, a variable has to be correlated with the endogenous

explanatory variable ⟶ when based on “IV’s” uncorrelated with theendogenous regressors, TSLS and GMM are inconsistent

▪ If the IV’s are only weakly correlated with the endogenous regressors, then the model with be poorly identified ⟶ in such a case, TSLS andGMM may display a huge variability

2.3. Specification Tests

41Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

TSLS - Wu-Hausman test:1. Estimate the reduced model by OLS:

𝑋1 = 𝜋0 + 𝜋2𝑋2 + ⋯ + 𝜋𝑘𝑋𝑘 + 𝜋𝐴𝐼𝑉𝐴 + ⋯ + 𝜋𝑀𝐼𝑉𝑀 + 𝑤

2. Calculate the residuals ෝ𝑤

3. Add ෝ𝑤 to the strutural model and re-estimate it, by OLS:𝑌 = 𝛽0 + 𝛽1𝑋1 + 𝛽2𝑋2 + ⋯ + 𝛽𝑘𝑋𝑘 + 𝛿 ෝ𝑤 + 𝑢

4. t test:𝐻0: 𝛿 = 0 (𝑋1 is exogenous)

𝐻1: 𝛿 ≠ 0 (𝑋1 is endogenous)

GMM - Eichenbaum, Hansen e Singleton’s (1988) C testBased on the difference of two J statistics (see the next page)

2.3. Specification Tests2.3.1. Tests for the Exogeneity of an Explanatory Variable

Stataivregress 2sls Y (𝑋1= 𝐼𝑉𝐴… 𝐼𝑉𝑀) 𝑋2 … 𝑋𝑘

estat endogenous

Stataivregress gmm Y (𝑋1= 𝐼𝑉𝐴… 𝐼𝑉𝑀) 𝑋2 … 𝑋𝑘

estat endogenous

42Advanced Econometrics I2017/2018

Page 15: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

15

Joaquim J.S. Ramalho

These tests can be applied only when the model isoveridentified

If the model is just-identified, then it is only possible to justifythe exogeneity of the IV’s using theoretical arguments

Hansen’s J test (also called test for overidentifying restrictions; this is an extension of the Sargan test, very common in theTSLS framework under homoskedasticity):1. Estimate the model by GMM

2. Test

𝐻0: 𝐸 𝑢|𝑍 = 0 (IV’s are exogenous)

𝐻1: 𝐸 𝑢|𝑍 ≠ 0 (IV’s are not exogenous)

using the J statistic:መ𝐽 = 𝑔 𝑌, 𝑋, 𝐼𝑉; መ𝛽

′ W𝑔 𝑌, 𝑋, 𝐼𝑉; መ𝛽 ~𝜒𝑞2

2.3. Specification Tests2.3.2. Tests for the Exogeneity of the Instrumental Variables

Stata(applies also to the TSLS estimator, with the obvious adaptation)

ivregress gmm Y (𝑋1= 𝐼𝑉𝐴… 𝐼𝑉𝑀) 𝑋2 … 𝑋𝑘

estat overid

q: number of overidentifyingrestrictions

43Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Alternatives:

F / Wald tests for the significance of the IV’s in the reducedform model

Criteria / tests for ‘weak instruments’

F / Wald tests:1. Estimate the reduced form model:

𝑋1 = 𝜋0 + 𝜋2𝑋2 + ⋯ + 𝜋𝑘𝑋𝑘 + 𝜋𝐴𝑉𝐼𝐴 + ⋯ + 𝜋𝑀𝑉𝐼𝑀 + 𝑤

2. Test the hypothesis:

𝐻0: 𝜋𝐴 = ⋯ = 𝜋𝑀 = 0 (𝐼𝑉’s and 𝑋1 are not correlated)

2.3. Specification Tests2.3.3. Tests for Correlation between Instrumental Variables and Explanatory Variables

Stata(applies also to the GMM estimator, with the obvious adaptation)ivregress 2sls Y (𝑋1= 𝐼𝑉𝐴… 𝐼𝑉𝑀) 𝑋2 … 𝑋𝑘

estat firststage

44Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Tests for ‘weak instruments’:

Even when the previous tests reveal that 𝐼𝑉’s and 𝑋1 are correlated, that correlation may be so weak that TSLS / GMM estimators are very little precise

Criterium: 𝐹 < 10 → Suggest a high probability of having‘weak instruments’

Tests: Cragg and Donald (2005), Kleibergen and Paap (2006)

2.3. Specification Tests2.3.3. Tests for Correlation between Instrumental Variables and Explanatory Variables

45Advanced Econometrics I2017/2018

Page 16: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

16

Joaquim J.S. Ramalho

3.1. Panel Data

3.2. Alternative Estimators

3.3. Inference and Model Evaluation

3.4. Dynamic Panel Data Models

3. Static and Dynamic Panel Data Models

46Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Panel data:

𝑁 cross-sectional units: 𝑖 = 1, … , 𝑁

𝑇 time observations per unit: 𝑡 = 1, … , 𝑇

Econometric analysis more complex:

Cross-sectional data: different units ⇒ independentobservations

Panel data: same units ⇒ dependent observations over time

3.1. Panel Data3.1.1. Definitions

47Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Advantages:

Make possible the analysis of the dynamics of individual behaviours

Generate more efficient estimators, since samples are larger

Allow for endogenous explanatory variables in some specialcases

It is simple to get instrumental variables

Limitations:

Prediction and calculation of partial effects not possible in some models

3.1. Panel Data3.1.1. Definitions

48Advanced Econometrics I2017/2018

Page 17: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

17

Joaquim J.S. Ramalho

Temporal dimension:

Short panels:▪ Sample comprises many individuals (𝑁 ⟶ ∞), but there is a reduced

number of time observations (small 𝑇)

▪ The temporal correlation of the observations for each individual is anissue, but across individuals it is assumed independence

Long panels:▪ Large number of time observations for each individual (𝑇 ⟶ ∞)

▪ Need to take into account time series issues (stationarity, cointegration, etc.)

3.1. Panel Data3.1.1. Definitions

49Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Cross-sectional composition:

Balanced panels:▪ Every individual is observed in all time periods (𝑇𝑖 = 𝑇, ∀𝑖)

Unbalanced panels:

▪ Some individuals are not observed in some time periods (𝑇𝑖 ≠ 𝑇)

▪ Motivation: some individuals refuse to continue providing informationafter some time periods ⟶ ‘attrition’ problem

▪ Most estimators work with unbalanced panels, provided that one mayassume that there is no endogenous selection (the data are missing atrandom)

3.1. Panel Data3.1.1. Definitions

50Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Variability over time and across individuals:

With panel data, the variance of 𝑌𝑖𝑡 can be decomposed as follows:

𝑖=1

𝑁

𝑡=1

𝑇

𝑌𝑖𝑡 − ത𝑌 2 =

𝑖=1

𝑁

𝑡=1

𝑇

𝑌𝑖𝑡 − ത𝑌𝑖 + ത𝑌𝑖 − ത𝑌 2

=

𝑖=1

𝑁

𝑡=1

𝑇

𝑌𝑖𝑡 − ത𝑌𝑖2 +

𝑖=1

𝑁

ത𝑌𝑖 − ത𝑌 2

To obtain the the total, ‘within’ and ‘between’ variance, divide by, respectively, 𝑁𝑇 − 1, 𝑁 𝑇 − 1 and 𝑁 − 1

3.1. Panel Data3.1.1. Definitions

Variability within thegroups

Variability between thegroups

51Advanced Econometrics I2017/2018

Page 18: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

18

Joaquim J.S. Ramalho

Base Model – Model with individual effects:

𝑌𝑖𝑡 = 𝛼𝑖 + 𝑥𝑖𝑡′ 𝛽 + 𝑢𝑖𝑡 𝑖 = 1, … , 𝑁; 𝑡 = 1, … , 𝑇

𝛼𝑖: individual effects, time-constant

𝑥𝑖𝑡 - explanatory variables, including:

▪ 𝑥𝑖𝑡: changes across individuals and over time

▪ 𝑥𝑖: time-constant

▪ 𝑑𝑡: temporal dummy variable

▪ 𝑡: trend (one may also have 𝑡2, 𝑡3, …)

▪ 𝑑𝑡.𝑥𝑖𝑡: interaction term

𝑢𝑖𝑡: idiosyncratic error term – changes randomly across individuals andover time

3.1. Panel Data3.1.2. Models

52Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Other models:

‘Pooled’ or ‘Population-averaged’ model:𝑌𝑖𝑡 = 𝛼 + 𝑥𝑖𝑡

′ 𝛽 + 𝑢𝑖𝑡

▪ Direct extension of cross-sectional models

▪ Popular in the area of Statistics but not in Economics, where individual heterogeneity is always an issue

Random Coefficients Model:𝑌𝑖𝑡 = 𝛼𝑖 + 𝑥𝑖𝑡

′ 𝛽𝑖 + 𝑢𝑖𝑡

▪ More complex than the base model, allowing for a different coefficientalso for the explanatory variables

▪ Computationally-intensive model, hard to estimate

3.1. Panel Data3.1.2. Models

53Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

The individual effects model may be re-written as: 𝑌𝑖𝑡 = 𝑥𝑖𝑡

′ 𝛽 + 𝛼𝑖 + 𝑢𝑖𝑡

The error term has now two componentes, 𝛼𝑖 and 𝑢𝑖𝑡

The individual effects 𝛼𝑖 may be correlated, or not, with theexplanatory variables

Fixed effects:

𝛼𝑖 and 𝑥𝑖𝑡 are correlated → 𝑥𝑖𝑡 is endogenous

Direct estimation of the model is not possible

Random effects:

𝛼𝑖 and 𝑥𝑖𝑡 are not correlated → 𝑥𝑖𝑡 is exogenous

Direct estimation of the model is possible

3.1. Panel Data3.1.3. Fixed Effects versus Random Effects

54Advanced Econometrics I2017/2018

Page 19: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

19

Joaquim J.S. Ramalho

Most panel data estimators:

Are based on transformed versions of the base model

Differ of the type of exogeneity required for the explanatoryvariables:

▪ Contemporaneous: 𝐸 𝑥𝑖𝑡𝑢𝑖𝑡 = 0

▪ Weak (pre-determined variables): 𝐸 𝑥𝑖𝑡𝑢𝑖,𝑡+𝑗 = 0, 𝑗 ≥ 0

▪ Strict: 𝐸 𝑥𝑖𝑡𝑢𝑖𝑠 = 0, ∀𝑠, 𝑡

3.2. Alternative Estimators

55Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

List of estimators:

Estimators for the random effects model:▪ Pooled OLS

▪ Between estimator

▪ Random effects estimator

Estimators for the fixed effects model:▪ Fixed effects or Within estimator

▪ Least squares dummy variables (LSDV) estimator

▪ First-diferences estimator

Estimators based on instrumental variables:▪ General estimators

▪ Hausman-Taylor estimator

3.2. Alternative Estimators

56Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Pooled OLS estimator:

Model:𝑌𝑖𝑡 = 𝛼 + 𝑥𝑖𝑡

′ 𝛽 + 𝛼𝑖 − 𝛼 + 𝑢𝑖𝑡

𝑣𝑖𝑡

Assumption: 𝐸 𝑥𝑖𝑡 𝛼𝑖 + 𝑢𝑖𝑡 = 0▪ Requires random effects: 𝛼𝑖 e 𝑥𝑖𝑡 must be uncorrelated

▪ Requires contemporaneous exogeneity between 𝑢𝑖𝑡 and 𝑥𝑖𝑡

Estimation:▪ OLS with a cluster-type estimator for the variance

3.2. Alternative Estimators3.2.1. Estimators for the Random Effects Model

Stataregress Y 𝑋1 … 𝑋𝑘 , vce(cluster clustvar)

57Advanced Econometrics I2017/2018

Page 20: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

20

Joaquim J.S. Ramalho

Between estimator:

Model:ത𝑌𝑖 = 𝛼 + ҧ𝑥𝑖

′𝛽 + 𝛼𝑖 − 𝛼 + ത𝑢𝑖

ത𝑣𝑖

▪ ത𝑌𝑖 =1

𝑇𝑖σ𝑡=1

𝑇𝑖 𝑌𝑖𝑡, etc.

Assumption: 𝐸 ҧ𝑥𝑖 𝛼𝑖 + ത𝑢𝑖 = 0▪ Requires random effects: 𝛼𝑖 e 𝑥𝑖𝑡 must be uncorrelated

▪ Requires strict exogeneity between 𝑢𝑖𝑡 and 𝑥𝑖𝑡

Estimation:▪ OLS

3.2. Alternative Estimators3.2.1. Estimators for the Random Effects Model

Stataxtreg Y 𝑋1 … 𝑋𝑘 , be

58Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Random effects estimator:

Model:𝑌𝑖𝑡 = 𝛼 + 𝑥𝑖𝑡

′ 𝛽 + 𝛼𝑖 − 𝛼 + 𝑢𝑖𝑡

𝑣𝑖𝑡

New assumptions:

▪ 𝑉𝑎𝑟 𝛼𝑖 = 𝜎𝛼2

▪ 𝑉𝑎𝑟 𝑢𝑖𝑡 = 𝜎𝑢2

Under the new assumptions:𝑐𝑜𝑟 𝑣𝑖𝑡, 𝑣𝑖𝑠 = 𝜎𝛼

2/ 𝜎𝛼2 + 𝜎𝑢

2

▪ Taking into account this result, more efficient estimators may beobtained

▪ All the previous estimators did not fully exploit the panel nature of thedata in the estimation process

3.2. Alternative Estimators3.2.1. Estimators for the Random Effects Model

59Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Estimation:▪ Generalized least squares (GLS)

▪ It is equivalent to apply OLS to the following equation:

𝑌𝑖𝑡 − መ𝜃𝑖ത𝑌𝑖 = 1 − መ𝜃𝑖 𝛼 + 𝑥𝑖𝑡 − መ𝜃𝑖 ҧ𝑥𝑖

′𝛽 + 𝑣𝑖𝑡

– 𝜃𝑖 = 1 − ො𝜎𝑢2/ 𝑇𝑖 ො𝜎𝛼

2 + ො𝜎𝑢2

– 𝑣𝑖𝑡 = 1 − 𝜃𝑖 𝛼𝑖 + 𝑢𝑖𝑡 − 𝜃𝑖 ത𝑢𝑖

Assumption: 𝐸 ҧ𝑥𝑖𝑣𝑖𝑡 = 0▪ Requires random effects: 𝛼𝑖 e 𝑥𝑖𝑡 must be uncorrelated

▪ Requires strict exogeneity between 𝑢𝑖𝑡 and 𝑥𝑖𝑡

3.2. Alternative Estimators3.2.1. Estimators for the Random Effects Model

Stataxtreg Y 𝑋1 … 𝑋𝑘 , re vce(cluster clustvar)

60Advanced Econometrics I2017/2018

Page 21: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

21

Joaquim J.S. Ramalho

Fixed effects / within estimator:

Model:𝑌𝑖𝑡− ത𝑌𝑖= 𝑥𝑖𝑡 − ҧ𝑥𝑖 ′𝛽 + 𝑢𝑖𝑡 − ത𝑢𝑖

▪ Corresponds to the subtraction of the model defining the betweenestimator from the base individual effects model

Assumption: 𝐸 𝑥𝑖𝑡 − ҧ𝑥𝑖 𝑢𝑖𝑡 −ത𝑢𝑖 = 0▪ Requires strict exogeneity between 𝑢𝑖𝑡 and 𝑥𝑖𝑡

Estimation:▪ OLS with a cluster-type estimator for the variance

3.2. Alternative Estimators3.2.2. Estimators for the Fixed Effects Model

Stataxtreg Y 𝑋1 … 𝑋𝑘 , fe vce(cluster clustvar)

61Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Limitations:▪ It is not possible to include in the model:

– Time-constant explanatory variables

– If the model includes time dummies, explanatory variables with identicalchanges over time for all individuals (e.g. age)

▪ Prediction not possible

▪ Partial effects conditional not only on 𝑥𝑖𝑡 but also on 𝛼𝑖; how to calculate them?

Main advantage:

▪ Allow for (time-constant) unobserved individual heterogeneity thatmay be correlated with the explanatory variables, not requiring the use of instrumental variables

3.2. Alternative Estimators3.2.2. Estimators for the Fixed Effects Model

62Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

LSDV estimator:

Model:

𝑌𝑖𝑡 = 𝑗=1

𝑁

𝛼𝑗𝑑𝑖𝑗 + 𝑥𝑖𝑡′ 𝛽 + 𝑢𝑖𝑡

where 𝑑𝑖𝑗 = 1 if 𝑖 = 𝑗 and 0 if 𝑖 ≠ 𝑗

Assumptions and estimates of 𝛽 identical to those of the fixedeffects estimator

Estimates of 𝛼𝑗:

▪ Given by ො𝛼𝑖 = ത𝑌𝑖 − ҧ𝑥𝑖 ′ መ𝛽

▪ Consistent only in case of a long panel, in which case it is also possibleto make prediction and calculate partial effects conditional on both 𝑥𝑖𝑡

and 𝛼𝑖

3.2. Alternative Estimators3.2.2. Estimators for the Fixed Effects Model

Stataregress Y 𝑋1 … 𝑋𝑘 𝐷1 … 𝐷𝑁 , vce(cluster clustvar)

orareg Y 𝑋1 … 𝑋𝑘 , absorb(idname) vce(cluster clustvar)

63Advanced Econometrics I2017/2018

Page 22: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

22

Joaquim J.S. Ramalho

First-differences estimator:

Model:

𝑌𝑖𝑡 − 𝑌𝑖,𝑡−1 = 𝑥𝑖𝑡 − 𝑥𝑖,𝑡−1′𝛽 + 𝑢𝑖𝑡 − 𝑢𝑖,𝑡−1 ⟺

Δ𝑌𝑖𝑡 = Δ𝑥𝑖𝑡′ 𝛽 + Δ𝑢𝑖𝑡

▪ Corresponds to the subtraction of the first-diferences equation fromthe base individual effects model

Assumption: 𝐸 Δ𝑥𝑖𝑡Δ𝑢𝑖𝑡 = 0

▪ Requires 𝐸 𝑥𝑖𝑡𝑢𝑖𝑡 = 𝐸 𝑥𝑖𝑡𝑢𝑖,𝑡−1 = 𝐸 𝑥𝑖𝑡𝑢𝑖,𝑡+1 = 0

Estimation:▪ OLS

Comparison with the fixed-effects estimator:▪ Identical when 𝑇 = 2

▪ Does not require strict exogeneity

3.2. Alternative Estimators3.2.2. Estimators for the Fixed Effects Model

Stataregress D.Y D.𝑋1 … D.𝑋𝑘 , vce(cluster clustvar) nocons

64Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Endogenous explanatory variables - 𝐸 𝑥𝑖𝑡𝑢𝑖𝑡 ≠ 0:

Possível IV’s for 𝑥𝑖𝑡:▪ External instruments, as in the cross-sectional case

▪ Internal instruments (same explanatory variable but relative to othertime periods)

Example of internal instruments:

▪ If 𝑥𝑖𝑡 is weakly exogenous (apart from the current period), then:

– All past values (lags) of 𝑥𝑖𝑡 may be used as IV’s

– Possible IV’s: 𝑥𝑖,𝑡−1 or 𝑥𝑖,𝑡−1, 𝑥𝑖,𝑡−2 or 𝑥𝑖,𝑡−1, … , 𝑥𝑖,𝑡−5 , etc.

▪ If 𝑥𝑖𝑡 is strictly exogenous (apart from the current period), then:

– All past (lags) and future (leads) values of 𝑥𝑖𝑡 may be used as IV’s

– Possible IV’s : 𝑥𝑖,𝑡−1 and/or 𝑥𝑖,𝑡+1, etc.

3.2. Alternative Estimators3.2.3. Instrumental Variables Estimators

Stata(external instruments – TSLS)

xtivreg Y (𝑋1= 𝐼𝑉𝐴… 𝐼𝑉𝑀) 𝑋2 … 𝑋𝑘 , options(options: re, fe, be, fd)

Stata(internal instruments – TSLS)

xtivreg Y (𝑋1= 𝐿. 𝑋1 𝐿2. 𝑋1…) 𝑋2 … 𝑋𝑘 , options(options: re, fe, be, fd)

65Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Hausman-Taylor estimator:

Useful when interest lies on time-invariant explanatoryvariables which are correlated with 𝛼𝑖, since:

– Fixed effects estimators: drop those variables from the model

– Random effects estimators: inconsistent

Intermediate case between the fixed and the random effectscases:▪ Explanatory variables correlated with 𝛼𝑖 are dealt with under the

assumption of fixed effects

▪ Explanatory variables uncorrelated with 𝛼𝑖 are dealt with under the assumption of random effects

3.2. Alternative Estimators3.2.3. Instrumental Variables Estimators

66Advanced Econometrics I2017/2018

Page 23: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

23

Joaquim J.S. Ramalho

Model:𝑌𝑖𝑡 = 𝑥1𝑖𝑡

′ 𝛽1 + 𝑥2𝑖𝑡′ 𝛽2 + 𝑤1𝑖

′ 𝛾1 + 𝑤2𝑖′ 𝛾2 + 𝛼𝑖 + 𝑢𝑖𝑡

▪ 𝑥1𝑖𝑡: time-varying explanatory variables, uncorrelated with 𝛼𝑖

▪ 𝑥2𝑖𝑡: time-varying explanatory variables, correlated with 𝛼𝑖

▪ 𝑤1𝑖: time-invariant explanatory variables, uncorrelated with 𝛼𝑖

▪ 𝑤2𝑖: time-invariant explanatory variables, correlated with 𝛼𝑖

Assumptions:▪ All explanatory variables are strictly exogenous relative to 𝑢𝑖𝑡

▪ 𝑥1 has a larger dimension than 𝑤2

▪ 𝑥1 and 𝑤2 are correlated

3.2. Alternative Estimators3.2.3. Instrumental Variables Estimators

67Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Estimation:▪ TSLS / GMM based on the following instruments for the explanatory

variables correlated with 𝛼𝑖:

– 𝑥2𝑖𝑡: 𝑥2𝑖𝑡 − ҧ𝑥2𝑖

– 𝑤2𝑖: ҧ𝑥1𝑖

3.2. Alternative Estimators3.2.3. Instrumental Variables Estimators

StataxthtaylorY 𝑋11 𝑋12 … 𝑋21 𝑋22… 𝑊11 𝑊12… 𝑊21 𝑊22 …, endog(𝑋21 𝑋22… 𝑊21 𝑊22 …)

68Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

EstimatorEffects

Efficiency Prediction ExogeneityInternal

instrumentsfor 𝒙𝒊𝒕

Random Fixed

Pooled x x Contemporaneous

Between x x Strict Lags / Leads

Random Effects x x x Strict Lags / Leads

Fixed Effects xOnly if long

panelStrict Lags / Leads

First-Differences

x𝐸 𝑥𝑖𝑡𝑢𝑖𝑡

= 𝐸 𝑥𝑖𝑡𝑢𝑖,𝑡−1

= 𝐸 𝑥𝑖𝑡𝑢𝑖,𝑡+1 = 0

Lags / Leads(except 𝑡 − 1

and 𝑡 + 1)

3.2. Alternative Estimators

Static Panel Data Models - Summary

69Advanced Econometrics I2017/2018

Page 24: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

24

Joaquim J.S. Ramalho

Variance estimators – best alternatives:

Cluster-robust

Bootstrap

Hausman test:

Random or fixed effects?𝐻0: 𝐸 𝛼𝑖𝑥𝑖𝑡 = 0 (RE and FE consistent, RE also efficient)

𝐻1: 𝐸 𝛼𝑖𝑥𝑖𝑡 ≠ 0 (FE consistent, RE inconsistent)

𝐻 = መ𝛽𝐹𝐸 − መ𝛽𝑅𝐸 ′ 𝑉 መ𝛽𝐹𝐸 − 𝑉 መ𝛽𝑅𝐸−1 መ𝛽𝐹𝐸 − መ𝛽𝑅𝐸 ∼ 𝜒𝑘

2

3.3. Inference and Model Evaluation

Stata(models must be estimated using standard estimators of the variance)xtreg Y 𝑋1 … 𝑋𝑘 , feestimates store ModelFExtreg Y 𝑋1 … 𝑋𝑘

estimates store ModelREhausman ModelFE ModelRE

70Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Models with lagged dependent variables:

Include 𝑌𝑖,𝑡−1, 𝑌𝑖,𝑡−2 , … as explanatory variables:𝑌𝑖𝑡 = 𝛾1𝑌𝑖,𝑡−1 + ⋯ + 𝛾𝑝𝑌𝑖,𝑡−𝑝 + 𝑥𝑖𝑡

′ 𝛽 + 𝛼𝑖 + 𝑢𝑖𝑡, 𝑡 = 𝑝 + 1 , … 𝑇

All estimators for static panel data models are inconsistent

Example – 𝐴𝑅 1 model:𝑌𝑖𝑡 = 𝛾1𝑌𝑖,𝑡−1 + 𝛼𝑖 + 𝑢𝑖𝑡

This equation holds for all time periods, so:

𝑌𝑖,𝑡−1 = 𝛾1𝑌𝑖,𝑡−2 + 𝛼𝑖 + 𝑢𝑖,𝑡−1

𝑌𝑖,𝑡−2 = 𝛾1𝑌𝑖,𝑡−3 + 𝛼𝑖 + 𝑢𝑖,𝑡−2

etc.

3.4. Dynamic Panel Data Models3.4.1. Inconsistency of Estimators for Static Models

71Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Random effects estimator:

▪ Required assumption: 𝐸 𝑌𝑖,𝑡−1𝛼𝑖 = 0

▪ However, 𝛼𝑖 is one of the components of 𝑌𝑖,𝑡−1, so 𝐸 𝑌𝑖,𝑡−1𝛼𝑖 ≠ 0

▪ All other lags of 𝑌𝑖𝑡 are also correlated with 𝛼𝑖

Fixed effects model:

▪ Required assumption: 𝐸 𝑌𝑖,𝑡−1 − ത𝑌𝑖 𝑢𝑖𝑡 − ത𝑢𝑖 = 0

▪ However, 𝑢𝑖,𝑡−1 (included in ത𝑢𝑖) is one of the components of 𝑌𝑖,𝑡−1, so

𝐸 𝑌𝑖,𝑡−1 − ത𝑌𝑖 𝑢𝑖𝑡 − ത𝑢𝑖 ≠ 0

▪ All other lags of 𝑌𝑖𝑡, which are included in ത𝑌𝑖, are also correlated with thecorresponding element of ത𝑢𝑖

3.4. Dynamic Panel Data Models3.4.1. Inconsistency of Estimators for Static Models

72Advanced Econometrics I2017/2018

Page 25: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

25

Joaquim J.S. Ramalho

First-diferences method:

▪ Required assumption: 𝐸 Δ𝑌𝑖,𝑡−1Δ𝑢𝑖𝑡 = 0

▪ However, 𝑢𝑖,𝑡−1 (included in Δ𝑢𝑖𝑡) is one of the components of 𝑌𝑖,𝑡−1

(included in Δ𝑌𝑖,𝑡−1), so 𝐸 Δ𝑌𝑖,𝑡−1Δ𝑢𝑖𝑡 ≠ 0

▪ Unlike the previous estimators, 𝑌𝑖,𝑡−2, 𝑌𝑖,𝑡−3, … are not correlated withΔ𝑢𝑖𝑡, provided that there is no autocorrelation

▪ Solution: using 𝑌𝑖,𝑡−2, 𝑌𝑖,𝑡−3, … (ou functions of these variables) as

instruments for Δ𝑌𝑖,𝑡−1

3.4. Dynamic Panel Data Models3.4.1. Inconsistency of Estimators for Static Models

73Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Base Dynamic Panel Data Model:∆𝑌𝑖𝑡= 𝛾1∆𝑌𝑖,𝑡−1 + ∆𝑥𝑖𝑡

′ 𝛽 + ∆𝑢𝑖𝑡 , 𝑡 = 3, … , 𝑇

Assumption:

𝑢𝑖𝑡 has no autocorrelation ⟹ Δ𝑢𝑖𝑡 has first-orderautocorrelation:

𝐶𝑜𝑣 ∆𝑢𝑖𝑡 , ∆𝑢𝑖,𝑡−1 = 𝐶𝑜𝑣 𝑢𝑖𝑡 − 𝑢𝑖,𝑡−1, 𝑢𝑖,𝑡−1 − 𝑢𝑖,𝑡−2

= −𝐶𝑜𝑣 𝑢𝑖,𝑡−1, 𝑢𝑖,𝑡−1 ≠ 0

Main estimators:

Anderson-Hsiao (1981)

Arellano-Bond (1991) – ‘Difference GMM’

Blundell-Bond (1998) – ‘System GMM’

3.4. Dynamic Panel Data Models3.4.2. Instrumental Variable Estimators

74Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Anderson-Hsiao (1981):

Two alternative instruments:

▪ 𝑌𝑖,𝑡−2

▪ ∆𝑌𝑖,𝑡−2 (one observation is lost but in general seems to produce more efficient estimators)

3.4. Dynamic Panel Data Models3.4.2. Instrumental Variable Estimators

Stataivregress gmm D.Y (𝐷𝐿. 𝑌 = 𝐿2. 𝑌) 𝐷. 𝑋1 … 𝐷. 𝑋𝑘

Stataxtivreg Y (𝐿. 𝑌 = 𝐿2. 𝑌) 𝑋1 … 𝑋𝑘 , fd

75Advanced Econometrics I2017/2018

Page 26: ADVANCED ECONOMETRICS I - ISCTEhome.iscte-iul.pt/~jjsro/advecoi/Slides-Theory-1-notes.pdf · This course provides an introduction to the modern econometric techniques used in the

18/10/2017

26

Joaquim J.S. Ramalho

Arellano-Bond (1991):

Proposed using all available lags of 𝑌𝑖,𝑡 as instruments:

▪ 𝑡 = 3: 𝑌𝑖,1

▪ 𝑡 = 4: 𝑌𝑖,2, 𝑌𝑖,1

▪ …

▪ 𝑡 = 𝑇: 𝑌𝑖,𝑇−2, … , 𝑌𝑖,2, 𝑌𝑖,1

Total number of instruments: 𝑇 − 1 𝑇 − 2 /2

It is possible to use only a subset of the available instruments

More efficient than Anderson-Hsiao’s (1981) estimators

3.4. Dynamic Panel Data Models3.4.2. Instrumental Variable Estimators

Stataxtabond Y 𝑋1 … 𝑋𝑘 , maxldep(#) twostep vce(robust)

76Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Blundell-Bond (1998):

Often, lags of 𝑌𝑖,𝑡 are not good instruments for ∆𝑌𝑖,𝑡

Proposed adding the following instruments: ∆𝑌𝑖,2,…,∆𝑌𝑖,𝑇−1

Total number of instruments: 𝑇−1 𝑇−2

2+ 𝑇 − 2

It is possible to use only a subset of the available instruments

More efficient than Arellano-Bond’s (1991) estimator

Requires heavier assumptions than Arellano-Bond’s (1991) estimator

3.4. Dynamic Panel Data Models3.4.2. Instrumental Variable Estimators

Stataxtdpdsys Y 𝑋1 … 𝑋𝑘 , maxldep(#) twostep vce(robust)

77Advanced Econometrics I2017/2018

Joaquim J.S. Ramalho

Most common tests:

Hansen’s J test of overidentifying restrictions

Test for autocorrelation▪ All estimators for dynamic panel data models assume first-order

autocorrelation:

– 𝐶𝑜𝑣 ∆𝑢𝑖𝑡, ∆𝑢𝑖,𝑡−𝑙 ≠ 0

– 𝐶𝑜𝑣 ∆𝑢𝑖𝑡, ∆𝑢𝑖,𝑡−𝑙 = 0, 𝑙>1

3.4. Dynamic Panel Data Models3.4.3. Tests for Instruments Validity

Stata(after xtabond or xtdpdsys, with variance estimated in a standard way)estat sargan

Stata(after xtabond or xtdpdsys, with variance estimated in a standard way)estat abond, artests(3)

78Advanced Econometrics I2017/2018