You are on page 1of 68

Applied Econometrics

William Greene
Department of Economics
Stern School of Business
Applied Econometrics

17. Linear Models for Panel Data


Panel Data Sets

 Longitudinal data
 National longitudinal survey of youth (NLSY)
 British household panel survey (BHPS)
 Panel Study of Income Dynamics (PSID)
 German Socioeconomic Panel (GSOEP)
 Agricultural Resource Management Survey (ARMS)
 Cross section time series
 Grunfeld’s investment data
 Penn world tables
 Financial data by firm, year
 rit – rft = i(rmt - rft) + εit, i = 1,…,many; t=1,…many
 Exchange rate data, essentially infinite T, large N
 Effects: i=  + vi
Terms of Art
 Cross sectional vs. time series variation -
(history: consumption function studies)
 Heterogeneity
 Group effects (individual effects)
 Fixed effects and/or random effects
 Substantive differences?
 Is it possible to tell them apart in observed data?
Panel Data
 Rotating panels: Spanish household survey
 Spanish income study
(http://www.cemfi.es/~albarran/0008r.pdf)
 Efficiency analysis: “Efficiency measurement in
rotating panel data,” Heshmati, A, Applied
Economics, 30, 1998, pp. 919-930
 Hierarchical (nested) data sets: Student
outcome, by year, district, school, teacher
Nested Panel Data
 Antweiler, W., Nested Random Effects…”
Journal of Econometrics, 101, 2001, 295-313

Sulfide concentration(year,country,station=t,c,s)
= β1 +β2 (logGDP/km2 )c,s,t +β 3log(K/L)c,t  4Communist c 
... + 8 log(Oil Pr ice )t  9t  c ,s ,t  v c ,s  w s
Balanced and Unbalanced Panels
 Distinction
 A notation to help with mechanics
zi,t, i = 1,…,N; t = 1,…,Ti
 The role of the assumption
 Mathematical and notational convenience:
 Balanced, NT
Unbalanced: i=1 Ti
N

 Is the fixed Ti assumption ever necessary? SUR


models.
Benefits of Panel Data
 Time and individual variation in behavior
unobservable in cross sections or aggregate
time series
 Observable and unobservable individual
heterogeneity
 Rich hierarchical structures
 Dynamics in economic behavior
Fixed and Random Effects
 Unobserved individual effects in regression: E[yit | xit, ci]
 Notation: yit =xit + ci + it

 x i1 
  x 
X i    Ti rows, K columns
i2
 
 
 x iTi 
 Linear specification:
 Fixed Effects: E[ci | Xi ] = g(Xi); effects are correlated with
included variables. Common: Cov[xit,ci] ≠0
 Random Effects: E[ci | Xi ] = μ; effects are uncorrelated with
included variables. If Xi contains a constant term, μ=0 WLOG.
Common: Cov[xit,ci] =0, but E[ci | Xi ] = μ is needed for the
full model
Convenient Notation
 Fixed Effects

yit = i + xit + it


Individual specific constant terms.

 Random Effects

yit = xit + it + ui


Compound (“composed”) disturbance; “error components”
Assumptions for Asymptotics
 Convergence of moments involving cross section Xi.
 N increasing, T or Ti assumed fixed.
 “Fixed T asymptotics” (see text, p. 196)
 Time series characteristics are not relevant (may be
nonstationary)
 If T is also growing, need to treat as multivariate time series.
 Ranks of matrices. X must have full column rank. (Xi
may not, if Ti < K.)
 Strict exogeneity and dynamics. If xit contains yi,t-1 then
xit cannot be strictly exogenous. Xit will be correlated
with the unobservables in period t-1. (To be revisited
later.)
 Empirical characteristics of microeconomic data
The Pooled Regression
 Presence of omitted effects
y it =x itβ+c i +εit , observation for person i at time t
y i =X iβ+c ii+ε i , Ti observations in group i
=X iβ+c i +ε i , note c i  (c i , c i ,...,c i )
y =Xβ+c +ε , Ni=1 Ti observations in the sample

 Potential bias/inconsistency of OLS – depends


on ‘fixed’ or ‘random’
Cornwell and Rupert Data
Cornwell and Rupert Returns to Schooling Data, 595 Individuals, 7 Years
Variables in the file are
EXP = work experience
WKS = weeks worked
OCC = occupation, 1 if blue collar,
IND = 1 if manufacturing industry
SOUTH = 1 if resides in south
SMSA = 1 if resides in a city (SMSA)
MS = 1 if married
FEM = 1 if female
UNION = 1 if wage set by unioin contract
ED = years of education
BLK = 1 if individual is black
LWAGE = 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.
Application: Cornell and Rupert
Using First Differences

yit =xitβ+ci +εit , observation for person i at time t

Eliminating the heterogeneity


y it = y it -y i,t-1 = (x it )β+c i + εit
= (x it )β + uit

Note: Time invariant variables become zero


Time trend becomes the constant term
Time dummy variables become (1,0,0...)
OLS with First Differences
With strict exogeneity of (Xi,ci), OLS regression of Δyit
on Δxit is unbiased and consistent but inefficient.

 i,2  i,1  22 2 0 0 


   2 
 i,3  i,2    22 2  (Toeplitz form)
Var   0 2 2
   
 i,T  i,T 1   0 2 22 
 i i 

GLS is unpleasantly complicated. In order to


compute a first step estimator of σε2 we would use
fixed effects. We should just stop there. Or, use OLS
in first differences and use Newey-West with one lag.
Two Periods
With two periods and strict exogeneity,
y it = y i2 -y i,1 = 0 + (x i2 -x i1 )β + ui
Consider a "treatment" that takes place between
time 1 and time 2 for some of the individuals
y i = 0 + (x i )β + Ti + ui
Ti = the "treatment dummy"

This is a classical regression model. If there are no regressors,


ˆ
1  y | treatment - y | control
= "difference in differences" estimator.
ˆ
0  Average change in y i for the "treated"
Application of a Two Period Model
 “Hemoglobin and Quality of Life in Cancer
Patients with Anemia,”
 Finkelstein (MIT), Berndt (MIT), Greene (NYU),
Cremieux (Univ. of Quebec)
 1998
 With Ortho Biotech – seeking to change labeling
of already approved drug ‘erythropoetin.’
r-HuEPO
QOL Study
 Quality of life study
 i = 1,… 1200+ clinically anemic cancer patients undergoing
chemotherapy, treated with transfusions and/or r-HuEPO
 t = 0 at baseline, 1 at exit. (interperiod survey by some patients was
not used)
 yit = self administered quality of life survey, scale = 0,…,100
 xit = hemoglobin level, other covariates
 Treatment effects model (hemoglobin level)
 Background – r-HuEPO treatment to affect Hg level
 Important statistical issues
 Unobservable individual effects
 The placebo effect
 Attrition – sample selection
 FDA mistrust of “community based” – not clinical trial based statistical
evidence
 Objective – when to administer treatment for maximum marginal
benefit
Regression-Treatment Effects Model

QOL it   t + "other covariates"


+ 7Hbit7 + 8Hbit8 + 9Hbit9 + ... 15Hb15
it

+ c i + εit
Hbit  hemoglobin level, grams/deciliter, range 3+ to 15
Hbit7  1(3  Hbit < 7.5) (Base case; 7 = 0)
Hbit8  1(7.5  Hbit < 8.5)

Hb15
it  1(14.5  Hbit  15)
Effects and Covariates
 Individual effects that would impact a self reported
QOL: Depression, comorbidity factors (smoking), recent
financial setback, recent loss of spouse, etc.
 Covariates
 Change in tumor status
 Measured progressivity of disease
 Change in number of transfusions
 Presence of pain and nausea
 Change in number of chemotherapy cycles
 Change in radiotherapy types
 Elapsed days since chemotherapy treatment
 Amount of time between baseline and exit
First Differences Model
QOL i  QOL i1  QOL i0
= (1   0 )  15 
j 8 j (Hb j
i1  Hb j
i0 )   K
k 1k (x ik ,1  x ik ,0 )  i1  i0

Regression to the mean (the "tendency to mediocrity")


i0  i1  ui  (QOL i0  QOL 0 ) Expect 0   < 1
implies
 = 1  0  QOL 0

QOL i  QOL i1  QOL i0


=   15 
j 8 j (Hb j
i1  Hb j
i0 )   K
k 1k (x ik ,1  x ik ,0 )  QOL i0 + ui
Dealing with Attrition
 The attrition issue: Appearance for the second interview
was low for people with initial low QOL (death or
depression) or with initial high QOL (don’t need the
treatment). Thus, missing data at exit were clearly
related to values of the dependent variable.
 Solutions to the attrition problem
 Heckman selection model (used in the study)
 Prob[Present at exit|covariates] = Φ(z’θ) (Probit model)
 Additional variable added to difference model i = Φ(zi’θ)/Φ(zi’θ)
 The FDA solution: fill with zeros. (!)
Estimation with Fixed Effects
 The fixed effects model
y it =x itβ+c i +εit , observation for person i at time t
y i =X iβ+c ii+ε i , Ti observations in group i
=X iβ+c i +ε i , note c i  (c i , c i ,...,c i )
y =Xβ+c +ε , Ni=1 Ti observations in the sample
c=(c1 , c2 ,...cN ), Ni=1 Ti by 1 vector

 ci is arbitrarily correlated with xit but E[εit|Xi,ci]=0


 Dummy variable representation
yit =xitβ+Nj=1 jdijt +εit , dijt = 1(i=j)
Assumptions for the FE Model

yi = Xi + diαi + εi, for each individual


 y1   X1 d1 0 0 0
  X
 y2    2 0 d2 0 0   β 
ε
     α 
   
 yN   X N 0 0 0 dN 
β
= [X, D]    ε
 α
= Zδ  ε
E[ci | Xi ] = g(Xi);
Effects are correlated with included variables.
Common: Cov[xit,ci] ≠0
Useful Analysis of Variance Notation

Decomposition of Total variation:


2
N
Σ Σ Ti 2
(zit  z)  Σ N
Σ Ti 2
(zit  z.)   Σ Ti  z.i  z 
N
i=1 t=1 i=1  t=1 i  i=1 
Total variation = Within groups variation
+ Between groups variation
WHO Data
Baltagi and Griffin’s Gasoline Data
World Gasoline Demand Data, 18 OECD Countries, 19 years
Variables in the file are

COUNTRY = name of country


YEAR = year, 1960-1978
LGASPCAR = log of consumption per car
LINCOMEP = log of per capita income
LRPMG = log of real price of gasoline
LCARPCAP = log of per capita number of cars

See Baltagi (2001, p. 24) for analysis of these data. The article on which the
analysis is based is Baltagi, B. and Griffin, J., "Gasolne Demand in the OECD: An
Application of Pooling and Testing Procedures," European Economic Review, 22,
1983, pp. 117-137. The data were downloaded from the website for Baltagi's
text.
Analysis of Variance
Analysis of Variance
+--------------------------------------------------------------------------+
| Analysis of Variance for LGASPCAR |
| Stratification Variable _STRATUM |
| Observations weighted by ONE |
| Total Sample Size 342 |
| Number of Groups 18 |
| Number of groups with no data 0 |
| Overall Sample Mean 4.2962420 |
| Sample Standard Deviation .5489071 |
| Total Sample Variance .3012990 |
| |
| Source of Variation Variation Deg.Fr. Mean Square |
| Between Groups 85.68228007 17 5.04013 |
| Within Groups 17.06068428 324 .05266 |
| Total 102.74296435 341 .30130 |
| Residual S.D. .22946990 |
| R-squared .83394791 MSB/MSW 21.96425 |
| F ratio 95.71734806 P value .00000 |
+--------------------------------------------------------------------------+
Estimating the Fixed Effects Model
 The FEM is a linear regression model but with
many independent variables
 Least squares is unbiased, consistent, efficient,
but inconvenient if N is large.
1
 b   X X X D   X y 
     Dy 
a
   D X D D   
Using the Frisch-Waugh theorem
b =[X MD X ]1 X MD y 
Fixed Effects Estimator (cont.)

M1D 0 0 
 2 
0 M 0
MD   D  (The dummy variables are orthogonal)
 
 N
 0 0 MD 
MDi  I Ti  di (didi ) 1 d = I Ti  (1/Ti )did
X MD X = Ni=1 X iMDi X i ,  
X iMDi X i
k,l
T
  t=1
i
(x it,k -x i.,k )(x it,l -x i.,l )

X MD y = Ni=1 X iMDi y i , XM y 


i
i
D i k
i
T
  t=1 (x it,k -x i.,k )(y it -y i. )
The Within Transformation
Removes the Effects

y it  x itβ  c i +εit
y i  x iβ  c i +εi
y it  y i  ( x it - x i )β  (εit  εi )
y it  x itβ  εit
Classical assumptions apply to the transformed model
Least Squares Dummy Variable Estimator
 b is obtained by ‘within’ groups least squares
(group mean deviations)
 Normal equations for a are D’Xb+D’Da=D’y
a = (D’D)-1D’(y – Xb)
ai=(1/Ti )Σ Ti
t=1 (yit -xitb)=ei

Notes: This is simple algebra – the estimator is just OLS


Least squares is an estimator, not a model. (Repeat twice.)
Note what ai is when Ti = 1. Follow this with yit-ai-xit’b=0 if Ti=1.
Inference About OLS
 Assume strict exogeneity: Cov[εit,(xjs,cj)]=0. Every
disturbance in every period for each person is
uncorrelated with variables and effects for every person
and across periods.
 Now, it’s just least squares in a classical linear
regression model.
 Asy.Var[b] =(2 / Ni=1 Ti )plim[(2 / Ni=1 Ti )Ni=1 XiMDi Xi ]1
which is the usual estimator for OLS
2
Ti
Ni=1 t=1 (y it -ai -x itb)2

ˆ 

 N
i=1 Ti - N - K 
(Note the degrees of freedom correction)
Cornwell and Rupert Data
Cornwell and Rupert Returns to Schooling Data, 595 Individuals, 7 Years
Variables in the file are: (Not used in regressions)
EXP = work experience, EXPSQ = EXP2
WKS = weeks worked
OCC = occupation, 1 if blue collar,
(IND = 1 if manufacturing industry)
(SOUTH = 1 if resides in south)
SMSA = 1 if resides in a city (SMSA)
MS = 1 if married
FEM = 1 if female
UNION = 1 if wage set by unioin contract
ED = years of education
(BLK = 1 if individual is black)
LWAGE = 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.
Application Cornwell and Rupert
LSDV Results
The Effect of the Effects
The Random Effects Model
 The random effects model
y it =x itβ+c i +εit , observation for person i at time t
y i =X iβ+c ii+ε i , Ti observations in group i
=X iβ+c i +ε i , note c i  (c i , c i ,...,c i )
y =Xβ+c +ε , Ni=1 Ti observations in the sample
c=(c1 , c2 ,...cN ), Ni=1 Ti by 1 vector

 ci is uncorrelated with xit for all t;


 E[ci |Xi] = 0
 E[εit|Xi,ci]=0
Error Components Model
Generalized Regression Model

y it  x it b+εit +ui


E[εit | X i ]  0  2   u2  u2  u2 
 
 2
 2
  2
 u2
E[εit2 | X i ]  σ 2 Var[ε i +uii ]   u  u 
 
E[ui | X i ]  0  2
  u  u2     u 
2 2
E[ui2 | X i ]  σ u2
y i =X iβ+ε i +uii for Ti observations
Notation
 y1   X1   ε1   u1i1  T1 observations
y  X   ε   u i  T observations
    β   2   2 2
2 2 2
       
       
y
 N  NX  N   N N  TN observations
ε u i
= Xβ+ε+u Ni=1 Ti observations
= Xβ+w
In all that follows, except where explicitly noted, X, X i
and x it contain a constant term as the first element.
To avoid notational clutter, in those cases, x it 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.
Notation

 2   u2  u2  u2 
 
  u2  2   u2  u2 
Var[ε i +uii ] 
 
 
  u  u2  2   u2 
2

=  2I Ti   u2ii Ti  Ti
=  2I Ti   u2ii
= Ωi
Ω1 0 0 
0 Ω2 0  (Note these differ only
Var[w | X]   
  in the dimension Ti )
 
 0 0 ΩN 
Convergence of Moments

X X N X i X i
N
 i1 fi  a weighted sum of individual moment matrices
i1 T Ti
X ΩX N X iΩi X i
N
 i1 fi  a weighted sum of individual moment matrices
i1 T Ti
X i X i
=  2 Ni1fi   u2 Ni1fi x i x i
Ti
X i X i
Note asymptotics are with respect to N. Each matrix is the
Ti
moments for the Ti observations. Should be 'well behaved' in micro
level data. The average of N such matrices should be likewise.
T or Ti is assumed to be fixed (and small).
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
Ordinary Least Squares
 Standard results for OLS in a GR model
 Consistent
 Unbiased
 Inefficient
 True Variance
1 1
1  XX  X ΩX  XX 
Var[b | X]     
Ni1 Ti  Ni1 Ti  Ni1 Ti  Ni1 Ti 
 0   Q-1   Q *   Q-1
 0 as N   with our convergence assumptions
Estimating the Variance for OLS

1 1
1  X X   X ΩX   X X 
Var[b | X ]  N  N   N  
i1 Ti  i1 Ti   i1 Ti   Ni1 Ti 
X ΩX X iΩi X i
N
N
 i1 fi , where = Ωi =E[w i w i | X i ]
i1 T Ti
In the spirit of the White estimator, use
X ΩX X i w ˆ i X i
ˆ iw
N
  N
f
i1 i
ˆ i = y i - X ib
, w
i1 T Ti
Hypothesis tests are then based on Wald statistics.

THIS IS THE 'CLUSTER' ESTIMATOR


Mechanics

Est.Var[b | X]  X X 
1
  X i w
N
i1  1
ˆ i X i X X 
ˆ iw
ˆ i = set of Ti OLS residuals for individual i.
w
X i = Ti xK data on exogenous variable for individual i.
Xi w
ˆ i = K x 1 vector of products
(X i w ˆ i X i )  KxK matrix (rank 1, outer product)
ˆ i )(w
 Ni1  Xi w 
ˆ i  w
ˆ i X i  = sum of N rank 1 matrices. Rank  K.

We could compute this as Ni1 Xi  w 


ˆ i  X i = Ni1 X i Ω
ˆ iw 
ˆ X .
i i    
Why not do it that way?
OLS Results
----------------------------------------------------------------------
Ordinary least squares regression ............
LHS=LWAGE Mean = 6.67635
Residuals Sum of squares = 522.20082
Standard error of e = .35447
Fit R-squared = .41121
Model test F[ 8, 4156] (prob) = 362.8(.0000)
Panel Data Analysis of LWAGE [ONE way]
Unconditional ANOVA (No regressors)
Source Variation Deg. Free. Mean Square
Between 646.25374 594. 1.08797
Residual 240.65119 3570. .06741
Total 886.90494 4164. .21299
--------+-------------------------------------------------------------
Variable| Coefficient Standard Error b/St.Er. P[|Z|>z] Mean of X
--------+-------------------------------------------------------------
EXP| .04085*** .00219 18.693 .0000 19.8538
EXPSQ| -.00069*** .480428D-04 -14.318 .0000 514.405
OCC| -.13830*** .01480 -9.344 .0000 .51116
SMSA| .14856*** .01207 12.311 .0000 .65378
MS| .06798*** .02075 3.277 .0010 .81441
FEM| -.40020*** .02526 -15.843 .0000 .11261
UNION| .09410*** .01253 7.509 .0000 .36399
ED| .05812*** .00260 22.351 .0000 12.8454
Constant| 5.40160*** .04839 111.628 .0000
--------+-------------------------------------------------------------
Alternative 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 .0000
Robust
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
Generalized Least Squares

ˆ=[XΩ-1 X]1 [XΩ-1 y]


β
=[Ni1 XiΩi-1 X i ]1 [Ni1 XiΩi-1 y i ]
1  2

-1
Ωi  2 I Ti  2 2
ii
    Tiu 
(note, depends on i only through Ti )
GLS (cont.)

GLS is equivalent to OLS regression of


y it *  y it  i y i . on x it *  x it  i x i .,

where i  1 
2  Tiu2
ˆ]  [XΩ-1 X]-1  2 [X  * X*]-1
Asy.Var[β 
Estimators for the Variances
y it  x it β  it  ui
With a consistent estimator of β, say bOLS ,
Ni1 tTi 1 (y it - x it b)2 estimates Ni1 tTi 1 (2  U2 )
Divide by something to estimate 2 = 2  U2
With the LSDV estimates, ai and bLSDV ,
Ni1 tTi 1 (y it - ai - x itb)2 estimates Ni1 tTi 12
Divide by something to estimate 2
Estimate U2 with (2  U2 ) -  2
ˆ .
Feasible GLS

Feasible GLS requires (only) consistent estimators of 2 and u2 .


Candidates:
Ni1 tTi 1 (y it  ai  x it bLSDV )2
2
From the robust LSDV estimator: 
ˆ  
Ni1 Ti  K  N
Ni1 tTi 1 (y it  aOLS  x itbOLS )2
2 2
From the pooled OLS estimator:      u
Ni1 Ti  K  1
Ni1 (y it  a  x ibMEANS )2
2 2
From the group means regression:  / T     u
N  K 1
2 2 Ni1 tTi 11 sTi t 1 w
ˆ it w
ˆ is
(Wooldridge) Based on E[w it w is | X i ]  u if t  s, 
ˆu 
Ni1 Ti  K  N
There are many others.

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


Practical Problems with FGLS
All of the preceding regularly produce negative estimates of u2 .
Estimation is made very complicated in unbalanced panels.
A bulletproof solution (originally used in TSP, now LIMDEP and others).
2  N
 Ti
(y  a  x  b ) 2
From the robust LSDV estimator: 
ˆ   i1 t 1 it N i it LSDV

i1 Ti
Ni1 tTi 1 (y it  aOLS  x itbOLS )2
2 2 2
From the pooled OLS estimator:      u  
ˆ 
Ni1 Ti
2  N
 Ti
(y  a  x  b ) 2
  N
 Ti
(y  a  x  b ) 2

ˆ u  i1 t 1 it OLS it OLS
N
i1 t 1 it i it LSDV
0
i1 Ti

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


Fixed Effects Estimates
----------------------------------------------------------------------
Least Squares with Group Dummy Variables..........
LHS=LWAGE Mean = 6.67635
Residuals Sum of squares = 82.34912
Standard error of e = .15205
These 2 variables have no within group variation.
FEM ED
F.E. estimates are based on a generalized inverse.
--------+-------------------------------------------------------------
Variable| Coefficient Standard Error b/St.Er. P[|Z|>z] Mean of X
--------+-------------------------------------------------------------
EXP| .11346*** .00247 45.982 .0000 19.8538
EXPSQ| -.00042*** .544864D-04 -7.789 .0000 514.405
OCC| -.02106 .01373 -1.534 .1251 .51116
SMSA| -.04209** .01934 -2.177 .0295 .65378
MS| -.02915 .01897 -1.536 .1245 .81441
FEM| .000 ......(Fixed Parameter).......
UNION| .03413** .01491 2.290 .0220 .36399
ED| .000 ......(Fixed Parameter).......
--------+-------------------------------------------------------------
Computing Variance Estimators
Using full list of variables (FEM and ED are time invariant)
OLS sum of squares = 522.2008.
2 +u2 = 522.2008 / (4165 - 9) = 0.12565.
Using full list of variables and a generalized inverse (same
as dropping FEM and ED), LSDV sum of squares = 82.34912.
2 = 82.34912 / (4165 - 8-595) = 0.023119.
u2  0.12565 - 0.023119 = 0.10253
Both estimators are positive. We stop here. If u2 were
negative, we would use estimators without DF corrections.
Application
----------------------------------------------------------------------
Random Effects Model: v(i,t) = e(i,t) + u(i)
Estimates: Var[e] = .023119
Var[u] = .102531
Corr[v(i,t),v(i,s)] = .816006
Lagrange Multiplier Test vs. Model (3) =3713.07
( 1 degrees of freedom, prob. value = .000000)
(High values of LM favor FEM/REM over CR model)
Fixed vs. Random Effects (Hausman) = .00 (Cannot be computed)
( 8 degrees of freedom, prob. value = 1.000000)
(High (low) values of H favor F.E.(R.E.) model)
Sum of Squares 1411.241136
R-squared -.591198
+---------+--------------+----------------+--------+---------+----------+
|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
Testing for Effects: LM Test
Breusch and Pagan Lagrange Multiplier statistic
Assuming normality (and for convenience now, a
balanced panel)
2 2
NT   (Te )N
 2
NT   [(Te )  eiei ] 
N 2
LM= 
i1
 1 
i

i1

i
N
2(T-1)    e
i1
N

2
2(T-1) 
i1 it
N

i1eiei 
Converges to chi-squared[1] under the null hypothesis
of no common effects. (For unbalanced panels, the
scale in front becomes (Ni1 Ti )2 /[2Ni1 Ti (Ti  1)].)
Application: Cornwell-Rupert
Testing for Effects

Regress; lhs=lwage;rhs=fixedx,varyingx;res=e$
Matrix ; tebar=7*gxbr(e,person)$
Calc ; list;lm=595*7/(2*(7-1))*
(tebar'tebar/sumsqdev - 1)^2$

LM = 3797.06757
Hausman Test for FE vs. RE

Estimator Random Effects Fixed Effects


E[ci|Xi] = 0 E[ci|Xi] ≠ 0
FGLS Consistent and Inconsistent
(Random Effects) Efficient
LSDV Consistent Consistent
(Fixed Effects) Inefficient Possibly Efficient
Hausman Test for Effects
ˆ -β
Basis for the test, β ˆ
FE RE

ˆ -β
ˆ=β
Wald Criterion: q ˆ ;W=q
ˆ[Var(q
ˆ)]-1q
ˆ
FE RE

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


ˆ - β] 
nT[β d
 N[0,VRE ] (efficient)
RE

ˆ - β] 
nT[β d
 N[0,VFE ] (inefficient)
FE

ˆ - β)-(β
ˆ = (β
Note: q ˆ  β). The lemma states that in the
FE RE

ˆ - β] and
joint limiting distribution of nT[ β ˆ , the
nT q
RE

limiting covariance, C Q,RE is 0. But, C Q,RE = CFE,RE - VRE . Then,


 . Using the lemma, CFE,RE = VRE.
Var[q] = VFE + VRE - CFE,RE - CFE,RE
It follows that Var[q]=VFE - VRE . Based on the preceding
ˆ -β
H=(β ˆ ) [Est.Var(β
ˆ ) - Est.Var(β
ˆ )]-1 (β
ˆ -β ˆ )
FE RE FE RE FE RE

β does not contain the constant term in the preceding.


Computing the Hausman Statistic
1
 N  1  
ˆ ˆ  i1 X i  I  ii  X i 
Est.Var[βFE ]   2

  Ti  
-1
 N  
ˆ   T 
ˆ
2
ˆ ]
Est.Var[β ˆ  i1 X i  I  ii  X i  , 0  ˆ i = 2
2 i i u
 1
RE 2
  T i   ˆ  T 
iˆu

As long as  2
ˆ  and 
2
ˆ u are consistent, as N  , Est.Var[β ˆ ]  Est.Var[β
ˆ ]
FE RE

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


2
be computed using the same estimate of 
ˆ  . The one based on LSDV will
generally be the better choice.

ˆ ] if there are time


Note that columns of zeros will appear in Est.Var[β FE

invariant variables in X.

β does not contain the constant term in the preceding.


Hausman Test

+--------------------------------------------------+
| Random Effects Model: v(i,t) = e(i,t) + u(i) |
| Estimates: Var[e] = .235236D-01 |
| Var[u] = .133156D+00 |
| Corr[v(i,t),v(i,s)] = .849862 |
| Lagrange Multiplier Test vs. Model (3) = 4061.11 |
| ( 1 df, prob value = .000000) |
| (High values of LM favor FEM/REM over CR model.) |
| Fixed vs. Random Effects (Hausman) = 2632.34 |
| ( 4 df, prob value = .000000) |
| (High (low) values of H favor FEM (REM).) |
+--------------------------------------------------+
Wu (Variable Addition) Test

Under the FE assumptions, the common effect is


correlated with the group means.

Add the group means to the RE model. If


statistically significant, this suggests that the RE
model is inappropriate.
Mundlak (Augmented) Regression
+--------+--------------+----------------+--------+--------+----------+
|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|
+--------+--------------+----------------+--------+--------+----------+
|EXPBAR | -.08769*** .00162096 -54.099 .0000 19.853782|
|OCCBAR | -.14806*** .03623348 -4.086 .0000 .5111645|
|SMSABAR | .21707*** .03209640 6.763 .0000 .6537815|
|MSBAR | .14855*** .05087686 2.920 .0035 .8144058|
|UNYNBAR | .07831** .03257465 2.404 .0162 .3639856|
|WKSBAR | .00857** .00362039 2.367 .0179 46.811525|
|INDBAR | .03998 .02966215 1.348 .1777 .3954382|
|SOUTHBAR| -.05487 .04293224 -1.278 .2012 .2902761|
|EXP | .11448*** .00225862 50.684 .0000 19.853782|
|EXPSQ | -.00045*** .483957D-04 -9.304 .0000 514.40504|
|OCC | -.02122 .01380348 -1.537 .1243 .5111645|
|SMSA | -.04237** .01945829 -2.178 .0294 .6537815|
|MS | -.02969 .01901293 -1.561 .1184 .8144058|
|FEM | -.31359*** .05419945 -5.786 .0000 .1126050|
|UNION | .03268** .01494574 2.187 .0288 .3639856|
|ED | .05150*** .00550816 9.349 .0000 12.845378|
|BLK | -.15768*** .04463738 -3.533 .0004 .0722689|
|WKS | .00081 .00060031 1.354 .1759 46.811525|
|IND | .01909 .01546993 1.234 .2171 .3954382|
|SOUTH | -.00176 .03435229 -.051 .9592 .2902761|
|Constant| 5.15038*** .20122987 25.595 .0000 |
+--------+------------------------------------------------------------+
Wu TEst
--> matr;bm=b(1:8);vm=varb(1:8,1:8)$
--> matr;list;wutest=bm'<vm>bm$

Matrix WUTEST has 1 rows and 1 columns.


1
+--------------
1| 3006.13788
--> calc;list;ctb(.95,8)$
+------------------------------------+
| Listed Calculator Results |
+------------------------------------+
Result = 15.507313

You might also like