Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

42
Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University

description

Panel Data Analysis A Review The Model One-Way (Individual) Effects: Unobserved Heterogeneity Cross Section and Time Series Correlation

Transcript of Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Page 1: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Spatial Econometric Analysis Using GAUSS

8

Kuan-Pin LinPortland State University

Page 2: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Panel Data AnalysisA Review

Model Representation N-first or T-first representation

Pooled Model Fixed Effects Model Random Effects Model

Asymptotic Theory N→∞, or T→∞ N→∞, T→∞ Panel-Robust Inference

Page 3: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Panel Data AnalysisA Review

The Model

One-Way (Individual) Effects: Unobserved Heterogeneity Cross Section and Time Series Correlation

''it it it

it it i t itit i t it

yy u v e

u v e

xx

'it it i ity u e x

( , ) 0, ( , ) 0,

( , ) 0,i j it jt

it i

Cov u u Cov e e i j

Cov e e t

Page 4: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Panel Data AnalysisA Review

N-first Representation

Dummy Variables Representation

T-first Representation'

1,2,..., ; 1, 2,...,

( )

it it i it

i i i T i

N T

y u ei N t T

u

x β

y X β i e

y Xβ I i u e

'

1,2,..., ; 1,2,...,

( )

ti ti i ti

t t t

T N

y u et T i N

x β

y X β u e

y Xβ i I u e

N T T Nor

y Xβ Du eD I i D i I

Page 5: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Panel Data AnalysisA Review

Notations'

1, 1 2, 1 , 11 1 11'

1, 2 2, 2 , 22 2 22

'1, 2, ,

1

2

, , ,

,

i i K ii ii

i i K ii iii i i

iT iT K iTiT iT KiT

t t

tt t

tN

x x xy ex x xy e

x x xy e

yy

y

xx

y X e β

x

x

y X

'1, 1 2, 1 , 1 1 11

'1, 2 2, 2 , 2 2 22

'1, 2, ,

, ,

t t K t t

t t K t ttt

tN tN K tN tN NtN

x x x e ux x x e u

x x x e u

xe u

x

Page 6: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Pooled (Constant Effects) Model

'

'

'

2

( 1,2,..., ; 1, 2,..., )

assuming

1 ,

( | ) , ( | )

it it i it

i

it it it

it it

it it it

e

y u e i N t T

u u i

y u e

uy e

E Var

x β

x ββ

w x δ

w δ y Wδ e

e X 0 e X I

Page 7: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects Model

ui is fixed, independent of eit, and may be correlated with xit.

' ( 1, 2,..., ; 1, 2,..., )it it i ity u e i N t T x β

( , ) 0, ( , ) 0i it i itCov u e Cov u x

,

, 1, 2,...,1,2,...,

i i i T i

t t t

u i i Nt T

y X ey X u e

Page 8: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects Model Fixed Effects Model

Classical Assumptions Strict Exogeneity: Homoschedasticity: No cross section and time series correlation:

Extensions: Panel Robust Variance-Covariance Matrix

( | , ) 0itE e u X2( | , )it eVar e u X

2( | , ) e NTVar e u X I

( | , )Var e u X

Page 9: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model Error Components

ui is random, independent of eit and xit.

Define the error components as it = ui + eit

'

( 1, 2,..., ; 1,2,..., )it it it

it i it

yu e i N t T

x β

( , ) 0, ( , ) 0, ( , ) 0i it i it it itCov u e Cov u Cov e x x

( ), 1, 2,...,( ), 1, 2,...,

i i i T i

t t t

u i i Nt T

y X ey X u e

Page 10: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model

Random Effects Model Classical Assumptions

Strict Exogeneity

X includes a constant term, otherwise E(ui|X)=u.Homoschedasticity

Constant Auto-covariance (within panels)

( | ) 0, ( | ) 0 ( | ) 0it i itE e E u E X X X

2 2 '( | )i e T u T TVar ε X I i i

2 2

2 2 2

( | ) , ( | ) , ( , ) 0

( | )it e i u i it

it e u

Var e Var u Cov u e

Var

X X

X

Page 11: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model

Random Effects Model Classical Assumptions (Continued)

Cross Section Independence

Extensions:Panel Robust Variance-Covariance Matrix

2 2 '( | )( | )

i e T u T T

N

VarVar

ε X I i iε X Ω I

Page 12: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects Model Estimation

Within Model Representation'

'

' '

'

( ) ( )

it it i it

i i i i

it i it i it i

it it it

y u e

y u e

y y e e

y e

x β

x β

x x β

x β

'1 , ( 0, ' )

i i i

i i i

T T T T

orQ Q Q

where Q Q Q Q QT

y X β ey X β e

I i i i

Page 13: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects Model Estimation

Model Assumptions

2

2

2 2 '

( | ) 0

( | ) (1 1/ )

( , | , ) ( 1/ ) 0,

1( | ) ( )

( | )

it it

it it e

it is it is e

i i e e T T T

N

E e

Var e T

Cov e e T t s

Var QT

Var

x

x

x x

e X I i i

e X Ω I

Page 14: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects Model Estimation: OLS

Within Estimator: OLS

1' 1 ' ' '

1 1

' 1 ' ' 1

1 12 ' ' '

1 1 1

12 '

1

2

ˆ ( )

ˆˆ ( ) ( ) ( )

ˆ

ˆ

ˆˆ '

i i i

N NOLS i i i ii i

OLS

N N Ne i i i i i ii i i

Ne i ii

e

Var

Q

y X β e y Xβ e

β XX Xy X X X y

β XX XΩX XX

X X X X X X

X X

e

ˆ ˆ/ ( ),NT N K e e y Xβ

Page 15: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects Model Estimation: ML

Normality Assumption'

2

'

2 2

( 1, 2,..., )( 1,2,..., )

~ ( , )

, , ,1

~ (0, ), '

i

it it i it

i i i T i

i e T

i i i i i i i i i

T T T

i e e

y u e t Tu i N

normal iid

with Q Q Q

QT

normal where QQ Q

x βy X β i e

e 0 I

y X β e y y X X e e

I i i

e

Page 16: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects Model Estimation: ML

Log-Likelihood Function

Since Q is singular and |Q|=0, we maximize

2 ' 1

2 ' 12

1 1( , | , ) ln 2 ln2 2 2

1 1ln 2 ln( ) ln2 2 2 2

i e i i i i

e i ie

Tll

T T Q Q

β y X e e

e e

2 2 '2

1( , | , ) ln 2 ln( )2 2 2i e i i e i i

e

T Tll

β y X e e

Page 17: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects Model Estimation: ML

ML Estimator2 2

1

'2 21

2 2

ˆ( , ) argmax ( , | , )

ˆ ˆ 1 ˆ ˆˆ ˆ1 ,

ˆ ˆ'ˆ ˆ1 ( 1)

Ne ML i e i ii

Ni ii

e e i i i

e e

ll

NT T

TT N T

β β y X

e ee y X β

e e

Page 18: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects ModelHypothesis Testing

Pool or Not Pool F-Test based on dummy

variable model: constant or zero coefficients for D w.r.t F(N-1,NT-N-K)

F-test based on fixed effects (unrestricted) model vs. pooled (restricted) model

'

'

. ( , )it it i it

i

it it it

y u evs u u i

y u e

x β

x β

' '

( ) / 1 ~ ( 1, )/ ( )

ˆ ˆ ˆ ˆ,

R UR

UR

UR FE FE R PO PO

RSS RSS NF F N NT N KRSS NT N K

RSS RSS

e e e e

Page 19: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Fixed Effects ModelHypothesis Testing

Based on estimated residuals of the fixed effects model: Heteroscedasticity

Breusch and Pagan (1980) Autocorrelation: AR(1)

Breusch and Godfrey (1981)

' ˆ , 1,...,i i i i N e y x β

2221' ~ (1)

1 'NTLMT

e ee e

Page 20: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model Estimation: GLS

The Model

2 2 '

2 22

2

' '

,( | )

( | )

1 1,

i i i i i T i

i i

i i e T u T T

e ue T

e

T T T T T T

uE

Var

TQ Q

where Q QT T

y X β ε ε i eε X 0

ε X I i i

I

I i i I i i

Page 21: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model Estimation: GLS

GLS

11 1 1 1 1

1 1

11 1 1

1

2 21 '

2 2 2 2 2 2

1 22

2 2

ˆ ( )

ˆ( ) ( )

1 1

1

N NGLS i i i ii i

NGLS i ii

u eT T T T

e e u e e u

eT

e e u

Var

where Q QT T

and Q QT

β XΩ X XΩ y X X X y

β XΩ X X X

I i i I

I

Page 22: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model Estimation: GLS

Feasible GLS Based on estimated residuals of fixed effects

model

1 1 1

1 1

1 2 2 212 2

1

ˆ ˆ ˆ( )ˆ ˆ( ) ( )

1 1ˆ ˆ ˆ ˆ,ˆ ˆ

GLS

GLS

T e ue

Var

where Q Q T

β XΩ X XΩ y

β XΩ X

I

2

2 2 21 1

ˆ ˆˆ ' / ( 1)1ˆ ˆ ˆ ˆˆ ˆ ˆ ' / ,

e

Tu e i itt

N T

T T N where e eT

e e

e e

Page 23: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model Estimation: ML

Log-Likelihood Function

' '

2 2 1

( ) ( 1, 2,..., )( 1, 2,..., )

~ ( , )

1 1( , , | , ) ln 2 ln2 2 2

it it i it it it

i i i

i

i e u i i i i

y u e t Ti N

normal iid

Tll

x β x βy X β εε 0

β y X ε ε

Page 24: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model Estimation: ML

where2 2

2 2 '2

2 21 '

2 2 2 2 2 2

2 22 ' 2

2 2

( )

1 1 ( )

| | ( ) ( ) 1

e ue T u T T T

e

u eT T T T

e u e e u e

T Tu ue T T T e

e e

TQ Q

Q QT T

T

I i i I

I i i I

I i i

Page 25: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects Model Estimation: ML

ML Estimator

2 2 2 21

2 2 1

2 22

2

2 2' 2 '

2 2 21 1

ˆ ˆ ˆ( , , ) argmax ( , , | , )

1 1( , , | , ) ln 2 ln2 2 2

1ln 2 ln2 2

1 ( ) ( )2

Ne u ML i e u i ii

i e u i i i i

e ue

e

T Tuit it it itt t

e e u

ll

whereTll

TT

y yT

β β y X

β y X ε ε

x β x β

Page 26: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Pool or Not Pool Test for Var(ui) = 0, that is

For balanced panel data, the Lagrange-multiplier test statistic (Breusch-Pagan, 1980) is:

, , ,( ) ( ) ( )it is i it i is it isCov Cov u e u e Cov e e

Page 27: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Pool or Not Pool (Cont.)

2

22

1 1

21 1

'

ˆ ˆ'( ) 1 ~ (1)ˆ ˆ2 1 '

ˆ1

2 1 ˆ

ˆˆ 1

ˆ

T N

N Titi t

N Titi t

it it it

Pooled

NTLMT

eNTT e

where e yu

e J I ee e

βx

Page 28: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Fixed Effects vs. Random Effects '

0

'1

: ( , ) 0 ( )

: ( , ) 0 ( )i it

i it

H Cov u random effects

H Cov u fixed effects

x

x

Estimator Random EffectsE(ui|Xi) = 0

Fixed EffectsE(ui|Xi) =/= 0

GLS or RE-OLS(Random Effects)

Consistent and Efficient

Inconsistent

LSDV or FE-OLS(Fixed Effects)

ConsistentInefficient

ConsistentPossibly Efficient

Page 29: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Fixed effects estimator is consistent under H0 and H1; Random effects estimator is efficient under H0, but it is inconsistent under H1.

Hausman Test Statistic ' 1

2

ˆ ˆ ˆ ˆ ˆ ˆ( ) ( )

ˆ ˆ ˆ~ (# ), # # ( )

RE FE RE FE RE FE

FE FE RE

H Var Var

provided no intercept

β β β β β β

β β β

Page 30: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Alternative Hausman Test Estimate the random effects model

F Test that = 0

' ' ' '( ) ( ) ( )it i it i it i ity y e x x β x x γ

0 0: 0 : ( , ) 0i itH H Cov u γ x

Page 31: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Heteroscedasticity H0: θ2=0 | θ1=0 H0: θ1=0 | θ2=0 H0: θ2=0, θ1=0

'

2

2 2 '1

2 2 '1

2

2 2 '2

~ (0, )

( ), 1,..., , 1,...,

( ), 1,..., ,

~ (0, )

( ), 1,...,

it

it

it

i

i

it it it

it i it

it e

e e it

e e i

i u

u u i

yu e

e

h i N t T

or h i N t

u

h i N

x β

z

h

f

Page 32: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Heteroscedasticity (Cont.) Based on random effects model with

homoscedasticity:2 2 2 2 2

1ˆˆ ˆ ˆ ˆ ˆ ˆ, 1,..., ; , ,i i i u e u ei N T e y X β

2 1

1 20| 4

1

' '

' '

1 ' ( ' ) ' ~ (# )ˆ2

[ , 1,... ], ( / )ˆ ˆ[ , 1,..., ], ( / )

i N N N

i i i T T i

LM S F F F F S F

F i N F N F

S S i N S T

f I i i

e i i e

Page 33: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Heteroscedasticity (Cont.)

1 2

1 20|

' '

4 414 4 4 41 1

' '

' '

1 ' ( ' ) ' ~ (# )2

[ , 1,... ], ( / )

ˆ ˆ ( 1) 1 1,ˆ ˆ ˆ ˆ

ˆ ˆ[ , 1,..., ], ( / )ˆ ˆ[ , 1,..., ], ( / )

i N N N

e

e e

i i i T T i

i i i T T T i

LM S H H H H S Ha

H i N H N H

Ta S S S

S S i N S T

S S i N S T

h I i i

e i i e

e I i i e

Page 34: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Heteroscedasticity (Cont.)

Baltagi, B., Bresson, G., Pirotte, A. (2006) Joint LM test for homoscedasticity in a one-way error component model. Journal of Econometrics, 134, 401-417.

1 2 2 1

20, 0 0 0 ~ (# # )LM LM LM F H

Page 35: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Autocorrelation: AR(1) Based on random effects model with no

autocorrelation:

LM test statistic is tedious, see Baltagi, B., Li, Q. (1995) Testing AR(1) against

MA(1) disturbances in an error component model. Journal of Econometrics, 68, 133-151.

2 2 2 2 21

ˆˆ , 1,...,

ˆ ˆ ˆ ˆ ˆ, ,i i i

u e u e

i N

T

e y X β

Page 36: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Joint Test for AR(1) and Random Effects Based on OLS residuals:

Marginal Test for AR(1) & Random Effects

2

22 2 2

0, 0

'1

4 2 ~ (2)2( 1)( 2)

ˆ ˆ ˆ ˆ'( ) '1,ˆ ˆ ˆ ˆ' '

u

N T T

NTLM A AB TBT T

A B

ε I i i ε ε ε

ε ε ε ε

ˆˆ ε y - Xβ

2

22 2 2 2

00~ (1); ~ (1)

2( 1) 1u

NT NTLM A LM BT T

Page 37: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Random Effects ModelHypothesis Testing

Robust LM Tests for AR(1) and Random Effects Because

2 2 2* *0 00, 0 0 0u u u

LM LM LM LM LM

2* 2 2

0

2* 2 20

(2 ) ~ (1)2( 1)(1 2 / )

( / ) ~ (1)( 1)(1 2 / )

u

NTLM B AT TNTLM B A T

T T

Page 38: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Panel Data AnalysisAn Example: U. S. Productivity

The Model (Munnell [1988]):

0 1 2

3 4

ln( ) ln( ) ln( )ln( ) ( )

it it it

it it i it

it it it it

gsp public privateemp unemp u e

public hwy water util

Page 39: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Panel Data AnalysisAn Example: U. S. Productivity

Productivity Data 48 Continental U.S. States, 17 Years:1970-1986

STATE = State name, ST_ABB = State abbreviation, YR = Year, 1970, . . . ,1986, PCAP = Public capital, HWY = Highway capital, WATER = Water utility capital, UTIL = Utility capital, PC = Private capital, GSP = Gross state product, EMP = Employment, UNEMP = Unemployment rate

Page 40: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

U. S. ProductivityBaltagi (2008) [munnell.1, munnell.2]

Panel Data Model ln(GSP) = + ln(Public) + 2ln(Private) + 3ln(Labor) + 4(Unemp) +

FixedEffects s.e

RandomEffects s.e

-0.026 0.029 0.003 0.024

0.292 0.025 0.310 0.020

3 0.768 0.030 0.731 0.026

4 -0.005 0.001 -0.006 0.001

0 2.144 0.137

F(47,764) =75.82 LM(1) = 4135

Hausman LM(4) = 905.1

Page 41: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

Panel Data AnalysisAnother Example: China Provincial Productivity

Cobb-Douglass Production Function ln(GDP) = + ln(L) + ln(K) +

Fixed Effects s.e.

Random Effects s.e

0.30204 0.078 0.4925 0.078

0.04236 0.0178 0.0121 0.0176

2.6714 0.6254

F(29,298) = 158.81 LM(1) = 771.45

Hausman LM(2) = 48.4

Page 42: Spatial Econometric Analysis Using GAUSS 8 Kuan-Pin Lin Portland State University.

References B. H. Baltagi, Econometric Analysis of Panel Data, 4th

ed., John Wiley, New York, 2008. W. H. Greene, Econometric Analysis, 6th ed., Chapter 9:

Models for Panel Data, Prentice Hall, 2008. C. Hsiao, Analysis of Panel Data, 2nd ed., Cambridge

University Press, 2003. J. M. Wooldridge, Econometric Analysis of Cross Section

and Panel Data, The MIT Press, 2002.