Panel Data Analysis

advertisement
Panel Data Analysis
INTRO
• Panel Data is where you observe behavior of
entities across time.
• Allows to control for unobservable variables
that change over time but not entity
• Allows to control for unobservable variables
across entities
• xtset entity time
xtline fatalityrate
, (ov)
Fixed Effect Models
π’€π’Šπ’• = πœ·π’Š π‘Ώπ’Šπ’• + πœΆπ’Š + πœΈπ’• + π’–π’Šπ’• (Eq 1)
𝛼𝑖 = π‘–π‘›π‘‘π‘’π‘Ÿπ‘π‘’π‘π‘‘ π‘“π‘œπ‘Ÿ π‘’π‘Žπ‘β„Ž 𝑒𝑛𝑑𝑖𝑑𝑦 𝑖 … 𝑛
𝛾𝑑 = π‘–π‘›π‘‘π‘’π‘Ÿπ‘π‘’π‘π‘‘ π‘“π‘œπ‘Ÿ π‘’π‘Žπ‘β„Ž π‘‘π‘–π‘šπ‘’ π‘π‘’π‘Ÿπ‘–π‘œπ‘‘
π’€π’Šπ’• = 𝜷𝟎 + 𝜷𝟏 π‘ΏπŸπ’Šπ’• + β‹― + πœ·π’Œ π‘Ώπ’Œπ’Šπ’• + 𝜹𝟐 π‘¬πŸ + β‹― + πœΉπ’ 𝑬𝒏 + 𝜸𝟐 π‘»π’Šπ’• + β‹― + πœΈπ’• 𝑻𝒕 + π’–π’Šπ’•
𝐸𝑛 = π‘‘π‘’π‘šπ‘šπ‘¦ π‘£π‘Žπ‘Ÿπ‘–π‘Žπ‘π‘™π‘’π‘  π‘“π‘œπ‘Ÿ π‘’π‘Žπ‘β„Ž 𝑒𝑛𝑑𝑖𝑑𝑦 (𝑛 − 1 𝑖𝑛 π‘šπ‘œπ‘‘π‘’π‘™)
(Eq 2)
𝛿𝑛 = π‘π‘œπ‘’π‘“π‘“π‘–π‘π‘–π‘’π‘›π‘‘ π‘œπ‘› 𝑒𝑛𝑑𝑖𝑑𝑦 π‘£π‘Žπ‘Ÿπ‘–π‘Žπ‘π‘™π‘’
𝑇𝑑 = π‘‘π‘’π‘šπ‘šπ‘¦ π‘£π‘Žπ‘Ÿπ‘–π‘Žπ‘π‘™π‘’π‘  π‘“π‘œπ‘Ÿ π‘’π‘Žπ‘β„Ž π‘‘π‘–π‘šπ‘’π‘π‘’π‘Ÿπ‘–π‘œπ‘‘ (𝑑 − 1 𝑖𝑛 π‘šπ‘œπ‘‘π‘’π‘™)
𝛾𝑑 = π‘π‘œπ‘’π‘“π‘“π‘–π‘π‘–π‘’π‘›π‘‘ π‘œπ‘› π‘‘π‘–π‘šπ‘’ π‘£π‘Žπ‘Ÿπ‘–π‘Žπ‘π‘™π‘’π‘ 
fatalityrate sb_useage i.fips i.year
_Ifips_1-56
(naturally coded; _Ifips_1 omitted)
_Iyear_1983-1997
(naturally coded; _Iyear_1983 omitted)
MS
.012688284
.001351121
65
490
.000195204
2.7574e-06
Total
.014039406
555
.000025296
fatalityrate
Coef.
sb_useage
_Ifips_2
_Ifips_4
_Ifips_5
_Ifips_6
_Ifips_8
-.0037393
.0011998
.0010569
.0026309
-.005236
-.0046082
Std. Err.
.0011439
.0007563
.0007517
.0006915
.0006822
.0007407
t
-3.27
1.59
1.41
3.80
-7.68
-6.22
xi: reg fatalityrate sb_useage i.fips i.year
predict yhat
separate yhat, by(fips)
separate yhat, by(year)
twoway connected yhat1-yhat56
sb_useage|| lfit fatalityrate
sb_useage, clwidth(thick)
clcolor(black)
twoway connected yhat1983-yhat1997
sb_useage|| lfit fatalityrate
sb_useage, clwidth(thick)
clcolor(black)
P>|t|
=
=
=
=
=
=
556
70.79
0.0000
0.9038
0.8910
.00166
Eq 2
Dummy Variables
[95% Conf. Interval]
0.001
0.113
0.160
0.000
0.000
0.000
-.0059868
-.0002861
-.00042
.0012723
-.0065764
-.0060635
-.0014917
.0026858
.0025339
.0039896
-.0038956
-.0031528
.03
Model
Residual
Number of obs
F( 65,
490)
Prob > F
R-squared
Adj R-squared
Root MSE
.025
df
.02
SS
.015
Source
.01
. xi: reg
i.fips
i.year
0
.2
.4
sb_useage
.6
.8
Eq 1
n entity-specific intercepts
areg fatalityrate sb_useage, absorb(state)
areg fatalityrate sb_useage year2…year10, absorb(state)
. areg
fatalityrate sb_useage, absorb(state)
Linear regression, absorbing indicators
fatalityrate
Coef.
sb_useage
_cons
-.0170648
.0287933
state
Std. Err.
.0006547
.0003572
F(50, 504) =
Number of obs
F( 1,
504)
Prob > F
R-squared
Adj R-squared
Root MSE
t
=
=
=
=
=
=
556
679.47
0.0000
0.8460
0.8304
.00207
P>|t|
[95% Conf. Interval]
-26.07
80.61
0.000
0.000
-.018351
.0280915
44.747
0.000
-.0157786
.029495
(51 categories)
Eq 1
n entity-specific intercepts
xtset fips year
xtreg fatalityrate sb_useage, fe
. xtset fips year
panel variable:
time variable:
delta:
fips (strongly balanced)
year, 1983 to 1997
1 unit
. xtreg fatalityrate sb_useage, fe
Fixed-effects (within) regression
Group variable: fips
Number of obs
Number of groups
=
=
556
51
R-sq:
Obs per group: min =
avg =
max =
8
10.9
15
within = 0.5741
between = 0.0036
overall = 0.1622
corr(u_i, Xb)
F(1,504)
Prob > F
= -0.2067
fatalityrate
Coef.
sb_useage
_cons
-.0170648
.0287933
.0006547
.0003572
sigma_u
sigma_e
rho
.00444127
.00207142
.82133433
(fraction of variance due to u_i)
F test that all u_i=0:
Std. Err.
F(50, 504) =
t
=
=
-26.07
80.61
44.75
679.47
0.0000
P>|t|
[95% Conf. Interval]
0.000
0.000
-.018351
.0280915
-.0157786
.029495
Prob > F = 0.0000
xtreg options
fe: fixed effects
Explores relationship between estimations and outcomes within an
entity. Assumes each entity has own characteristics that may
influence yhat to control for.
re: random effects
Variation across entities is assumed to be random and uncorrelated
with the independent variables included in the model
be: between effects
pa: population-average
Download