54
Part 5: Random Effects [ 1 /54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Embed Size (px)

Citation preview

Page 1: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 1/54]

Econometric Analysis of Panel Data

William Greene

Department of Economics

Stern School of Business

Page 2: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 2/54]

The Random Effects Model The random effects model

ci is uncorrelated with xit for all t; E[ci |Xi] = 0

E[εit|Xi,ci]=0

it it i it

i i i i i

i i i i i i i

Ni=1 i

1 2 N

y = +c+ε , observation for person i at time t

= +c + , T observations in group i

= + + , note (c ,c ,...,c )

= + + , T observations in the sample

c=( , ,... ) ,

x β

y Xβ i ε

Xβ c ε c

y Xβ c ε

c c c Ni=1 iT by 1 vector

Page 3: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 3/54]

Random vs. Fixed Effects Random Effects

Small number of parameters Efficient estimation Objectionable orthogonality assumption (ci Xi)

Fixed Effects Robust – generally consistent Large number of parameters More reasonable assumption Precludes time invariant regressors

Which is the more reasonable model?

Page 4: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 4/54]

Error Components Model

Generalized Regression Model

it it i

it i

2 2it i

i i

2 2i i u

i i i i

y +ε +u

E[ε | ] 0

E[ε | ] σ

E[u | ] 0

E[u | ] σ

= + +u for T observations

it

i

x b

X

X

X

X

y Xβ ε i

2 2 2 2u u u

2 2 2 2u u u

i i

2 2 2 2u u u

Var[ +u ]ε i

Page 5: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 5/54]

Notation

1 1 1

2 2 2

N N N

i

u T observations

u T observations

u T observations

= + + T observations

= +

1 1 1

2 2 2

N N N

Ni=1

y X ε i

y X ε iβ

y X ε i

Xβ ε u

Xβ w

In all that fo

i

it

it

llows, except where explicitly noted, X, X

and x contain a constant term as the first element.

To avoid notational clutter, in those cases, x etc. will

simply denote the counterpart without the constant term.

Use of the symbol K for the number of variables will thus

be context specific but will usually include the constant term.

Page 6: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 6/54]

Notation

2 2 2 2u u u

2 2 2 2u u u

i i

2 2 2 2u u u

2 2u i i

2 2u

i

1

2

N

Var[ +u ]

= T T

=

=

Var[ | ]

i

i

T

T

ε i

I ii

I ii

Ω

Ω 0 0

0 Ω 0w X

0 0 Ω

2 2u N

i

(Note these differ only

in the dimension T ) TI ii I

Page 7: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 7/54]

Regression Model-Orthogonality

iN Ni 1 i i 1 i

i i iNi 1 i i i

ii i i i N

i i i 1 i

1plim

#observations1 1

plim plim ( +u )T T

1plim T + Tu

T T T

Tplim f + f u , 0 < f < 1

T T T

pli

N Ni=1 i i i=1 i i

N Ni i i ii=1 i=1

N Ni i i ii=1 i=1

X'w 0

X w X ε i 0

Xε Xi

Xε Xi

i i i i i

i

1m f + f u = if T T i

T NN Ni ii=1 i=1

Xεx 0

Page 8: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 8/54]

Convergence of Moments

Ni 1 iN

i 1 i

Ni 1 iN

i 1 i

N Ni 1 i u i 1 i

i

f a weighted sum of individual moment matricesT T

f a weighted sum of individual moment matricesT T

= ffT

Note asymptoti

i i

i i i

2 2ii ii i

X XXX

XΩXXΩX

X Xx x

i

i

i

cs are with respect to N. Each matrix is the T

moments for the T observations. Should be 'well behaved' in micro

level data. The average of N such matrices should be likewise.

T or T is assum

ii iX X

ed to be fixed (and small).

Page 9: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 9/54]

Ordinary Least Squares Standard results for OLS in a GR model

Consistent Unbiased Inefficient

True Variance

1 1

N N N Ni 1 i i 1 i i 1 i i 1 i

Var[ | ]T T T T

as N with our convergence assumptions

-1 -1

1 XX XΩX XXb X

0 Q Q* Q

0

Page 10: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 10/54]

Estimating the Variance for OLS

1 1

N N N Ni 1 i i 1 i i 1 i i 1 i

Ni 1 iN

i 1 i

Ni 1 iN

i 1 i

Var[ | ]T T T T

f , where = =E[ | ]T T

In the spirit of the White estimator, use

ˆ ˆˆf ,

T T

i i ii i i i

i i i ii

1 XX XΩX XXb X

XΩXXΩXΩ w w X

X w w XXΩXw =

Hypothesis tests are then based on Wald statistics.

i iy - Xb

THIS IS THE 'CLUSTER' ESTIMATOR

Page 11: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 11/54]

Mechanics

1 1Ni 1

i

i

ˆ ˆEst.Var[ | ]

ˆ = set of T OLS residuals for individual i.

= TxK data on exogenous variable for individual i.

ˆ = K x 1 vector of products

ˆ ˆ( )( )

i i i i

i

i

i i

i i i i

b X XX X w w X XX

w

X

X w

X w w X

Ni 1

KxK matrix (rank 1, outer product)

ˆ ˆ = sum of N rank 1 matrices. Rank K.i i i iX w w X

Page 12: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 12/54]

Cornwell and Rupert Data

Cornwell and Rupert Returns to Schooling Data, 595 Individuals, 7 YearsVariables in the file are

EXP = work experience, EXPSQ = EXP2

WKS = weeks workedOCC = occupation, 1 if blue collar, IND = 1 if manufacturing industrySOUTH = 1 if resides in southSMSA = 1 if resides in a city (SMSA)MS = 1 if marriedFEM = 1 if femaleUNION = 1 if wage set by unioin contractED = years of educationLWAGE = log of wage = dependent variable in regressions

These data were analyzed in Cornwell, C. and Rupert, P., "Efficient Estimation with Panel Data: An Empirical Comparison of Instrumental Variable Estimators," Journal of Applied Econometrics, 3, 1988, pp. 149-155.  See Baltagi, page 122 for further analysis.  The data were downloaded from the website for Baltagi's text.

Page 13: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 13/54]

Alternative OLS Variance Estimators+---------+--------------+----------------+--------+---------+|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] |+---------+--------------+----------------+--------+---------+ Constant 5.40159723 .04838934 111.628 .0000 EXP .04084968 .00218534 18.693 .0000 EXPSQ -.00068788 .480428D-04 -14.318 .0000 OCC -.13830480 .01480107 -9.344 .0000 SMSA .14856267 .01206772 12.311 .0000 MS .06798358 .02074599 3.277 .0010 FEM -.40020215 .02526118 -15.843 .0000 UNION .09409925 .01253203 7.509 .0000 ED .05812166 .00260039 22.351 .0000Robust Constant 5.40159723 .10156038 53.186 .0000 EXP .04084968 .00432272 9.450 .0000 EXPSQ -.00068788 .983981D-04 -6.991 .0000 OCC -.13830480 .02772631 -4.988 .0000 SMSA .14856267 .02423668 6.130 .0000 MS .06798358 .04382220 1.551 .1208 FEM -.40020215 .04961926 -8.065 .0000 UNION .09409925 .02422669 3.884 .0001 ED .05812166 .00555697 10.459 .0000

Page 14: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 14/54]

Generalized Least Squares

i

1

N 1 Ni 1 i 1

2u

T2 2 2i u

i

ˆ=[ ] [ ]

=[ ] [ ]

1I

T

(note, depends on i only through T)

-1 -1

-1 -1i i i i i i

-1i

β XΩ X XΩ y

XΩ X XΩ y

Ω ii

Page 15: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 15/54]

Panel Data Algebra (1)

2 2ε u i i

2 2 2 2ε u ε

2 2ε ε

= σ +σ , depends on 'i' because it is T T

= σ [ ], = σ / σ

= σ [ ] = σ [ ], = , = .

Using (A-66) in Greene (p. 964)

1 1σ 1+

=

i

2i

2i

-1 -1 -1 -1i -1

Ω I ii

Ω I + ii

Ω I + ii A bb A I b i

Ω A - A bbAbA b

22 u

2 2 2 2 2ε i ε ε i u

σ1 1 1=

σ 1+T σ σ +TσI - ii I - ii

Page 16: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 16/54]

Panel Data Algebra (2)

2 2 2 2 2 2ε u ε i u ε i u

2 2ε i u

2 2 2 2 2ε i u i ε ε i u

2 2ε i u

(Based on Wooldridge p. 286)

σ +σ σ +Tσ σ +Tσ

σ +Tσ ( )

(σ +Tσ )[ ( )], = σ /(σ +Tσ )

(σ +Tσ )[ ]

-1 ii D

iD

i iD D

i iD D

Ω I ii I i(i i) i I P

I I M

P I P

P M2

i u

1i

1/ 2i i i i

i

a ai

+Tσ )

(1/ ) (Prove by multiplying. .)

1 (1/ ) , =1-

1

(Note )

i

i i i ii D D D D

i i ii D D D

i ii D D

S

S P M P M 0

S P M I P

S P M

Page 17: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 17/54]

Panel Data Algebra (3)

1/ 2i2 2

i u

i2 2ii u

2

i 2 2 2 2i u i u

1/ 2i

1/ 2 2i i

1/ 2i i i i

1 (1/ ) )

T

1 1 ,

1T

=1- 1T T

1 [ ]

Var[ ( u )]

(1/ )( y. ) for the GLS transf

i ii D D

iD

ii D

i

i

Ω (P M

I P

Ω I P

Ω ε i I

Ω y y i ormation.

Page 18: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 18/54]

GLS (cont.)

it it i i it it i i

i 2 2i u

2

GLS is equivalent to OLS regression of

y * y y. on * .,

where 1T

ˆAsy.Var[ ] [ ] [ ]

-1 -1 -1

x x x

β XΩ X X * X*

Page 19: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 19/54]

Estimators for the Variances

i

it it i

OLS

TN 22 2i 1 t 1 it

UNi 1 i

i LSDV

Ni 1

y u

Using the OLS estimator of , ,

(y a ) estimates

T -1-K

With the LSDV estimates, a and ,

it

it

x β

β b

- - x b

b

i

i i

T 22t 1 it

Ni 1 i

T TN 2 N 22i 1 t 1 it i 1 t 1 itUN N

i 1 i i 1 i

(y a )estimates

T -N-K

Using the difference of the two,

(y a ) (y a ) estimates

T -1-K T -N-K

i it

it i it

- - x b

- - x b - - x b

Page 20: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 20/54]

Feasible GLS

i

2 2u

TN 22 i 1 t 1 it i it LSDV

Ni 1 i

2 2u

Feasible GLS requires (only) consistent estimators of and .

Candidates:

(y a )From the robust LSDV estimator: ˆ

T K N

From the pooled OLS estimator: Est( )

x b

i

i i

TN 2i 1 t 1 it OLS it OLS

Ni 1 i

N 22 2 i 1 it i MEANS

u

T 1 TN2 2 i 1 t 1 s t 1 it is

it is i u u

(y a )T K 1

(y a )From the group means regression: Est( / T )

N K 1ˆ ˆw w

(Wooldridge) Based on E[w w | ] if t s, ˆ

x b

xb

X Ni 1 iT K N

There are many others.

x´ does not contain a constant term in the preceding.

Page 21: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 21/54]

Practical Problems with FGLS

2u The preceding regularly produce negative estimates of .

Estimation is made very complicated in unbalanced panels.

A bulletproof solution (originally used in TSP, now NLOGIT and others).

From the r

i

i

i

TN 22 i 1 t 1 it i it LSDV

Ni 1 i

TN 22 2 2i 1 t 1 it OLS it OLS

u Ni 1 i

TN 2 N2 i 1 t 1 it OLS it OLS i 1u

(y a )obust LSDV estimator: ˆ

T

(y a )From the pooled OLS estimator: Est( ) ˆ

T

(y a ) ˆ

x b

x b

x b

iT 2t 1 it i it LSDV

Ni 1 i

(y a )0

T

x b

Page 22: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 22/54]

Stata Variance Estimators

iTN 22 i 1 t 1 it i it LSDV

Ni 1 i

22u

2u

(y a ) > 0 based on FE estimatesˆ

T K N

(N K)SSE(group means) ˆMax 0, 0ˆ

N A (N A)T

where A = K or if is negative,ˆ

A=trace of a matrix that somewhat rese

x b

Kmbles .

Many other adjustments exist. None guaranteed to be

positive. No optimality properties or even guaranteed consistency.

I

Page 23: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 23/54]

Computing Variance Estimators

2 2u

Using full list of variables (FEM and ED are time invariant)

OLS sum of squares = 522.2008.

Est( + ) = 522.2008 / (4165 - 9) = 0.12565.

Using full list of variables and a generalized inverse (same

as

2

2u

2u

dropping FEM and ED), LSDV sum of squares = 82.34912.

= 82.34912 / (4165 - 8-595) = 0.023119.ˆ

0.12565 - 0.023119 = 0.10253ˆ

Both estimators are positive. We can stop here. If were ˆ

negative, we would use estimators without DF corrections.

Page 24: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 24/54]

Application

+--------------------------------------------------+| Random Effects Model: v(i,t) = e(i,t) + u(i) || Estimates: Var[e] = .231188D-01 || Var[u] = .102531D+00 || Corr[v(i,t),v(i,s)] = .816006 || (High (low) values of H favor FEM (REM).) || Sum of Squares .141124D+04 || R-squared -.591198D+00 |+--------------------------------------------------++---------+--------------+----------------+--------+---------+----------+|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|+---------+--------------+----------------+--------+---------+----------+ EXP .08819204 .00224823 39.227 .0000 19.8537815 EXPSQ -.00076604 .496074D-04 -15.442 .0000 514.405042 OCC -.04243576 .01298466 -3.268 .0011 .51116447 SMSA -.03404260 .01620508 -2.101 .0357 .65378151 MS -.06708159 .01794516 -3.738 .0002 .81440576 FEM -.34346104 .04536453 -7.571 .0000 .11260504 UNION .05752770 .01350031 4.261 .0000 .36398559 ED .11028379 .00510008 21.624 .0000 12.8453782 Constant 4.01913257 .07724830 52.029 .0000

Page 25: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 25/54]

Testing for Effects: An LM Test

i

2u

it it i it i it 2

20 u

2N 2 N 22i 1 i i 1 i i

N N T 2i 1 i i 1 t 1 it

Breusch and Pagan Lagrange Multiplier statistic

0 0y x u , u and ~ Normal ,

0 0

H : 0

( T ) (T e )LM = 1 [1]

2 T (T 1) e

22 N 2i 1 i

N T 2i 1 t 1 it

T eNT = 1 if T is constant

2(T 1) e

Page 26: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 26/54]

LM Tests+--------------------------------------------------+| Random Effects Model: v(i,t) = e(i,t) + u(i) | Unbalanced Panel| Estimates: Var[e] = .216794D+02 | #(T=1) = 1525| Var[u] = .958560D+01 | #(T=2) = 1079| Corr[v(i,t),v(i,s)] = .306592 | #(T=3) = 825| Lagrange Multiplier Test vs. Model (3) = 4419.33 | #(T=4) = 926| ( 1 df, prob value = .000000) | #(T=5) = 1051| (High values of LM favor FEM/REM over CR model.) | #(T=6) = 1200| Baltagi-Li form of LM Statistic = 1618.75 | #(T=7) = 887+--------------------------------------------------++--------------------------------------------------+| Random Effects Model: v(i,t) = e(i,t) + u(i) || Estimates: Var[e] = .210257D+02 | Balanced Panel| Var[u] = .860646D+01 | T = 7| Corr[v(i,t),v(i,s)] = .290444 || Lagrange Multiplier Test vs. Model (3) = 1561.57 || ( 1 df, prob value = .000000) || (High values of LM favor FEM/REM over CR model.) || Baltagi-Li form of LM Statistic = 1561.57 |+--------------------------------------------------+

REGRESS ; Lhs=docvis ; Rhs=one,hhninc,age,female,educ ; panel $

Page 27: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 27/54]

Testing for Effects: Moments

N T-1 Tdi=1 t=1 s=t+1 it is

2N T-1 Ti=1 t=1 s=t+1 it is

Wooldridge (page 265) suggests based on the off diagonal elements

e eZ= N[0,1]

e e

which converges to standard normal. ("We are not assuming any

particular it

2

distribution for the . Instead, we derive a similar test that

has the advantage of being valid for any distribution...") It's convenient

to examine Z which, by the Slutsky theorem converges (also) to chi-

squared with one degree of freedom.

Page 28: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 28/54]

Testing (2)

T-1 Tt=1 s=t+1 it is

T-1 Tt=1 s=t+1 it is

e e = 1/2 of the sum of all off diagonal elements of

of or 1/2 the sum of all the elements minus the diagonal elements.

e e =1/2[ ( ) ]. But, i i

i i i i

ee

i ee i ee i e

i

T-1 T 2t=1 s=t+1 it is i

2N 2 N 2i 1 i2 i 1N 2 2 N 2 2i 1 i i 1 i

N2i 1 i

i iN 2ri 1 i

= T e. So,

e e = (1/2)[(T e ) ]

[(T e ) ] [ ]2(T 1)Z LM

NT[(T e ) ] [(T e ) ]

Note, also

r N rZ= ,where r (T e )

sr

i

i i

i i i i

i i i i

ee

ee eeee ee

e .i ie

Page 29: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 29/54]

Testing for Effects

? Obtain OLS residualsRegress; lhs=lwage;rhs=fixedx,varyingx;res=e$? Vector of group sums of residualsCalc ; T = 7 ; Groups = 595Matrix ; tebar=T*gxbr(e,person)$? Direct computation of LM statisticCalc ; list;lm=Groups*T/(2*(T-1))* (tebar'tebar/sumsqdev - 1)^2$? Wooldridge chi squared (N(0,1) squared)Create ; e2=e*e$Matrix ; e2i=T*gxbr(e2,person)$Matrix ; ri=dirp(tebar,tebar)-e2i ; sumri=ri'1$Calc ; list;z2=(sumri)^2/ri'ri$ LM = .37970675705025540D+04 Z2 = .16533465085356830D+03

Page 30: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 30/54]

Two Way Random Effects Model

it it i t it

2

2 2 2u v

y u v

How to estimate the variance components?

(1) Two way FEM residual variance estimates

(2) Simple OLS residual variance estimates

(3) There are numerous ways to get a thi

x

2 2v

rd equation.

E.g., the one way FEM residual variance in either dimension

One way FEM based on groups estimates ( ) / (1 1 / T)

E.g., the group mean regressions in either dimension.

B 2 2 2u vased on group means estimates ( )/T

(Period means regression may have a tiny number of observations.)

(And a whole library of others - see Baltagi, sec. 3.3.)

Negative estimators of common variances are common.

Solutions are complicated.

Page 31: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 31/54]

One Way REM

Page 32: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 32/54]

Two Way REM

Note sum = .102705

Page 33: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 33/54]

Hausman Test for FE vs. RE

Estimator Random EffectsE[ci|Xi] = 0

Fixed EffectsE[ci|Xi] ≠ 0

FGLS (Random Effects)

Consistent and Efficient

Inconsistent

LSDV(Fixed Effects)

ConsistentInefficient

ConsistentPossibly Efficient

Page 34: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 34/54]

Hausman Test for Effects

-1

d

ˆ ˆBasis for the test,

ˆ ˆˆ ˆ ˆ ˆWald Criterion: = ; W = [Var( )]

A lemma (Hausman (1978)): Under the null hypothesis (RE)

ˆ nT[ ] N[ , ] (efficient)

ˆ nT[

FE RE

FE RE

RE RE

FE

β - β

q β - β q q q

β - β 0 V

β d] N[ , ] (inefficient)

ˆ ˆˆNote: = ( )-( ). The lemma states that in the

ˆ ˆjoint limiting distribution of nT[ ] and nT , the

limiting covariance, is . But, =

FE

FE RE

RE

Q,RE Q,RE FE,R

- β 0 V

q β - β β β

β - β q

C 0 C C - . Then,

Var[ ] = + - - . Using the lemma, = .

It follows that Var[ ]= - . Based on the preceding

ˆ ˆ ˆ ˆ ˆ ˆH=( ) [Est.Var( ) - Est.Var( )] (

E RE

FE RE FE,RE FE,RE FE,RE RE

FE RE

-1FE RE FE RE FE RE

V

q V V C C C V

q V V

β - β β β β - β )

β does not contain the constant term in the preceding.

Page 35: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 35/54]

Computing the Hausman Statistic1

2 Ni 1 i

i

-12

2 N i uii 1 i i 2 2

i i u

2 2u

1ˆEst.Var[ ] IˆT

Tˆ ˆˆEst.Var[ ] I , 0 = 1ˆˆT Tˆ ˆ

ˆAs long as and are consistent, as N , Est.Var[ˆ ˆ

FE i

RE i

F

β X ii X

β X ii X

β

2

ˆ] Est.Var[ ]

will be nonnegative definite. In a finite sample, to ensure this, both must

be computed using the same estimate of . The one based on LSDV willˆ

generally be the better choice.

Note

E REβ

ˆthat columns of zeros will appear in Est.Var[ ] if there are time

invariant variables in .FEβ

X

β does not contain the constant term in the preceding.

Page 36: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 36/54]

Page 37: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 37/54]

Page 38: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 38/54]

Hausman Test?

What went wrong?

The matrix is not positive definite.It has a negative characteristic root.The matrix is indefinite.(Software such as Stata and NLOGIT find this problem and refuse to proceed.)

Properly, the statistic cannot be computed.

The naïve calculation came out positive by the luck of the draw.

Page 39: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 39/54]

A Variable Addition Test Asymptotically equivalent to Hausman Also equivalent to Mundlak formulation In the random effects model, using FGLS

Only applies to time varying variables Add expanded group means to the regression

(i.e., observation i,t gets same group means for all t.

Use standard F or Wald test to test for coefficients on means equal to 0. Large F or chi-squared weighs against random effects specification.

Page 40: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 40/54]

Variable Addition

it i it it

it i it i

it it i

A Fixed Effects Model

y

LSDV estimator - Deviations from group means:

To estimate , regress (y y ) on ( )

Algebraic equivalent: OLS regress y on ( )

Mundlak interpretation:

x

x x

x , x

i i i

it i i it it

i it it i

u

Model becomes y u

= u

a random effects model with the group means.

Estimate by FGLS.

x

x x

x x

Page 41: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 41/54]

Application: Wu Test

NAMELIST ; XV = exp,expsq,wks,occ,ind,south,smsa,ms,union,ed,fem$create ; expb=groupmean(exp,pds=7)$create ; expsqb=groupmean(expsq,pds=7)$create ; wksb=groupmean(wks,pds=7)$create ; occb=groupmean(occ,pds=7)$create ; indb=groupmean(ind,pds=7)$create ; southb=groupmean(south,pds=7)$create ; smsab=groupmean(smsa,pds=7)$create ; unionb=groupmean(union,pds=7)$create ; msb = groupmean(ms,pds=7) $namelist ; xmeans = expb,expsqb,wksb,occb,indb,southb,smsab,msb, unionb $REGRESS ; Lhs = lwage ; Rhs = xmeans,Xv,one ; panel ; random $ MATRIX ; bmean = b(1:9) ; vmean = varb(1:9,1:9) $MATRIX ; List ; Wu = bmean'<vmean>bmean $

Page 42: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 42/54]

Means Added

Page 43: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 43/54]

Wu (Variable Addition) Test

Page 44: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 44/54]

Basing Wu Test on a Robust VC

? Robust Covariance matrix for REMNamelist ; XWU = wks,occ,ind,south,smsa,union,exp,expsq,ed,blk,fem, wksb,occb,indb,southb,smsab,unionb,expb,expsqb,one $Create ; ewu = lwage - xwu'b $Matrix ; Robustvc = <Xwu'Xwu>*Gmmw(xwu,ewu,_stratum)*<XwU'xWU> ; Stat(b,RobustVc,Xwu) $Matrix ; Means = b(12:19);Vmeans=RobustVC(12:19,12:19) ; List ; RobustW=Means'<Vmeans>Means $

Page 45: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 45/54]

Robust Standard Errors

Page 46: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 46/54]

Fixed vs. Random Effects-1

i,Model i,ModelN NModel i 1 i i 1 i

i i

Model

2i u

i,Model 2 2i u

i i,RE

ˆ ˆˆ I IT T

1 for fixed effects.ˆ

Tˆ for random effects.ˆ

Tˆ ˆ

As T , 1, random effects beˆ

i iβ X ii X X ii y

2u i,RE

2u i,RE

2 2u

comes fixed effects

As 0, 0, random effects becomes OLS (of course)ˆˆ

As , 1, random effects becomes fixed effectsˆˆ

For the C&R application, =.133156, =.0235231, .975384.ˆˆ ˆ

Lo

oks like a fixed effects model. Note the Hausman statistic agrees.

β does not contain the constant term in the preceding.

Page 47: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 47/54]

Another Comparison (Baltagi p. 20)

GLS LSDV(Within) Between

2u

LSDV(Within)

GLS LSDV(Within)

ˆ ˆ ˆ( )

Limiting and Special Cases

(1) If 0, GLS = OLS

ˆ(2) As T , GLS

ˆ ˆ(3) As between variation 0,

(4) As within variation

W I W

GLS Betweenˆ ˆ0,

Page 48: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 48/54]

A Hierarchical Linear ModelInterpretation of the FE Model

it it i it

2it i i it i i

i i

2i i i i u

it it i it

y c+ε , ( does not contain a constant)

E[ε | ,c ] 0,Var[ε | ,c ]=

c + + u ,

E[u| ] 0, Var[u| ]

y [ u] ε

i

i i

i

x β x

X X

z z

x β zδ

Page 49: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 49/54]

Hierarchical Linear Model as REM+--------------------------------------------------+| Random Effects Model: v(i,t) = e(i,t) + u(i) || Estimates: Var[e] = .235368D-01 || Var[u] = .110254D+00 || Corr[v(i,t),v(i,s)] = .824078 || Sigma(u) = 0.3303 |+--------------------------------------------------++--------+--------------+----------------+--------+--------+----------+|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|+--------+--------------+----------------+--------+--------+----------+ OCC | -.03908144 .01298962 -3.009 .0026 .51116447 SMSA | -.03881553 .01645862 -2.358 .0184 .65378151 MS | -.06557030 .01815465 -3.612 .0003 .81440576 EXP | .05737298 .00088467 64.852 .0000 19.8537815 FEM | -.34715010 .04681514 -7.415 .0000 .11260504 ED | .11120152 .00525209 21.173 .0000 12.8453782 Constant| 4.24669585 .07763394 54.702 .0000

Page 50: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 50/54]

Evolution: Correlated Random Effects

2it i it it 1 2 N

it

Unknown parameters

y , [ , ,..., , , ]

Standard estimation based on LS (dummy variables)

Ambiguous definition of the distribution of y

Effects model, nonorthogonality, heterogeneit

x

it i it it i i i

i i

it i it it i

y

y , E[ | ] g( ) 0

Contrast to random effects E[ | X ]

Standard estimation (still) based on LS (dummy variables)

Correlated random effects, more detailed model

y , P[ |

x X X

x i i

i i i i i

] g( ) 0

Linear projection? u Cor(u , ) 0

X X

x x

Page 51: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 51/54]

Mundlak’s Estimator

ii i i i i1 i1 iT i

i

i i i i i

i i i i

i i

Write c = u , E[c | , ,... ]

Assume c contains all time invariant information

= +c + , T observations in group i

= + + + u

Looks like random effects.

Var[ + u ]=

xδ x x x = xδ

y Xβ i ε

Xβ ixδ ε i

ε i Ω +

This is the model we used for the Wu test.

2i uσ ii

Mundlak, Y., “On the Pooling of Time Series and Cross Section Data, Econometrica, 46, 1978, pp. 69-85.

Page 52: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 52/54]

Correlated Random Effects

ii i i i i1 i1 iT i

i

i i i i i

i i i i

i i1 1 i2 2

c = u , E[c | , ,... ]

Assume c contains all time invariant information

= +c + , T observations in group i

= + + + u

c =

xδ x x x = xδ

y X

Mundlak

Chamberlain/ Wooldri

β i ε

Xβ ixδ ε i

x δ x

dg

δ

e

iT T i

i i i1 1 i1 2 iT T i i

... u

= ... u+

TxK TxK TxK TxK etc.

Problems: Requires balanced panels

Modern panels have large T; models have large K

x δ

y Xβ ix δ ix δ ix δ i ε

Page 53: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 53/54]

Mundlak’s Approach for an FE Model with Time Invariant Variables

it it i it

2it i i it i i

i i

2i i i i w

it it i it

y + c+ε , ( does not contain a constant)

E[ε | ,c ] 0,Var[ε | ,c ]=

c + + w ,

E[w| , ] 0, Var[w| , ]

y w ε

random effe

i

i

i i

i i

x β zδ x

X X

x θ

X z X z

x β zδ x θ

cts model including group means of

time varying variables.

Page 54: Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business

Part 5: Random Effects [ 54/54]

Mundlak Form of FE Model+--------+--------------+----------------+--------+--------+----------+|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|+--------+--------------+----------------+--------+--------+----------+x(i,t)================================================================= OCC | -.02021384 .01375165 -1.470 .1416 .51116447 SMSA | -.04250645 .01951727 -2.178 .0294 .65378151 MS | -.02946444 .01915264 -1.538 .1240 .81440576 EXP | .09665711 .00119262 81.046 .0000 19.8537815z(i)=================================================================== FEM | -.34322129 .05725632 -5.994 .0000 .11260504 ED | .05099781 .00575551 8.861 .0000 12.8453782Means of x(i,t) and constant=========================================== Constant| 5.72655261 .10300460 55.595 .0000 OCCB | -.10850252 .03635921 -2.984 .0028 .51116447 SMSAB | .22934020 .03282197 6.987 .0000 .65378151 MSB | .20453332 .05329948 3.837 .0001 .81440576 EXPB | -.08988632 .00165025 -54.468 .0000 19.8537815Variance Estimates===================================================== Var[e]| .0235632 Var[u]| .0773825