You are on page 1of 30

Panel Data Models

M. Firdaus, Ph.D

InterCAFE
(International Center for Applied Finance and
Economics)

Why Panel Data?


To increase presision
To increase efficiency: more observations, higher
DF
To allow to explicitly take in to account
individual heterogeneity.

Famous Panel Studies


Canadian Survey of Labour Income
Dynamics
Japanese Panel on Consumers
Korea Labor and Income Panel Surveys
Household Income and Labor Dynamics in
Australia
Indonesia Family Life Surveys
3

One-way and two-way error


components models

The Basic Data Structure


x211 .. xK 11
x212 .. xK 12
.. .. ..

x11T
x121

x122

x21T .. xK 1T
x221 .. xK 21
x222 .. xK 22

Individual 1

x111

x112
..

Individual 2

Wave T

x12T

x22T

x
1N 1
x1N 2

..
x
1NT

x2 N 1
x2 N 2
..
x2 NT

.. xKN 1

.. xKN 2

..
..
.. xKNT

Wave T
Wave 1

..
..

.. xK 2T

..

Individual N

Wave 1

..

Wave 1

Wave T

Formulate an hypothesis

yit f ( x1it , x2it ,..., xkit )

Develop an error components


model

yit 0 1 x1it 2 x2it ... k xkit it


Explanatory
variables

it i uit

Constant across individuals

Normally distributed
error -

uit ~ N (0, )
2
u

Composite error term


7

One-way or two-way error


components?

it i uit
Individual
effect

Time
Effect

Random
error

it i t uit
8

Treatment of individual
effects

Restrict to one-way model. Then two options


for treatment of individual effects:

Fixed effects assume i are constants


Random effects assume i are drawn
independently from some probability
distribution

The Fixed Effects Model


Treat as a constant for each
individual

yit 0 i 1 x1it 2 x2it ... k xkit uit

now part of constant but varies by 10individ

Graphically this looks like:


Different Constant for Each Individual
60

50

40

Individual 1
Individual 2

30

Individual 3
Individual 4

20

10

0
-5

10

15

20

11

And the slope that will be estimated is BB rather than A


Note that the slope of BB is the same for each individua
Only the constant varies
60

50

40
Individual 1
Individual 2
Individual 3
Individual 4

30

Linear (Individual 1)
Linear (Individual 3)
Linear (Individual 2)
Linear (Individual 4)

20

B
B

10

A
0

-5

10

15

20

12

5 Ways of Estimating
a Panel Model
Assume that intercepts and slopes are the same over
time and individuals.
Assume that slopes are constant but that intercepts
vary over individuals.
Assume that slopes are constant but that intercepts
vary over time and individuals.
Assume that all coefficients vary over individuals.
Assume that all coefficients vary over individuals
and time.
13

ossible Combinations of Slopes and Intercepts


The fixed
effects
model
Constant slopes
Varying intercepts

Unlikely to
occur

Varying slopes
Constant intercept

Separate
regression for
each individual
Varying slopes
Varying intercepts

The assumptions
required for this
model are
unlikely to hold

Constant slopes
Constant intercept14

Constructing the fixed-effects model eliminating unobserved heterogeneity by taking


first differences
yit 0 i 1 x1it 2 x2it
yit yit 1

Original equation
... k xkit uit

Lag one period and


0 i 1 x1it subtract
2 x2 it ... k xkit uit
0 i 1 x1it 1 2 x2 it 1 ... k xkit 1 uit 1

Constant and individual effects eliminate

yit yit 1 1 x1it 1 x1it 1 2 x2 it x2it 1 ...


k xkit xkit 1 uit uit 1

yit 1x1it 2 x2 it

Transformed equation
... k xkit uit
15

An Alternative to First-Differences:
Deviations from Individual Means

yit 1x1it 2 x2it ... k xkit uit


Applying least squares gives the first-difference
estimator it works when there are two time periods.
More general way of sweeping out fixed effects
when there are more than two time periods - take
deviations from individual means.
Let x1i. be the mean for variable x1 for individual i,
averaged across all time periods. Calculate means for
each variable (including y) and then subtract the
means gives:

yit yi. 0 0 i i. 1 x1it x1i. ... k xkit xki. uit

16
The constant and individual effects are also eliminated by this transformation

Estimating the Fixed Effects


Model
Take deviations from individual means
and apply least squares fixed effects,
LSDV or within estimator

yit yi. 1 x1it x1i. ... k xkit xki. uit

It is called the within estimator because it relies on


variations within individuals rather than between individu
Not surprisingly, there is another estimator that uses only
information on individual means. This is known as the be
estimator. The Random Effects model is a combination of
Fixed Effects (within) estimator and the between estim
17

Three ways to estimate


yit ' xit it

yit yi. ' xit xi. it i.


yi. ' xi. i.

overall
within
between

The overall estimator is a weighted average of the within and between estimators. It will only be efficient if these weights are correct.
The random effects estimator uses the correct weights.

18

The Random Effects Model


Original equation

yit 0 1 x1it 2 x2it ... k xkit it


yit 0 1 x1it 2 x2it ... k xkit i uit
Remember

it i uit

i now part of error term

This approach might be appropriate if observations


are representative of a sample rather than the whole
population. This seems appealing.
19

The Variance Structure in Random


Effects
In random effects, we assume the i are part of the
composite error term it. To construct an efficient estimator
we have to evaluate the structure of the error and then apply
an appropriate generalised least squares estimator to find
an efficient estimator. The assumptions must hold if the
estimator is to be efficient. These are:

E (uit ) E (i ) 0;

E (uit2 ) u2 ;

E (i2 ) 2 ;

E (uit i ) 0 for all i, t

E ( it2 ) u2 2 t s; E ( it is ) 2 , t s;
and
E ( xkit i ) 0 for all k , t , i
This is a crucial assumption for the RE model.
It is necessary for the consistency of the RE model,
but not for FE. It can be tested with the Hausman test.

20

The Variance Structure in Random


Effects

Derive the T by T matrix that describes the variance structure of th


for individual i. Because the randomly drawn i is present each
period, there is a correlation between each pair of periods for
this individual.

i' ( i1 , i 2 ,... iT ); then E ( i i' )

u2 2

2
i2
2

2
2
2

2
2
2
u

u2 I 2 ee'
..
..
2
2
2

.. u

where e' 111.....1 is a unit vector of size T

21

Random Effects (GLS Estimation)


The Random Effects estimator has the standard
generalised least squares form summed over all
individuals in the dataset i.e.

RE =

(X X i )

i 1

'
i

-1 N

' 1
X
i yi
i 1

Where, given from the previous slide, it can be shown th

1 / 2

I T ee' where = 1 T

T 2 u2

22

Fixed Effects (GLS Estimation)

The fixed effects estimator can also be written in GLS f


which brings out its relationship to the RE estimator.
It is given by:

FE =

( X MX )

i 1

'
i

-1 T

1
X Myi where M I T ee'

T
i 1
'
i

Premultiplying a data matrix, X, by M has the effect of


constructing a new matrix, X* say, comprised of deviations
from individual means. (This is a more elegant way
mathematically to carry out the operation we described previously
The FE estimator uses M as the weighting matrix rather than .
23

Relationship between
Random and Fixed Effects

The random effects estimator is a weighted combination


within and between estimators. The between estim
formed from:

RE Between ( I K ) W ithin
depends on in such a way that if 1 then the
RE and FE estimators coincide. This occurs when the variabili ty of
the individual effects is large relative to the random errors.
0 correspond s to OLS (because the individual effects are small
relative to the random error).
24

Random or Fixed Effects?

For random effects:


Random effects are efficient
Why should we assume one set of unobservables fixed
and the other random?
Sample information more common than that from the
entire population?
Can deal with regressors that are fixed across individuals

Against random effects:


Likely to be correlation between the unobserved effects an
the explanatory variables. These are assumed to be zero i
the random effects model, but in many cases we might ex
them to be non-zero. This implies inconsistency due to
omitted-variables in the RE model. In this situation, fixed
25
effects is inefficient, but still consistent.

Why use Fixed Effects


Fixed Effects are generally used when there
is a correlation between the individual
intercept and the independent variables.
Generally used when n is relatively small
and t is relatively large.

26

Fixed Effects or Random Effects


IF N is large and T is small, and if the
assumptions underlying RE hold, the RE are
more efficient estimators.
Use Fixed Effects if the errors and the
observations are correlated (e.g. countries).
The Hausman test is distributed Chi-Squared
Asymptotic around the null hypothesis that
Random Effects is appropriate.
27

The Hausman Test


Test of whether the Fixed Effects or Random Effects
Model is appropriate
Specifically, test H0: E(i|xit) = 0 for the one-way model
If there is no correlation between regressors and
effects, then
FE
and RE are
consistent,
FE is inefficient.
and itsbut
Calculate
both

covariance
RE

FE

If there is correlation, FE is consistent and RE is


inconsistent.
Under the null hypothesis of no correlation, there

28

The Hausman Test


A test for the independence of the i and the xkit.

The covariance of an efficient estimator with its difference


an inefficient estimator should be zero. Thus, under the nu
hypothesis we test:

W = ( RE

1
2

FE )' ( RE FE ) ~ (k )

If W is significant, we should not use the random effects


estimator.
Can also test for the significance of the individual effects
(Greene P562)
29

Dynamic Panel Models


yit 0 1 x1it yit 1 i uit
Example - unemployment spell
depends on
Observed regressor (e.g. x - education)
Unobserved effect (e.g. l willingness
to work)
Lagged effect (e.g. g - scarring effect
of previous unemployment)
30

You might also like