Panel Data Analysis Using GAUSS
description
Transcript of Panel Data Analysis Using GAUSS
Panel Data Analysis Using GAUSS
2
Kuan-Pin LinPortland State University
Fixed Effects Model
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
or
Q Q Q
where Q Q Q Q QT
y X β e
y X β e
I i i i
Fixed Effects Model
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
Fixed Effects Model Model Estimation
Within Estimator: FE-GLS
1' 1 ' ' '
1 1
' 1 ' ' 1
1 12 ' ' '
1 1 1
12 '
1
2
ˆ ( )
ˆˆ ( ) ( ) ( )
ˆ
ˆ
ˆˆ '
i i i
N N
OLS i i i ii i
OLS
N N N
e i i i i i ii i i
N
e 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β
Fixed Effects Model Model Estimation: Transformation Approach
Let [FT,T-1,1T/T] be the orthonormal matrix of the eigenvectors of QT = IT-iTi’T/T, where FT,T-1 is the Tx(T-1) eigenvector matrix corresponding to the eigenvalues of 1. Define* * * * * * * 2
( 1)
1*' * 1 *' * *' * *' *
1 1
12 *' * 1 2 *' *
1
2 *' * * * *
, ~ ( , )
ˆ ( )
ˆˆ ˆ ˆ( ) ( )
ˆ ˆ ˆ ˆˆ / ( ),
i i i e N T
N N
OLS i i i ii i
N
OLS e e i ii
e
iid
Var
NT N K
N
y X β e y X β e e 0 I
β X X X y X X X y
β X X X X
e e e y X β
*' * 'ˆ ˆ ˆ ˆ ˆ ˆ:ote with e e ee e y Xβ
* ' * ' * ', 1 , 1 , , 1 , 1 , , 1 , 1 ,, ,i T T T i T i T T T i T i T T T i T y F y x F x e F e
Fixed Effects Model Model Estimation
Panel-Robust Variance-Covariance Matrix Consistent statistical inference for general
heteroscedasticity, time series and cross section correlation.
1 1' ' ' '
1 1 1
1 1' ' '
1 1 1 1 1 1 1
ˆ ˆ ˆˆ ( ) [( )( ) ']
ˆ ˆ
ˆ ˆ
ˆˆ ˆ,
i i i i
N N N
i i i i i i i ii i i
N T N T T N T
it it it is it is it iti t i t s i t
i i i it it
Var E
e e
e y
β β β β β
X X X e e X X X
x x x x x x
e y X β
' ˆitx β
Fixed Effects Model 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 T
u 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
Fixed Effects Model Model Estimation: ML
Log-Likelihood Function
Since Q is singular and |Q|=0, we use orthonomral transformation of the eigenvectors of Q, we maximize
2 ' 1
2 ' 12
1 1( , | , ) ln 2 ln
2 2 21 1
ln 2 ln( ) ln2 2 2 2
i e i i i i
e i ie
Tll
T TQ Q
β y X e e
e e
* 2 2 *' *2
1 1 1( , | , ) ln 2 ln( )
2 2 2i e i i e i ie
T Tll
β y X e e
Fixed Effects Model Model Estimation: ML
ML Estimator
2 * 2
1
*' *2 * * *1
*' * '
1 1
ˆ( , ) argmax ( , | , )
ˆ ˆˆ ˆˆ ,
( 1)
ˆ ˆ ˆ ˆ ˆ ˆ:
N
e ML i e i ii
N
i iie i i i
N N
i i i i i i ii i
ll
N T
Note with
β β y X
e ee y X β
e e e e e y X β
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 e
vs 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 K
RSS NT N K
RSS RSS
e e e e
First-Difference Model First-Difference Representation
Model Assumptions
' ' '1 1 1( ) ( ) ( ) , 2,...,it it it it i i it it it it ity y u u e e y e t T x x β x β
2
2
2
( | ) 0, ~ (0, )
( | ) 2
| | 1( , | , )
0
it it it e
it it e
eit is it is
E e given e iid
Var e
if t sCov e e
otherwise
x
x
x x
2 2 21 1
2 1 0 0 0
1 2 1 0 0
0 1 2 1 0( | ) ( | ) ( )
0 0 1 2 1
0 0 0 1 2
( )
i i e T e e N TVar Var I
Toepliz form
e X e X
First-Difference ModelModel Estimation
First-Difference Estimator: OLS
Consistent statistical inference for general heteroscedasticity, time series and cross section correlation should be based on panel-robust variance-covariance matrix.
1' 1 ' ' '
1 1
2 ' 1 ' ' 1
1 12 ' ' '
1 1 1
22 2
ˆ ( )
ˆˆ ˆ( ) ( ) ( )
ˆ
ˆˆ ˆˆ ˆ, ' / (
2
i i i
N N
OLS i i i ii i
OLS e
N N N
e i i i i i i ii i i
ee e
Var
N
y X β e y Xβ e
β X X X y X X X y
β X X XΩ X X X
X X X X X X
e e ˆˆ),T N K e y Xβ
First-Difference ModelModel Estimation
First-Difference Estimator: GLS' 1 1 ' 1
1' 1 ' 1
1 1
2 ' 1 1
12 ' 1
1
22 2
ˆ ( )
ˆˆ ˆ( ) ( )
ˆ
ˆ ˆˆ ˆ ˆˆ ˆ, ' / ( ),2
GLS
N N
i i i i i ii i
GLS e
N
e i i ii
ee e
Var
NT N K
β XΩ X XΩ y
X X X y
β XΩ X
X X
e e e y Xβ
First-Difference ModelModel Estimation: Transformation Approach
The first-difference operator is a (T-1)xT matrix with elements:
Using the transformation matrix (, then we have the Forward Orthogonal Deviation Model:
1
1 1, 1,... 1; 1,...,
0ts
if s t
if s t t T s T
otherwise
' 2
' ' '
' '
1 1 1
, ~ (0, )
( ), ( ), ( ),1
1 1 1, ,
it iitt it it e
F F Fit t it it iitt t it it it t it it t
T T TF F Fit is it is it is
s t s t s t
y e e iid
T ty c y y c e c e e c
T t
y y e eT t T t T t
x
x x x
x x
First-Difference ModelModel Estimation: Transformation Approach
FD-GLS
Consistent statistical inference for general heteroscedasticity, time series and cross section correlation should be based on panel-robust variance-covariance matrix.
1' 1 ' ' '
1 1
12 ' 1 2 '
1
2
ˆ ( )
ˆˆ ˆ ˆ( ) ( )
ˆ ˆ ˆ ˆˆ ' / ( ),
i i i
N N
OLS i i i ii i
N
OLS e e i ii
e
Var
NT N K
y X β e y Xβ e
β XX XX X X X X
β XX X X
e e e y Xβ
References
B. H. Baltagi, Econometric Analysis of Panel Data, 4th ed., John Wiley, New York, 2008.
W. H. Greene, Econometric Analysis, 7th ed., Chapter 11: Models for Panel Data, Prentice Hall, 2011.
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.