Wooldridge
Chapter 10: Basic Linear Unobserved Effects Panel Data Models
STATA Exercise
The data files used for the examples in this text can be downloaded in a zip file from the
http://www.stata.com/texts/eacsap/ or giving commands on your STATA while your are connected to internet as
below:
net from http://www.stata.com/data/jwooldridge/
net describe eacsap
net get eacsap
log scrap 0.415 0.93 d 88 0.27 0d 89 0.548 union 0.215 grant 0.377 grant1
0.243
0.109
0.132
0.411
0.148
0.205
The lagged value of grant has the larger impact and is statistically significant at the 5 percent level against a onesided alternative. You are invited to estimate the equation without grant_1 to verify that the estimated grant effect is
much smaller (on the order of 6.7 percent) and statistically insignificant.
use jtrain1, clear
xtreg lscrap d88 d89 union grant grant_1, i( fcode)
Randomeffects GLS regression
Group variable (i): fcode
Number of obs
Number of groups
=
=
162
54
Rsq:
3
3.0
3
within = 0.2006
between = 0.0206
overall = 0.0361
Wald chi2(5)
Prob > chi2
=
=
26.99
0.0001
lscrap 
Coef.
Std. Err.
z
P>z
[95% Conf. Interval]
+d88  .0934519
.1091559
0.86
0.392
.3073937
.1204898
d89  .2698336
.1316496
2.05
0.040
.527862
.0118052
union 
.5478021
.410625
1.33
0.182
.2570081
1.352612
grant 
.214696
.1477838
1.45
0.146
.504347
.0749549
grant_1  .3770698
.2053516
1.84
0.066
.7795515
.0254119
_cons 
.4148333
.2434322
1.70
0.088
.0622851
.8919518
+sigma_u  1.3900287
sigma_e  .49774421
rho  .88634984
(fraction of variance due to u_i)

edipambudi@hotmail.com
Page 1
grant = 0
grant_1 = 0
chi2( 2) =
Prob > chi2 =
3.66
0.1601
0.133
0.151
0.210
Compared with the random effects, the grant is estimated to have a larger effect, both contemporaneously and
lagged one year. The t statistics are also somewhat more significant with fixed effects.
xtreg lscrap d88 d89 union grant grant_1, i( fcode) fe
Fixedeffects (within) regression
Group variable (i): fcode
Number of obs
Number of groups
=
=
162
54
Rsq:
3
3.0
3
within = 0.2010
between = 0.0079
overall = 0.0068
corr(u_i, Xb)
F(4,104)
Prob > F
= 0.0714
=
=
6.54
0.0001
lscrap 
Coef.
Std. Err.
t
P>t
[95% Conf. Interval]
+d88  .0802157
.1094751
0.73
0.465
.297309
.1368776
d89  .2472028
.1332183
1.86
0.066
.5113797
.0169741
union  (dropped)
grant  .2523149
.150629
1.68
0.097
.5510178
.0463881
grant_1  .4215895
.2102
2.01
0.047
.8384239
.0047551
_cons 
.5974341
.0677344
8.82
0.000
.4631142
.7317539
+sigma_u 
1.438982
sigma_e  .49774421
rho  .89313867
(fraction of variance due to u_i)
F test that all u_i=0:
F(53, 104) =
23.87
Prob > F = 0.0000
test grant grant_1
( 1)
( 2)
grant = 0
grant_1 = 0
F(
2,
104) =
Prob > F =
edipambudi@hotmail.com
2.23
0.1127
Page 2
log( scrap
) using first differencing. Specifically, we use pooled OLS on
0.125(0.111)
0.131(0.128)
0.235(0.265)
where the usual standard errors are in parentheses and the robust standard errors are in brackets. We report
R2 0.037 here because it has a useful interpretation: it measures the amount of variation in the growth in the
scrap rate that is explained by grantt and grantt 1 (and d 89 ). The estimates on grantt and grantt 1 are
fairly similar to the fixed effect estimates, although is now statistically grantt more significant than grantt 1 .
The usual F test for joint significance of grantt and grantt 1 is 1.53 with pvalue=222.
use jtrain1, clear
tsset fcode year
panel variable:
time variable:
Number of obs
F( 3,
104)
Prob > F
Rsquared
Adj Rsquared
Root MSE
=
=
=
=
=
=
108
1.31
0.2739
0.0365
0.0087
.57672
D.lscrap

Coef.
Std. Err.
t
P>t
[95% Conf. Interval]
+d89
 .0962081
.1254469
0.77
0.445
.344974
.1525578
grant

D1 
.222781
.1307423
1.70
0.091
.482048
.0364859
grant_1

D1  .3512459
.2350848
1.49
0.138
.817428
.1149362
_cons
 .0906072
.0909695
1.00
0.322
.2710032
.0897888
test d.grant d.grant_1
( 1)
( 2)
D.grant = 0
D.grant_1 = 0
edipambudi@hotmail.com
Page 3
F(
2,
104) =
Prob > F =
1.53
0.2215
Number of obs
F( 3,
104)
Prob > F
Rsquared
Adj Rsquared
Root MSE
=
=
=
=
=
=
108
1.31
0.2739
0.0365
0.0087
.57672
D.lscrap

Coef.
Std. Err.
t
P>t
[95% Conf. Interval]
+d89
 .0962081
.1254469
0.77
0.445
.344974
.1525578
grant

D1 
.222781
.1307423
1.70
0.091
.482048
.0364859
grant_1

D1  .3512459
.2350848
1.49
0.138
.817428
.1149362
_cons
 .0906072
.0909695
1.00
0.322
.2710032
.0897888
predict u, res
(363 missing values generated)
reg u l.u
Source 
SS
df
MS
+Model  .971328577
1 .971328577
Residual  16.3125173
52 .313702256
+Total  17.2838459
53
.3261103
Number of obs
F( 1,
52)
Prob > F
Rsquared
Adj Rsquared
Root MSE
=
=
=
=
=
=
54
3.10
0.0844
0.0562
0.0380
.56009
u

Coef.
Std. Err.
t
P>t
[95% Conf. Interval]
+u

L1 
.2369063
.1346333
1.76
0.084
.0332551
.5070678
_cons

3.30e10
.0762188
0.00
1.000
.1529441
.1529442

edipambudi@hotmail.com
Page 4
Much more than documents.
Discover everything Scribd has to offer, including books and audiobooks from major publishers.
Cancel anytime.