One-way random effects model. Estimation

Panel data models
Structure of the panel data
Panel or longitudinal data combines time series and cross
sections.
Let i=1,…,n – denotes object, t=1,…,T – denotes time, then
yit – observations on dependent variable,
xit – vector of observations on independent variables.
We have 2 subscripts.
If we have observations for each object and for every time
moment, then the panel is balanced, total number of the
observations equals n*T. If there are no observations for
some i or t, then the panel is unbalanced. If for different
periods we have observations for different objects, then we
deal with pseudo-panel.
Linear panel model
Linear panel model
yit  xitT   uit
i – an object, t – time period, β – vector of regression coefficients, xitT –
transpose of vector of regression coefficients for k independent variables.
 x1it 
 
xit   ... 
x 
 kit 
 1 
 
   ... 
 
 k
One-way error component regression model: uit  i  it
μi –unobservable individual effects, υit – the reminder idiosyncratic
disturbance.
uit  i  t  it
Two-way error component regression model:
λi – unobservable time effects.
Random effects models
One-way random effects model
One-way random effects model.
We assume that 1) the disturbance term contains the individual
effects and the idiosyncratic component and 2) the individual
effects are random variables and they are part of the error.
uit  i  it
yit  xitT    i   it
Let  i ~ 0,  2  are i.i.d. and  it ~ 0,  2  are i.i.d. Both of them
are independent on each other and on the regressors.
We assume that the constant is a part of X.
One-way random effects model.
The matrix Ω.
2
2


Var uit  Var(i  it )      
Cov(uit , uis )  Cov(i  it , i  is )   2
t≠s
Cov(u it , u js )  Cov(  i   it ,  j   js )  0
i≠j
Cov(u it , u jt )  Cov(  i   it ,  j   jt )  0
i≠j
One-way random effects model.
  2   2

 2 ...
 2


2
2
2
2
     ...

0 ...
0
   ...



2
2
2
2

...

...







 

T T


0

0






0


2
2
2
2
   
  ...
 


0
... 0
 2 ...  2   2 ...
 2 


2
2
2
2

  ...
  ...
    

One-way random effects model.
Estimation
Approaches to the estimation:
1. OLS
ˆOLS  ( X T X ) 1 X T y
Var ( ˆ )
OLS

 X X
T

1
1
(X  X )
T
1
X X 
T
1
The estimate is unbiased, consistent, asymptotically
normal, but is not efficient.
One-way random effects model.
Estimation
2. Within-estimation

ˆ
W ithin  X QX
Q  I nt  P
Var ( ˆ

1
X T Qy
P  D( D T D) 1 D T
D  I niT


)  X QX
W ithin
T
T

1
X QQX X QX
T
T

1
The estimate is unbiased, consistent, asymptotically
normal, but is not efficient.
One-way random effects model.
Estimation
3. Between – estimation (modification of initial data with
1
T
matrix P)
ˆ

 X PX  X T Py
Between
P
1
In  JT
T
The modification with matrix Р means
yi  xiT   i  i
Var ( ˆ
Between

)  X PX
T

1

X PPX X PX
T
T

1
The estimate is unbiased, consistent, asymptotically normal,
but is not efficient.
One-way random effects model.
Estimation
4. GLS
ˆGLS  ( X T  1 X ) 1 X T  1 y
VarˆGLS  ( X T  1 X ) 1
The estimate is unbiased, consistent,
asymptotically normal and efficient
One-way random effects model.
Estimation
Rewrite matrix Ω using Q and P
Q  I nT
    I nT
2
1
 In  JT
T
1
P  In  JT
T


1


2
2 1
   I n  J T     I nT  I n  J T      T  I n  J T
T
T


2
2


   Q    T  P
2
2
2
Spectral decomposition of matrix Ω
One-way random effects model.
Estimation
Properties of matrices Q and P
QP  PQ  0
QP  ( I  P) P  P  P 2  P( I  P)  0
PQ  P( I  P)  P  P  P  P  0
2
One-way random effects model.
Estimation
 1 
1
 2
1
P
2
2
   T 
Q
 1

1
    Q     T  P   2 Q  2
P
2




T






1


2
1
2
2

  Q  P  I  P  P  I
2
    Q  P
2
1
2


2
 2  T 2
One-way random effects model.
Estimation


1
2


1

1

2
Q
1
 2  T 2

P

1

Q 
P
1 
1 

 I nT  1   I n  J T 
 
T 

One-way random effects model.
Estimation
The GLS estimate
ˆGLS  ( X T  2  1 X ) 1 X T  2  1 y
ˆ
GLS
ˆ
GLS
 ( X Q  PX ) X Q  Py
1
T

 X QX  X PX
T
T
 X
1
T
T
Qy  X T Py

The GLS estimate – weighted sum of within-estimate and
between-estimate, the weight for the within-estimate equals 1,
the weight for the between-estimate is 
One-way random effects model.
Estimation
Q   P modification of the initial data means:

  


T

yit  1   yi  xit  1   xi   it  1  
The estimates coincides with the OLS estimates based on the
modified data.
Variance of the estimate:
VarˆGLS
1



1

 ( X  X )    X   X    2 X T QX  X T PX 






T
1
1
1

2
T
1

2
One-way random effects model.
Estimation
To apply FGLS we need an estimation of Ω, we need estimations
2
for  2 ,   , and θ.
There are several approaches to the estimations.
1. We use within-regression for
Then using between-regression for
And finally:
ˆ 
ˆ2
ˆ2  Tˆ 2

ˆ2 
RSSW ithin
nT  n  k  1
ˆ 2 
ˆ2
T

1 RSS Between

T
nk
RSS W ithin P
nk


nT  n  k  1 RSS Between
One-way random effects model.
Estimation
2. We use OLS estimations of û it
n T
1
2
ˆ
ˆ   ˆ 
u
 it
nT  k i 1 t 1
2
2
ˆ2

1 n 1 T
2
ˆ
ˆ  

u



it 
T
n  k i1  T t 1 
2
We have two variables to estimate and two equations.
One-way random effects model.
Estimation
FGLS estimation
ˆ
FGLS

 X QX  ˆX T PX
T
 X
1
T
Qy  ˆX T Py

is OLS estimation applied to the modified data:
T
yit  1  ˆ  yi   xit  1  ˆ  xi    it  1  ˆ i



 



One-way random effects model. Testing
Testing for individual effects
H 0 :  2  0
H a :  2  0
1. Exact approach:  i ~ N 0,  2  and  it ~ N 0,  2 
RSS W itnin
 2
F
2

~ nT nk 1
RSS Between n  k 
1

RSS W ithin nT  n  k  1 ˆ
RSS Between
 2  T 2
~  nk
~ Fnk ,nT nk 1
2. Asymptotical approach:
nT  uˆ T I n  J T uˆ 
2
1 

LM 



1
H0

2(T  1) 
uˆ T uˆ

2
2
Two-way random effects model
Two-way random effects model
We assume that 1) the disturbance term contains
individual, time effects and the idiosyncratic
component and 2) the individual and the time effects
are random variables and they are part of the error.
uit  i  t  it
yit  xitT   i  t  it
Let  i ~ 0, 2  and t ~ 0,  2  are i.i.d. and  it ~ 0,  2 
are i.i.d. All components of the error are independent
on each other and on regressors.
We assume that constant is presented in X.
Two-way random effects model
Matrix Ω is as follows.
Varuit   Var(i  t  it )   2   2  2
Cov(uit , uis )  Cov(i  t  it , i  s  is )   2
Cov(uit , u js )  Cov( i  t  it ,  j  s   js )  0
Cov(uit , u jt )  Cov(i  t  it ,  j  t   jt )   
2
Two-way random effects model
The spectral decomposition
  2 I nT   2 I n  JT   2 J n  IT  2Q  1Q1  2Q2  3Q3
Q  I nT
1
1
1
 I n  J T  J n  IT 
J nT
T
n
nT
1  1

Q1   I n  J n   J T
n  T

1
1 

Q2  J n   I T  J T 
n
T 

1   2  T 2
2   2  n 2
1
Q3 
J nT
nT
3  2  T 2  n 2
Two-way random effects model
Matrices Q, Q1, Q2, Q3 are orthogonal
    Q  Q1  1Q2   2Q3
1
2


2
1 
   T 
2
2
 2
 2  n 2
1 1


2  2
    1
2
2
   T   n    1 
2
1
Two-way random effects model.
Estimation
GLS estimation
ˆGLS  ( X T 1 X )1 X T 1 y  ( X T21 X )1 X T21 y
ˆGLS  ( X T Q  Q1  1Q2  2Q3 X )1 X T Q  Q1  1Q2  2Q3 y
ˆ
GLS
 X QX  X Q1 X  1 X Q2 X   2 X Q3 X




T
T
T
T
* X T Qy  X T Q1 y  1 X T Q2 y   2 X T Q3 y
1
*
The modification of the initial data is done with matrices Q, Q1,
Q2 и Q3
Two-way random effects model. Estimation
The modified regression equations are as
follows:

 
 

 x  1   x  1   x  1       x   
   1     1     1       
yit  1   yi  1  1 yt  1    1   2 y 
T
it
it
i
i
1
1
t
t
1
1
2
2
It is OLS estimation based on the modified data
Two-way random effects model.
Estimation
To apply FGLS estimation we need consistent
2
2


estimators for  ,  and  2 , and then for θ, θ1 and θ2.
1. Approach to the estimation.
Using within-regression
ˆ2 
RSS W ithin
nT  n  T  k  1
Using Between-individuals regression
1 T
   t
T t 1
yi  xiT   i    i
ˆ 2 
ˆ2
T

1 RSS Between

T
nk
Two-way random effects model. Estimation
Between-periods regression
yt  x     t  t
T
i
N
1
   i
n i 1
ˆ2
1 RSS Between periods
ˆ  
 
n n
T k
2
Between-periods regression requires large T.
Two-way random effects model. Estimation
Combining the estimation we obtain:
ˆ 
ˆ2
RSS W ithin
nk


2
2
ˆ  Tˆ  nT  n  k  T  1 RSS Betweenindividuals
ˆ1 
ˆ2
ˆ2  nˆ 2
ˆ2 

RSS W ithin
T k

nT  n  k  T  1 RSS Between periods
1 1

ˆ

    1
2
2
2
ˆ  Tˆ   nˆ   ˆ ˆ1 
2
1
Two-way random effects model.
Estimation
2. Approach to the estimation, we use OLS-estimates of
n T
1
2
ˆ
ˆ   ˆ   ˆ 
u
 it
nT  k i1 t 1
2
2
2
ˆ 2
ˆ2
ˆ 2
ˆ

1 n 1 T
2
ˆ
ˆ
 


  uit 

T
T
n  k i1  T t 1 
ˆ 2 
2
1

1
ˆ


  uit 

n
n T  k t 1  n i1 
2
T
n
2
û it
Two-way random effects model.
Estimation
FGLS estimate:

ˆFGLS  X QX  ˆX Q1 X  ˆ1 X Q2 X  ˆ2 X Q3 X

T
T
T
T
T
T
T
ˆ
ˆ
ˆ
* X Qy  X Q1 y  1 X Q2 y  2 X Q3 y
T

1

*
Two-way random effects model. Testing
Testing of the individual effects
H a :  2  0
H 0 :  2  0
1. Exact approach:  i ~ N 0,  2  and  it ~ N 0,  2 
RSS W itnin
 2
F
2

~ nT n T k 1
RSS Between n  k 
RSS W ithin nT  n  T  k  1
RSS Betweenindividuals ~  2
n k
2
2
   T 
~ Fn  k ,nT  n T  k 1
2. Asymptotical approach:
nT  uˆ I n  J T uˆ 
2
1 

LM  



1
H0

2(T  1) 
uˆ T uˆ

T
2
Two-way random effects model. Testing
Testing of the time effects
H 0 :  2  0
1. Exact approach
RSS W itnin
 2
F
t ~

H a :  2  0


N 0,  2 and  it ~N 0,  2
RSS Between periods
2
~  nT
 n T  k 1
 2  n 2
RSS Between periods T  k 
RSSW ithin nT  n  T  k  1
~
~T2k
FT k ,nT nT k 1
2. Asymptotical approach
nT  uˆ  J n  I T uˆ 
2
1 

LM  



1
H0

2(n  1) 
uˆ T uˆ

T

2
Two-way random effects model. Testing
Testing of the individual and time effects
H 0 :  2   2  0
1. Exact approach t ~ N 0,  2  ,  i ~ N 0, 2  ,  it ~ N 0,  2 
F
( RSS Betweenindividuals  RSS Between periods ) n  T  2k 
RSS W ithin nT  n  T  k  1
~ FnT 2 k ,nT nT k 1
2. Asymptotical approach
2
LM  LM   LM  

2
H0
Fixed or random effects?
A general recommendation:
If the conclusions deal with the sample
only it is recommended to apply fixed
effects models.
If the conclusions will be extended into a
general population it is better to apply
random effects models.
Fixed or random effects?
Hausman’s specification test
Actually we choose between the estimation methods:
GLS-estimation and within-estimation.
GLS-estimator assumes that µi is not correlated with
regressors xit. If the assumption holds the GLSestimation is consistent
The consistency of within-estimations do not need such
assumption, the within-estimations are consistent
even when µi is correlated with xit.
Fixed or random effects?
The correctness of the model specification depends on the
existence of the correlation between the disturbance and the
regressors.
The regression function must be linear and includes all
significant regressors.
The residual heterogeneity incorporated into the individual
effects must be random and do not connected with the
characteristics of objects presented in the regressors.
So, we a talking about correct specification of the model, and we
can apply the Hausman’s specification test.
Fixed or random effects?
To distinguish between the fixed and random effects means to
test whether the regressors and the errors (including
individual or/and time effects) are correlated.
H 0 : E[ui xi ]  0
If H0 is correct we can use GLS-estimator.
The alternative hypothesis is:
H A : E[ui xi ]  0
Within-estimator is consistent both for H0, and for HA,
Fixed or random effects?
If H0 is correct then GLS-estimator and Within-estimator coincide.
P
qˆ  ˆGSL  ˆWithin 

0
If HA is correct, then due to inconsistency of GLS-estimator the
estimations are different.
P
qˆ  ˆGSL  ˆWithin 

0
Hausman’s statistics:
T
1
1
d
  qˆ T Var (qˆ )  qˆ  ˆGLS  ˆWithin  Var ( ˆWithin )  Var ( ˆGLS )  ˆGLS  ˆWithin  

 2( k )

  ˆGLS  ˆWithin  X T QX
T

1

X T QQX X T QX

1
 ( X T  1 X ) 1
 ˆ
1
GLS
d
 ˆWithin  

 2( k )
Fixed or random effects?
 k2
1
q
If
then specification of the model with random effects can
not be accepted, it is necessary to use fixed effects
model.
  q1
If
then the specification with random effects can be used.
The model can be improved with inclusion of the
additional regressors or with non-linear forms.
2
k