8 Spatial Econometric Analysis Using GAUSS Kuan-Pin Lin

Download Report

Transcript 8 Spatial Econometric Analysis Using GAUSS Kuan-Pin Lin

Spatial Econometric Analysis
Using GAUSS
8
Kuan-Pin Lin
Portland State University
Panel Data Analysis
A 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
Panel Data Analysis
A Review

The Model
yit  xit'    it 
'

y

x

it
it   ui  vt  eit
 it  ui  vt  eit 
'
 One-Way (Individual) Effects: yit  x it   ui  eit


Unobserved Heterogeneity
Cross Section and Time Series Correlation
Cov(ui , u j )  0, Cov(eit , e jt )  0, i  j
Cov(eit , ei )  0, t  
Panel Data Analysis
A Review


N-first Representation

T-first Representation
yit  xit' β  ui  eit
yti  xti' β  ui  eti
i  1, 2,..., N ; t  1, 2,..., T
t  1, 2,..., T ; i  1, 2,..., N

y i  Xi β  ui iT  ei

y t  X t β  u  et

y  Xβ  (I N  iT )u  e

y  Xβ  (iT  I N )u  e
Dummy Variables
Representation
y  Xβ  Du  e
D  I N  iT or D  iT  I N
Panel Data Analysis
A Review

Notations
 xi' 1   x1,i1
 yi1 
 '  x
y 
x
1,i 2
y i   i 2  , Xi   i 2   
  
 
 '  
 
y
 xiT   x1,iT
 iT 
 xt' 1   x1,t1
 yt1 
 '  x
y 
x
1,t 2
y t   t 2  , Xt   t 2   
  
 
 '  
 
 ytN 
 xtN   x1,tN
x2,i1
x2,i 2
x2,iT
x2,t1
x2,t 2
x2,tN
xK ,i1 
 ei1 
 1 
e 
 
xK ,i 2 
, ei   i 2  , β   2 

 
 

 
 
xK ,iT 
e
K 
 iT 
x K ,t 1 
 et1 
 u1 
e 
u 
xK ,t 2 
, et   t 2  , u   2 

 
 

 
 
xK ,tN 
e
 tN 
u N 
Pooled (Constant Effects) Model
yit  xit' β  ui  eit (i  1, 2,..., N ; t  1, 2,..., T )
 assuming u  ui i
yit  xit' β  u  eit
β 
 w it   x 1 , δ   
u 
yit  w it δ  eit  y  Wδ  e
'
it
E (e | X)  0, Var (e | X)   e2I
Fixed Effects Model
yit  xit' β  ui  eit (i  1, 2,..., N ; t  1, 2,..., T )

ui is fixed, independent of eit, and may be
correlated with xit.
Cov(ui , eit )  0, Cov(ui , xit )  0
y i  Xi   ui iT  ei , i  1, 2,..., N

y t  Xt   u  et , t  1, 2,..., T
Fixed Effects Model

Fixed Effects Model

Classical Assumptions



Strict Exogeneity: E (eit | u, X)  0
Homoschedasticity: Var (eit | u, X)   e2
No cross section and time series correlation:
Var (e | u, X)   e2 I NT

Extensions: Var (e | u, X)  

Panel Robust Variance-Covariance Matrix
Random Effects Model

Error Components
yit  xit' β   it
 it  ui  eit (i  1, 2,..., N ; t  1, 2,..., T )


ui is random, independent of eit and xit.
Cov(ui , eit )  0, Cov(ui , xit )  0, Cov(eit , xit )  0
Define the error components as it = ui + eit
y i  Xi   (ui iT  ei ), i  1, 2,..., N

y t  Xt   (u  et ), t  1, 2,..., T
Random Effects Model

Random Effects Model

Classical Assumptions

Strict Exogeneity
E (eit | X)  0, E (ui | X)  0  E ( it | X)  0


X includes a constant term, otherwise E(ui|X)=u.
Homoschedasticity
Var (eit | X)   e2 , Var (ui | X)   u2 , Cov(ui , eit )  0
 Var ( it | X)   2   e2   u2

Constant Auto-covariance (within panels)
Var (εi | X)   e2 IT   u2iT iT'
Random Effects Model

Random Effects Model

Classical Assumptions (Continued)

Cross Section Independence
Var (εi | X)     e2IT   u2iT iT'
Var (ε | X)  Ω  I N  

Extensions:

Panel Robust Variance-Covariance Matrix
Fixed Effects Model
Estimation

Within Model Representation
yit  xit' β  ui  eit
yi  xi' β  ui  ei
yit  yi  (xit'  xi' )β  (eit  ei )
 yit  xit' β  eit
y i  X i β  ei
or
Qy i  QXi β  Qei
1 '
where Q  IT  iT iT , (QiT  0, Q ' Q  Q)
T
Fixed Effects Model
Estimation

Model Assumptions
E (eit | xit )  0
Var (eit | xit )  (1  1/ T ) e2
Cov(eit , eis | xit , xis )  ( 1/ T ) e2  0, t  s

1 '
Var (ei | Xi )     Q   (IT  iT iT )
T
Var (e | X)  Ω  I N  
2
e
2
e
Fixed Effects Model
Estimation: OLS

Within Estimator: OLS
y i  Xi β  ei
 y  Xβ  e
1
ˆβ  ( X' X) 1 X' y   N X' X 
OLS
  i 1 i i 
ˆ (βˆ )  ( X' X) 1 X'ΩX( X' X) 1
Var
'
X
 i1 i y i
N
OLS
1
 ˆ   i 1 X Xi    i 1 X QXi    i 1 X Xi 

 


2
e
N
'
i
1
N
 ˆ   i 1 X Xi 


ˆ e2  eˆ ' eˆ / ( NT  N  K ), eˆ  y  Xβˆ
2
e
N
'
i
'
i
N
'
i
1
Fixed Effects Model
Estimation: ML

Normality Assumption
yit  xit' β  ui  eit
y i  Xi β  ui iTi  ei
(t  1, 2,..., T )
(i  1, 2,..., N )
ei ~ normal iid (0,  e2 IT )

y i  Xi β  ei with y i  Qy i , Xi  QXi , ei  Qei ,
1 '
iT iT
T
ei ~ normal (0, ), where    e2QQ '   e2Q
Q  IT 
Fixed Effects Model
Estimation: ML

Log-Likelihood Function
T
1
1 ' 1
lli (β,  | y i , Xi )   ln  2   ln   ei  ei
2
2
2
T
T
1
1 ' 1
2
  ln  2   ln( e )  ln Q  2 ei Q ei
2
2
2
2 e
2
e

Since Q is singular and |Q|=0, we maximize
T
T
1 '
2
lli (β,  | y i , Xi )   ln  2   ln( e )  2 ei ei
2
2
2 e
2
e
Fixed Effects Model
Estimation: ML

ML Estimator
N
2
ˆ
(β,  e ) ML  arg max  i 1 lli (β,  e2 | y i , Xi )
ˆ ' eˆ
e
 i 1 i i
N
 1 2 ˆ
ˆ 
 1   ˆ e , ei  y i  Xi βˆ
NT
 T
eˆ ' eˆ
 T  2
2
 ˆ e  
 ˆ e 
N (T  1)
 T 1 
2
e
Fixed Effects Model
Hypothesis 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
yit  xit' β  ui  eit
vs. (ui  u, i )
yit  xit' β  u  eit
( RSS R  RSSUR ) / N  1
F
~ F ( N  1, NT  N  K )
RSSUR / ( NT  N  K )
RSSUR  eˆ 'FE eˆ FE , RSS R  eˆ 'POeˆ PO
Fixed Effects Model
Hypothesis Testing

Based on estimated residuals of the fixed
'ˆ
e

y

x
effects model: i
i
i β, i  1,..., N

Heteroscedasticity


Breusch and Pagan (1980)
Autocorrelation: AR(1)

Breusch and Godfrey (1981)
2
NT  e ' e 1 
2
LM 
~

(1)


T 1  e 'e 
2
Random Effects Model
Estimation: GLS

The Model
y i  Xi β  ε i , ε i  ui iT  ei
E (ε i | Xi )  0
Var (ε i | Xi )     e2IT   u2iT iT'
2
2




T

2
e
u
  e Q 
 IT  Q  
2
e


1 '
1 '
where Q  IT  iT iT , IT  Q  iT iT
T
T
Random Effects Model
Estimation: GLS

GLS
βˆ GLS  ( XΩ X) XΩ y    i 1 Xi  Xi 


1
1
1
N
1
and 

1
2
1
N
1

 e2
1 

I  Q 
Q 
2
2  T
 e 
 e  T u

1
X

 i 1 i y i
N
1
Var (βˆ GLS )  ( XΩ X)    i 1 Xi  Xi 


2


1
1
1
' 
u
where   2 IT  2
i i  2
2 T T
e 
 e  T u
 e
1
1


 e2
I  Q 
Q  2
2  T
 e  T u


Random Effects Model
Estimation: GLS

Feasible GLS

Based on estimated residuals of fixed effects
model ˆ 2  eˆ ' eˆ / N (T  1)
e
1 T ˆ
ˆ
ˆ
ˆ
ˆ  T ˆ  ˆ  T e ' e / N , where ei   t 1 eit
T
ˆ 1X)1 XΩ
ˆ 1y
βˆ GLS  ( XΩ
ˆ 1X) 1
Var (βˆ )  ( XΩ
2
1
2
u
2
e
GLS
 1
 2
1
1
ˆ
where    2 Q  2  IT  Q   , ˆ1  ˆ e2  Tˆ u2
ˆ1
 ˆ e

Random Effects Model
Estimation: ML

Log-Likelihood Function
yit  xit' β  (ui  eit )  xit' β   it
y i  Xi β  ε i
(t  1, 2,..., T )
(i  1, 2,..., N )
εi ~ normal iid (0, )

lli (β,  e2 ,  u2 | y i , Xi )  
T
1
1
ln  2   ln   εi  1εi
2
2
2
Random Effects Model
Estimation: ML

where


 e2  T  u2
   I   i i  Q 
(I T  Q ) 
2
e



 u2
 e2
1 
1 
1
' 
  2  IT 
i i  2 Q 
(I T  Q ) 
2
2 T T 
2
2
e 
T u   e
T u   e
 e 

2
e T
2
'
u T T
2
2



T

2 T
'
2 T
u
u
|  | ( e ) IT  2 iT iT  ( e ) 1  2 
e
e 

Random Effects Model
Estimation: ML

ML Estimator
(βˆ , ˆ e2 , ˆ u2 ) ML  arg max  i 1 lli (β,  e2 ,  u2 | y i , Xi )
N
where
T
1
1
lli (β,  ,  | y i , Xi )   ln  2   ln   εi  1εi
2
2
2
2
2




T

T
1
2
e
u
  ln  2 e   ln 

2
2   e2

2
2

1  T
T
'
2
'
u
  ( yit  xit β)  
 2   t 1 ( yit  xit β)  2
2
  e  T  u  t 1
 
2 e  
2
e
2
u
Random Effects Model
Hypothesis Testing

Pool or Not Pool

Test for Var(ui) = 0, that is
Cov( it , is )  Cov(ui  eit ,ui  eis )  Cov(eit ,eis )

For balanced panel data, the Lagrange-multiplier
test statistic (Breusch-Pagan, 1980) is:
Random Effects Model
Hypothesis Testing

Pool or Not Pool (Cont.)
NT  eˆ '(J T  I N )eˆ 
2
LM 

1
~

(1)


2 T  1 
eˆ ' eˆ





ˆ
e
NT   i 1  t 1 it


 1
N
T

2
2 T  1   eˆit


i 1
t 1


βˆ 
'
where eˆit  yit   xit 1  
uˆ  Pooled
N
T
2
2
Random Effects Model
Hypothesis Testing

Fixed Effects vs. Random Effects
H 0 : Cov(ui , xit' )  0 (random effects)
H1 : Cov(ui , xit' )  0 ( fixed effects)
Estimator
Random Effects
E(ui|Xi) = 0
Fixed Effects
E(ui|Xi) =/= 0
GLS or RE-OLS Consistent and
(Random Effects) Efficient
Inconsistent
LSDV or FE-OLS Consistent
(Fixed Effects)
Inefficient
Consistent
Possibly Efficient
Random Effects Model
Hypothesis 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


H  βˆ RE  βˆ FE Var (βˆ RE )  Var (βˆ FE )  βˆ RE  βˆ FE
~  2 (# βˆ FE ), provided # βˆ FE  # βˆ RE (no intercept )
Random Effects Model
Hypothesis Testing

Alternative Hausman Test


Estimate the random effects model
( yit   yi )  (xit'   xi' )β  (xit'  xi' ) γ  eit
F Test that g = 0
H 0 : γ  0  H 0 : Cov(ui , xit )  0
Random Effects Model
Hypothesis Testing

Heteroscedasticity

yit  xit' β   it

 it  ui  eit

H0: θ2=0 | θ1=0
H0: θ1=0 | θ2=0
H0: θ2=0, θ1=0
eit ~ (0,  e2it )
 e2   e2 h(z it' 1 ), i  1,..., N , t  1,..., T
it
or  e2it   e2 h(hi'1 ), i  1,..., N , t
ui ~ (0,  u2i )
 u2   u2 h(fi' 2 ), i  1,..., N
i
Random Effects Model
Hypothesis Testing

Heteroscedasticity (Cont.)

Based on random effects model with
homoscedasticity:
eˆ  y  X βˆ , i  1,..., N ; ˆ 2 , ˆ 2 , ˆ 2  Tˆ 2  ˆ 2
i
i
LM 2 0|1
i
u
e
1
u
1
1
2

S
'
F
(
F
'
F
)
F
'
S
~

(# F )
4
2ˆ1
F  [fi' , i  1,...N ], F  (I N  i N i 'N / N ) F
S  [ Si , i  1,..., N ], Si  eˆ i' (iT iT' / T )eˆ i
e
Random Effects Model
Hypothesis Testing

Heteroscedasticity (Cont.)
1
LM 1 0|2 
S ' H ( H ' H ) 1 H ' S ~  2 (# H )
2a
H  [hi' , i  1,...N ], H  (I N  i N i 'N / N ) H
 1
ˆ e4  ˆ14 (T  1)
1
a
,S  4 S  4
4 4
ˆ1 ˆ e
ˆ e
 ˆ1

S

S  [ Si , i  1,..., N ], Si  eˆ i' (iT iT' / T )eˆ i
S  [ Si , i  1,..., N ], Si  eˆ i' (IT  iT iT' / T )eˆ i
Random Effects Model
Hypothesis Testing

Heteroscedasticity (Cont.)
LM1 0,2 0  LM2 0  LM1 0 ~  2 (# F  # H )

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.
Random Effects Model
Hypothesis Testing

Autocorrelation: AR(1)

Based on random effects model with no
autocorrelation: eˆ i  y i  Xi βˆ , i  1,..., N
ˆ u2 , ˆ e2 , ˆ12  T ˆ u2  ˆ e2


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.
Random Effects Model
Hypothesis Testing

Joint Test for AR(1) and Random Effects

Based on OLS residuals: εˆ  y - Xβˆ
LM  0, 2 0
u
NT 2
 A2  4 AB  2TB 2  ~  2 (2)

2(T  1)(T  2)
εˆ '(I N  iT iT' )εˆ
εˆ ' εˆ 1
A
 1, B 
εˆ ' εˆ
εˆ ' εˆ

Marginal Test for AR(1) & Random Effects
LM 2 0
u
2
NT
NT

A2 ~  2 (1); LM  0 
B 2 ~  2 (1)
2(T  1)
T 1
Random Effects Model
Hypothesis Testing

Robust LM Tests for AR(1) and Random
Effects

Because
LM  0, 2 0  LM * 0  LM  2 0  LM * 2 0  LM  0
u
u
u
LM  2 0
NT

(2 B  A) 2 ~  2 (1)
2(T  1)(1  2 / T )
LM * 0
NT 2

( B  A / T ) 2 ~  2 (1)
(T  1)(1  2 / T )
*
u
Panel Data Analysis
An Example: U. S. Productivity

The Model (Munnell [1988]):
ln( gspit )   0  1 ln( publicit )   2 ln( privateit )
 3 ln(empit )   4 (unempit )  ui  eit
publicit  hwyit  waterit  utilit
Panel Data Analysis
An 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
U. S. Productivity
Baltagi (2008) [munnell.1, munnell.2]

Panel Data Model
ln(GSP) = 0 + 1 ln(Public) + 2ln(Private) + 3ln(Labor)
+ 4(Unemp) + 
Fixed
Effects
s.e
Random
Effects
s.e
1
-0.026
0.029
0.003
0.024
2
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
2.144
0.137
0
F(47,764) =75.82
Hausman LM(4) = 905.1
LM(1) = 4135
Panel Data Analysis
Another Example: China Provincial Productivity

Cobb-Douglass Production Function
ln(GDP) = a +  ln(L) + g ln(K) + 
Fixed
Effects
s.e.
Random
Effects
s.e

0.30204
0.078
0.4925
0.078
g
0.04236
0.0178
0.0121
0.0176
2.6714
0.6254
a
F(29,298) = 158.81
Hausman LM(2) = 48.4
LM(1) = 771.45
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.