Introduction To Regression Models For Panel Data Analysis Indiana University Workshop in Methods October 7, 2011 Professor Patricia A. Mcmanus
Introduction To Regression Models For Panel Data Analysis Indiana University Workshop in Methods October 7, 2011 Professor Patricia A. Mcmanus
Introduction To Regression Models For Panel Data Analysis Indiana University Workshop in Methods October 7, 2011 Professor Patricia A. Mcmanus
Indiana University
Workshop in Methods
October 7, 2011
Professor Patricia A. McManus
Semester
5
6
5
6
Female
0
0
1
1
HSGPA
2.8
2.8
2.5
2.5
GPA
3.0
2.1
2.2
2.5
JobHrs
0
20
10
10
JobHrs5 GPA6
0
2.1
10
2.5
JobHrs6
20
10
TERMit
HSGPAit
JOBit
vit
x1i
x 2i
...
xki
ui , i=1,2,3,N
Uncorrelated errors:
Cov ui , u j
Homoskedastic errors:
Var ui
0
Var yi | x1i , x 2i ,..., x ki
x 'i,t 1
t1
ui,t 1
yi,t 2
:::
yi,T
x 'i,t 2
t2
ui,t 1
x 'i,T
t=1,2,,T
ui,T
Xi
ui , where yi'
For comparison, begin with two conventional OLS linear regression models,
one for each period. Note that the variables female highgpa (HS
GPA) is time-invariant.
WIM Panel Data Analysis October 2011| Page 10
Intercept
jobhrs
female
highgpa
Term 5 GPA
Estimate SE
3.02
0.17
-0.182
0.05
0.108
0.04
-0.004
0.04
t-stat
17.8
-4.0
2.5
-0.1
Term 6 GPA
Estimate
SE
3.02
0.17
-0.174
0.05
0.145
0.05
0.003
0.04
t-stat
18.3
-3.6
3.2
0.1
Intercept
jobhrs
female
highgpa
term6
Term 5&6
Estimate
2.97
-0.178
0.125
-0.0001
0.095
GPA
SE
t-stat
0.17 25.1
0.05 -5.4
0.04
4.1
0.03 -0.01
0.016 6.1
x1
x2
...
xk
x1
x2
...
xk
x1
i1
x2
yi,2
x1
i2
x2
vi,1 ci ui,1
vi,2 ci ui,2
cov(vi,1, vi,2 ) 0
i1
...
xk
i2
...
xk
i1
i2
k
k
vi,1
vi,2
xi 1
xi 2
ci
ci
ui 1
ui 2
yiT
xiT
ci
uiT
ci
E (xit' uit )
0 and E (xit' ci )
0,
t=1,2,,T
200
300
400
500
600
700
8
9 10 11 12 13 14 15 16 17
Subject ID
Wright Peak #1
Wright Peak #2
WIM Panel Data Analysis October 2011| Page 16
KIDSOLS
KIDSFE
xit'
yit
uit ,
ci
t=1,2,,T
For each unit, average this equation over all time periods t:
xi'
yi
ci
ui
xit'
yi
xi'
ci
ci
uit
ui ,
t=1,2,,T
yit
where ci
ci
xit'
0 and yit
uit ,
yit
yi , xit
xit
xi , uit
uit
ui
The fixed-effects estimator, also called the within estimator, applies pooled
OLS to the transformed equation:
Xi' Xi
FE
i 1
Xi' yi
i 1
xit' xit
i 1t 1
HSGPA
2.8
2.8
2.5
2.5
GPA
3.0
2.1
2.2
2.5
xit' yit
i 1t 1
JobHrs
0
20
10
10
yit
xit'
ci
uit
yit
xit'
d2
1
d3
...
dN
uit ,
xit'
yit
uit ,
ci
yi,t
xit'
xi' ,t
ci
ci
uit
ui,t
yit
where
ci
0 and
xit'
uit ,
Semester
5
6
5
6
Female
0
0
1
1
HSGPA
2.8
2.8
2.5
2.5
GPA
3.0
2.1
2.2
2.5
JobHrs
0
20
10
10
DSemester
.
1
.
1
dFemale
.
0
.
0
CFemale
0
0
0
0
FD (Differenced) Transform:
StudentID DSemester dFemale dHSGPA dGPA dJobHrs
17
1
0
0
-.9 20
23
1
0
0
.3
0
Compare the transformed (FE) and differenced (FD) data. Each FD variable
is equal to the difference between the second-period FE demeaned
variable and the first-period demeaned variable.
This symmetry will always be present in the two-period panel model.
As a result, the parameter estimates for the two-period panel model can
be obtained using FD or FE, with identical results. Not so if T>2 !
WIM Panel Data Analysis October 2011| Page 26
jobhrs
term6
(FD, N=200)
SE________
0.0223835
0.0125627
jobhrs
term
(FD, N=1000)
SE________
0.0174187
0.0091661
DID
yB,2
yB,1
yA,2
yA,1
If we have panel data from a time period prior to treatment and a second
observation drawn after the treatment event, we can study treatment
effects using 2-period panel data FD and DID:
yi1
yi 2
PD PERIODi 1
TREAT treatmenti 1
PD PERIODi 1
TREAT treatmenti 2
vi1
, and
vi 2
PD
TREAT
treatmenti
vi
treatmenti
PD
TREAT
treatmenti
0)
treatmenti
1 for all
1)
vi
yB,2
PD
yB,1
TREAT
yA,2
yA,1
treatmenti
B)
( PD
TREAT
treatmenti
TREAT
e.g. Card & Krueger (2000) Minimum Wage increases & Employment
WIM Panel Data Analysis October 2011| Page 29
Source: David Johnson. Journal of Marriage and Family, Vol. 67, No. 4 (Nov., 2005), pp. 1061-1075
WIM Panel Data Analysis October 2011| Page 31
E (ci )
0
WIM Panel Data Analysis October 2011| Page 32
2
u
RE strategy: If
2
c
2
v
2
u
2
c,
u2
c2
Intercept
jobhrs
female
highgpa
term6
Intercept
jobhrs
female
highgpa
term
FE
xtreg gpa
estimates
xtreg gpa
estimates
. hausman fe re
---- Coefficients ---|
(b)
(B)
(b-B)
sqrt(diag(V_b-V_B))
|
fe
re
Difference
S.E.
-------------+--------------------------------------------------------------job |
-.0748115
-.1232374
.048426
.0088051
----------------------------------------------------------------------------b = consistent under Ho and Ha; obtained from xtreg
B = inconsistent under Ha, efficient under Ho; obtained from xtreg
Test:
Ho:
We reject the null and conclude the fixed effects estimator is appropriate.
xit
ci
xit
Best Practices
Theorize the model
What exactly does this unobserved heterogeneity represent?
Why would you expect it to be correlated / uncorrelated with the
regressors?
Specification Testing for Panel Analysis - Interval/Continuous Outcomes
Before ruling out pooled OLS, test for appropriateness of panel methods
vs. pooled ordinary least square.
Optional: Obtain intraclass correlation coefficient (ICC) as indicator of the
extent of within-unit clustering. This is a descriptive statistic, not a test.
Specification tests for strict exogeneity
Test for serial correlation in the idiosyncratic errors
Hausman test for random effects vs. fixed effects
Extensions
FE Models with Time-Invariant Predictors
Interactions between time and covariate
Panel Models for Categorical Outcomes
Fixed effects logit and random effects logit for binary outcomes
Fixed and random effects Poisson models can be used for count outcomes.
Population averaged models can be estimated using General Estimation
Equations (GEE).
Dynamic panel models i.e. lagged dependent variable as a covariate:
GPAit
GPAi,t
1 GPA
TERMit
HSGPAit
JOBit
vit