Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE....

25
15/09/2014 1 Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE

Transcript of Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE....

Page 1: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

1

Dynamic Panel Data Models

Prf. José FajardoFGV/EBAPE

Page 2: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

2

Page 3: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

3

Page 4: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

4

[(Steven) Nickell Bias]

i,t i i,t i i,t 1 i i,t i

2 T

i,t 1 i i,t i 2 2

y y ( ) + (y y ) ( )

(T 1) TCov[(y y ),( )]

T (1 )

Large when T is moderate or small.

Proportional bias for conventional T (5 - 15), is

on the order of 15% - 60%

ε−

− = − δ − + ε − ε

−σ − − δ + δ− ε − ε ≈− δ

x x 'β

.

Page 5: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

5

Cornwell and Trumball (1994) data on county level crime rates

Cornwell and Trumball (1994) data on county level crime rates

use cornwell.dta

xtset county year

reg lcrmrte l.lcrmrte if year ==87 | year==88

test l.lcrmrte

reg d.l.lcrmrte l2.lcrmrte l3.lcrmrte if year ==87 | year==88

test l2.lcrmrte l3.lcrmrte

ivreg d.lcrmrte (d.l.lcrmrte = l2.lcrmrte l3.lcrmrte) if year ==87 | year==88

Summary of Variables

Page 6: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

6

FE Estimation

Comparison OLS and FE

Xtivreg estimation

• xtivreg lcrmrte lprbconv lprbpris lavgsenldensity lwcon lwtuc lwtrd lwfir lwserlwmfg lwfed lwsta lwloc lpctymle lpctminwest central urban d82 d83 d84 d85 d86 d87 (lprbarr lpolpc= ltaxpc lmix), ec2sls

Page 7: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

7

A General DPD model

i,t i,t 1 i i,t

i,t i

2 2

i,t i i,t i,s i

i

y y c

E[ | ,c ] 0

E[ | ,c ] , E[ | ,c ] 0 if t s.

E[c | ] g( )

No correlation across individuals

ε

′= + δ + + ε

ε =

ε = σ ε ε = ≠

=

i,t

i

i i

i i

x β

X

X X

X X

OLS and GLS are inconsistent

i,t i,t 1 i i,t

i,t 1 i i,t

2

c i,t 2 i i,t

2

c

y y c

Cov[y ,(c )]

Cov[y ,(c )]

If T were large and -1< <1,

this would approach 1

′= + δ + + ε

+ ε =

σ + δ + ε

δσ− δ

i,tx β

Implication : Both OLS and GLS are

inconsistent.

Page 8: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

8

Anderson Hsiao IV Estimator

− − − − −− = − δ − + ε − ε

− = − δ − + ε − ε

− = − δ −

i,t i,t 1 i,t i,t 1 i,t 1 i,t 2 i,t i,t 1

i,3 i,2 i,3 i,2 i,2 i,1 i,3 i,2

i1

i,4 i,3 i,4 i,3 i,3 i

Base on first differences

y y ( ) + (y y ) ( )

Instrumental variables

y y ( ) + (y y ) ( )

Can use y

y y ( ) + (y y

x x 'β

x x 'β

x x 'β + ε − ε

−,2 i,4 i,3

i2 i,2 i,1

) ( )

Can use y or (y y )

And so on.

Levels or lagged differences?

Levels allow you to use more data

Asymptotic variance of the estimator is smaller with levels.

Arellano and Bond Estimator - 1

i,t i,t 1 i,t i,t 1 i,t 1 i,t 2 i,t i,t 1

i,3 i,2 i,3 i,2 i,2 i,1 i,3 i,2

i1

i,4 i,3 i,4 i,3 i,3 i

Base on first differences

y y ( ) + (y y ) ( )

Instrumental variables

y y ( ) + (y y ) ( )

Can use y

y y ( ) + (y y

− − − − −− = − δ − + ε − ε

− = − δ − + ε − ε

− = − δ −

x x 'β

x x 'β

x x 'β ,2 i,4 i,3

i,1 i2

i,5 i,4 i,5 i,4 i,4 i,3 i,5 i,4

i,1 i2 i,3

) ( )

Can use y and y

y y ( ) + (y y ) ( )

Can use y and y and y

+ ε − ε

− = − δ − + ε − εx x 'β

Arellano and Bond Estimator - 2

− = − δ − + ε − ε

− = − δ − + ε − ε

i,3 i,2 i,3 i,2 i,2 i,1 i,3 i,2

i1 i,1 i,2

i,4 i,3 i,4 i,3 i,3 i,2 i,4 i,3

i,1 i2 i,1 i,2

More instrumental variables - Predetermined

y y ( ) + (y y ) ( )

Can use y and ,

y y ( ) + (y y ) ( )

Can use y , y , ,

X

x x 'β

x x

x x 'β

x x

− = − δ − + ε − εi,3

i,5 i,4 i,5 i,4 i,4 i,3 i,5 i,4

i,1 i2 i,3 i,1 i,2 i,3 i,4

,

y y ( ) + (y y ) ( )

Can use y , y , y , , , ,

x

x x 'β

x x x x

Page 9: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

9

Arellano and Bond Estimator - 3

− = − δ − + ε − ε

− = − δ − + ε − ε

i,3 i,2 i,3 i,2 i,2 i,1 i,3 i,2

i1 i,1 i,2 i,T

i,4 i,3 i,4 i,3 i,3 i,2 i,4 i,

Even more instrumental variables - Strictly exogenous

y y ( ) + (y y ) ( )

Can use y and , ,..., (all periods)

y y ( ) + (y y ) (

X

x x 'β

x x x

x x 'β

− = − δ − + ε − ε

3

i,1 i2 i,1 i,2 i,T

i,5 i,4 i,5 i,4 i,4 i,3 i,5 i,4

i,1 i2 i,3 i,1 i,2 i, T

)

Can use y , y , , ,...,

y y ( ) + (y y ) ( )

Can use y , y , y , , ,...,

The number of potential instruments is huge.

These define the rows

x x x

x x 'β

x x x

of . These can be used for

simple instrumental variable estimation.

iZ

Instrumental Variables

− −

′ ′ ′ ′ ′ =

′ ′ ′

=

i,1 i,1 i,2

i,1 i,2 i,1 i,2 i,3

i,1 i,2 i,T 2 i,1 i,2 i,T 1

i,1

y , , 0 ... 0

0 y , y , , , ... 0 (T rows)

... ... ... ...

0 0 ... y , y ,..., y , , ,...

y ,

i

i

Predetermined variables

x x

x x xZ

x x x

Strictly Exogenous variables

Z

− −

′ ′ ′ ′ ′

′ ′ ′

i,1 i,2 i,T 1

i,1 i,2 i,1 i,2 i,T 1

i,1 i,2 i, T 2 i,1 i,2 i, T 1

, ,... 0 ... 0

0 y , y , , ,... ... 0 (T rows)

... ... ... ...

0 0 ... y , y ,..., y , , ,...

x x x

x x x

x x x

IV Variables and GMM Methods

Page 10: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

10

Page 11: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

11

Page 12: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

12

Page 13: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

13

Cornwell and Trumball (1994)

use E:\paneldata\paneldata\EBAPE\aula6\cornwell.dtaxtset county yearDescribe

xtivreg lcrmrte lprbconv lprbpris lavgsen ldensity lwconlwtuc lwtrd lwfir lwser lwmfg lwfed lwsta lwloc lpctymlelpctmin west central urban d82 d83 d84 d85 d86 d87 (lprbarrlpolpc= ltaxpc lmix), ec2sls

xtabond lcrmrte lprbconv lprbpris lavgsen ldensity lwconlwtuc lwtrd lwfir lwser lwmfg lwfed lwsta lwloc lpctymlelpctmin west central urban d82 d83 d84 d85 d86 d87, twostep

xtabond lcrmrte lprbconv lprbpris lavgsen ldensity lwconlwtuc lwtrd lwfir lwser lwmfg lwfed lwsta lwloc lpctymle d82 d84 d85 d86 d87, twostep

estat abondestat sargan

Page 14: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

14

Page 15: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

15

Page 16: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

16

Page 17: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

17

More Examples

Page 18: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

18

Crime

xtabond I

Where did all instruments come from?

Page 19: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

19

Specification tests

xtabond II: two step estimator

Two step estimator with robust s.e.

Page 20: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

20

Cornwell and Trumball (1994)

xtabond lcrmrte lprbconv lprbpris lavgsen ldensitylwcon lwtuc lwtrd lwfir lwser lwmfg lwfed lwstalwloc lpctymle d82 d84 d85 d86 d87, vce(robust)

xtabond lcrmrte lprbconv lprbpris lavgsen ldensitylwcon lwtuc lwtrd lwfir lwser lwmfg lwfed lwstalwloc lpctymle d82 d84 d85 d86 d87, twostep

xtabond lcrmrte lprbconv lprbpris lavgsen ldensitylwcon lwtuc lwtrd lwfir lwser lwmfg lwfed lwstalwloc lpctymle d82 d84 d85 d86 d87, twostepvce(robust)

xtabond III

xtabond III

Page 21: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

21

Predetermined Variables

xtabond IV

Arellano-Bover, Blundell-Bond Estimator

Page 22: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

22

Cornwell and Trumball (1994)

xtabond lcrmrte lprbarr lprbpris lprbconv ldensity lwconlwtuc lwtrd lwfir lwser lwmfg lwfed lwsta lwloc lpctymle d82 d84 d85 d86 d87, twostep endog(lavgsen) pre(lpolpc)

estat abond

estat sargan

xtdpdsys lcrmrte lprbarr lprbpris lprbconv ldensity lwconlwtuc lwtrd lwfir lwser lwmfg lwfed lwsta lwloc lpctymle d82 d84 d85 d86 d87, twostep endog(lavgsen) pre(lpolpc)

estat abond

estat sargan

xtdpdsys lcrmrte lavgsen ldensity lwcon lwtuc lwtrd lwfirlwser lwmfg lwfed lwsta lwloc lpctymle d82 d84 d85 d86 d87, twostep endog(lprbarr lprbpris lprbconv) pre(lpolpc)

xtdpd

xtdpd I

Page 23: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

23

Benefits of Flexibility

xtdpd III: Predetermined Variable: No dependentLagged Variable

Instruments for Models with MA(1) errors

Page 24: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

24

Instruments for Models with MA(1) errors

xtdpd IV

xtdpd V

Page 25: Dynamic Panel Data Models - jose.fajardo · Dynamic Panel Data Models Prf. José Fajardo FGV/EBAPE. 15/09/2014 2. ... estimates store OLS ... jose.fajardo Created Date: 9/15 ...

15/09/2014

25

CR 1988

regress lwage L.lwage L2.lwage, vce(robust)estimates store OLSxtreg lwage L.lwage L2.lwage, fe vce(robust)estimates store FExtreg lwage L.lwage L2.lwage, re vce(robust)estimates store RExtabond lwage, lags(2) vce(robust)estimates store AB1xtabond lwage, lags(2) vce(robust) twostepestimates store AB2xtabond lwage, lags(2) maxldep(3) vce(robust) twostepestimates store AB3estimates table OLS FE RE AB1 AB2 AB3, b se t stats(sagan)

Example3.9-3.13.do