## Verbeek 5ed. Chapter 10 - Panel Data

### Examples

```----------------------------------------------------------------------------------------------------
name:  SN
log:  \5iexample10_s.smcl
log type:  smcl
opened on:   5 Jun 2020, 01:48:00

. **********************************************
.  * Solomon Negash - Examples
.  * Verbeek(2017). A Giude To Modern Econometrics. 5ed.
.  * STATA Program, version 16.1.

.  * Chapter 10  - Models Based On Panel Data
.  ******************** **** *********************
. * Table 10.2 Estimation results wage equation, males 1980-1987

. use "Data\males.dta", clear

. xtset NR YEAR
panel variable:  NR (strongly balanced)
time variable:  YEAR, 1980 to 1987
delta:  1 unit

. eststo BE: xtreg WAGE SCHOOL EXPER EXPER2  UNION MAR BLACK HISP PUB, be

Between regression (regression on group means)  Number of obs     =      4,360
Group variable: NR                              Number of groups  =        545

R-sq:                                           Obs per group:
within  = 0.0470                                         min =          8
between = 0.2196                                         avg =        8.0
overall = 0.1371                                         max =          8

F(8,536)          =      18.85
sd(u_i + avg(e_i.))=  .3477522                  Prob > F          =     0.0000

------------------------------------------------------------------------------
WAGE |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
SCHOOL |   .0947911   .0109178     8.68   0.000     .0733442    .1162381
EXPER |  -.0502077   .0503689    -1.00   0.319    -.1491524     .048737
EXPER2 |   .0051068   .0032142     1.59   0.113    -.0012071    .0114208
UNION |   .2743194   .0471273     5.82   0.000     .1817426    .3668963
MAR |   .1445897   .0412654     3.50   0.000      .063528    .2256515
BLACK |  -.1391368   .0489084    -2.84   0.005    -.2352124   -.0430612
HISP |   .0054832   .0427436     0.13   0.898    -.0784823    .0894488
PUB |  -.0563215   .1090691    -0.52   0.606    -.2705768    .1579337
_cons |   .4903902   .2211917     2.22   0.027     .0558814     .924899
------------------------------------------------------------------------------

. eststo FE: xtreg WAGE SCHOOL EXPER EXPER2  UNION MAR BLACK HISP PUB, fe
note: SCHOOL omitted because of collinearity
note: BLACK omitted because of collinearity
note: HISP omitted because of collinearity

Fixed-effects (within) regression               Number of obs     =      4,360
Group variable: NR                              Number of groups  =        545

R-sq:                                           Obs per group:
within  = 0.1782                                         min =          8
between = 0.0006                                         avg =        8.0
overall = 0.0642                                         max =          8

F(5,3810)         =     165.26
corr(u_i, Xb)  = -0.1130                        Prob > F          =     0.0000

------------------------------------------------------------------------------
WAGE |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
SCHOOL |          0  (omitted)
EXPER |    .116457   .0084309    13.81   0.000     .0999275    .1329865
EXPER2 |  -.0042886   .0006054    -7.08   0.000    -.0054756   -.0031015
UNION |    .081203   .0193159     4.20   0.000     .0433325    .1190736
MAR |   .0451061   .0183114     2.46   0.014      .009205    .0810072
BLACK |          0  (omitted)
HISP |          0  (omitted)
PUB |   .0349267   .0386082     0.90   0.366     -.040768    .1106214
_cons |   1.065698   .0266766    39.95   0.000     1.013396       1.118
-------------+----------------------------------------------------------------
sigma_u |  .39989822
sigma_e |  .35126372
rho |  .56447541   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(544, 3810) = 9.71                   Prob > F = 0.0000

. eststo POLS: reg WAGE SCHOOL EXPER EXPER2  UNION MAR BLACK HISP PUB,

Source |       SS           df       MS      Number of obs   =     4,360
-------------+----------------------------------   F(8, 4351)      =    124.76
Model |  230.721836         8  28.8402295   Prob > F        =    0.0000
Residual |  1005.80781     4,351  .231167043   R-squared       =    0.1866
Total |  1236.52964     4,359  .283672779   Root MSE        =     .4808

------------------------------------------------------------------------------
WAGE |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
SCHOOL |   .0993678   .0046829    21.22   0.000      .090187    .1085487
EXPER |    .089138   .0101215     8.81   0.000     .0692948    .1089813
EXPER2 |  -.0028468   .0007077    -4.02   0.000    -.0042343   -.0014594
UNION |   .1799043   .0172146    10.45   0.000     .1461549    .2136537
MAR |   .1076212   .0157053     6.85   0.000     .0768308    .1384115
BLACK |  -.1438227    .023563    -6.10   0.000    -.1900182   -.0976271
HISP |   .0156503   .0208197     0.75   0.452    -.0251668    .0564674
PUB |   .0035461    .037474     0.09   0.925    -.0699219    .0770142
_cons |  -.0343724   .0646723    -0.53   0.595    -.1611631    .0924182
------------------------------------------------------------------------------

. eststo RE: xtreg WAGE SCHOOL EXPER EXPER2  UNION MAR BLACK HISP PUB, re

Random-effects GLS regression                   Number of obs     =      4,360
Group variable: NR                              Number of groups  =        545

R-sq:                                           Obs per group:
within  = 0.1776                                         min =          8
between = 0.1835                                         avg =        8.0
overall = 0.1808                                         max =          8

Wald chi2(8)      =     944.56
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
WAGE |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
SCHOOL |   .1010237   .0089219    11.32   0.000     .0835372    .1185103
EXPER |   .1117851   .0082709    13.52   0.000     .0955744    .1279959
EXPER2 |  -.0040575    .000592    -6.85   0.000    -.0052177   -.0028972
UNION |   .1064134   .0178669     5.96   0.000     .0713949    .1414319
MAR |   .0625465   .0167762     3.73   0.000     .0296658    .0954272
BLACK |  -.1440026   .0476439    -3.02   0.003     -.237383   -.0506223
HISP |   .0197269   .0426303     0.46   0.644    -.0638269    .1032807
PUB |   .0301555   .0364671     0.83   0.408    -.0413187    .1016296
_cons |  -.1043113    .110834    -0.94   0.347    -.3215421    .1129194
-------------+----------------------------------------------------------------
sigma_u |  .32482045
sigma_e |  .35126372
rho |  .46094736   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. estout BE FE POLS RE, cells(b(nostar fmt(3)) se(par fmt(3))) stats(r2 r2_p N, fmt(%5.0g %5.0g) lab
els(R-Squared Psuedo_R-Sqaured N )) varlabels(_cons constant) varwidth(10) ti("Table 10.2 Estimati
on results wage equation, males 1980-1987")

Table 10.2 Estimation results wage equation, males 1980-1987
--------------------------------------------------------------
BE           FE         POLS           RE
b/se         b/se         b/se         b/se
--------------------------------------------------------------
SCHOOL            0.095        0.000        0.099        0.101
(0.011)          (.)      (0.005)      (0.009)
EXPER            -0.050        0.116        0.089        0.112
(0.050)      (0.008)      (0.010)      (0.008)
EXPER2            0.005       -0.004       -0.003       -0.004
(0.003)      (0.001)      (0.001)      (0.001)
UNION             0.274        0.081        0.180        0.106
(0.047)      (0.019)      (0.017)      (0.018)
MAR               0.145        0.045        0.108        0.063
(0.041)      (0.018)      (0.016)      (0.017)
BLACK            -0.139        0.000       -0.144       -0.144
(0.049)          (.)      (0.024)      (0.048)
HISP              0.005        0.000        0.016        0.020
(0.043)          (.)      (0.021)      (0.043)
PUB              -0.056        0.035        0.004        0.030
(0.109)      (0.039)      (0.037)      (0.036)
constant          0.490        1.066       -0.034       -0.104
(0.221)      (0.027)      (0.065)      (0.111)
--------------------------------------------------------------
R-Squared           .22         .178         .187
Psuedo_R~d
N               4.4e+03      4.4e+03      4.4e+03      4.4e+03
--------------------------------------------------------------

. * Table 10.3 OLS, within and OLS-FD estimation results dynamic model

. use "Data\debtratio.dta", clear

. xtset gvkey yeara
panel variable:  gvkey (unbalanced)
time variable:  yeara, 1986 to 2001, but with gaps
delta:  1 unit

. eststo POLS: reg mdr l.mdr lagebit_ta lagmb lagdep_ta laglnta lagfa_ta lagrd_dum lagrd_ta lagindme
dian lagrated, r

Linear regression                               Number of obs     =     19,573
F(10, 19562)      =    5490.12
Prob > F          =     0.0000
R-squared         =     0.7409
Root MSE          =     .12526

------------------------------------------------------------------------------
|               Robust
mdr |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
mdr |
L1. |   .8835036   .0050071   176.45   0.000     .8736893    .8933179
|
lagebit_ta |  -.0323378   .0066229    -4.88   0.000    -.0453192   -.0193563
lagmb |   .0016432   .0006228     2.64   0.008     .0004225    .0028639
lagdep_ta |  -.2605179     .03579    -7.28   0.000    -.3306693   -.1903666
laglnta |  -.0006704   .0005836    -1.15   0.251    -.0018143    .0004735
lagfa_ta |   .0201215   .0054843     3.67   0.000     .0093718    .0308711
lagrd_dum |   .0068896   .0020858     3.30   0.001     .0028013    .0109778
lagrd_ta |  -.1202051   .0131558    -9.14   0.000    -.1459915   -.0944187
lagindmedian |   .0321225   .0096277     3.34   0.001     .0132514    .0509935
lagrated |   .0071341   .0027677     2.58   0.010     .0017092    .0125589
_cons |   .0581818    .010525     5.53   0.000     .0375518    .0788117
------------------------------------------------------------------------------

. eststo FE: xtreg mdr l.mdr lagebit_ta lagmb lagdep_ta laglnta lagfa_ta lagrd_dum lagrd_ta lagindme
dian lagrated, fe r

Fixed-effects (within) regression               Number of obs     =     19,573
Group variable: gvkey                           Number of groups  =      3,777

R-sq:                                           Obs per group:
within  = 0.3404                                         min =          1
between = 0.6409                                         avg =        5.2
overall = 0.5623                                         max =         15

F(10,3776)        =     322.30
corr(u_i, Xb)  = 0.0823                         Prob > F          =     0.0000

(Std. Err. adjusted for 3,777 clusters in gvkey)
------------------------------------------------------------------------------
|               Robust
mdr |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
mdr |
L1. |   .5349825    .011908    44.93   0.000     .5116358    .5583293
|
lagebit_ta |  -.0500329   .0111017    -4.51   0.000    -.0717989    -.028267
lagmb |   .0022776   .0010086     2.26   0.024        .0003    .0042551
lagdep_ta |  -.1239544   .0709401    -1.75   0.081     -.263039    .0151301
laglnta |   .0380301   .0030688    12.39   0.000     .0320135    .0440468
lagfa_ta |   .0593436   .0170793     3.47   0.001      .025858    .0928291
lagrd_dum |   .0000598   .0080767     0.01   0.994    -.0157753    .0158948
lagrd_ta |  -.0656762   .0264011    -2.49   0.013    -.1174379   -.0139145
lagindmedian |   .1672179    .022364     7.48   0.000     .1233712    .2110647
lagrated |   .0205898   .0058294     3.53   0.000     .0091607     .032019
_cons |  -.6008348   .0569212   -10.56   0.000     -.712434   -.4892356
-------------+----------------------------------------------------------------
sigma_u |  .14361663
sigma_e |  .11333049
rho |  .61625402   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. eststo FD: reg d.mdr l.d.mdr d.lagebit_ta d.lagmb d.lagdep_ta d.laglnta d.lagfa_ta d.lagrd_dum d.l
agrd_ta d.lagindmedian d.lagrated, r nocons

Linear regression                               Number of obs     =     15,039
F(10, 15029)      =      34.43
Prob > F          =     0.0000
R-squared         =     0.0325
Root MSE          =     .12436

------------------------------------------------------------------------------
|               Robust
D.mdr |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
mdr |
LD. |   -.110409   .0124587    -8.86   0.000    -.1348296   -.0859884
|
lagebit_ta |
D1. |  -.0460275   .0101405    -4.54   0.000    -.0659041   -.0261508
|
lagmb |
D1. |   .0027553   .0010367     2.66   0.008     .0007232    .0047873
|
lagdep_ta |
D1. |   .1837711   .0797316     2.30   0.021     .0274874    .3400548
|
laglnta |
D1. |   .0727863   .0047634    15.28   0.000     .0634494    .0821231
|
lagfa_ta |
D1. |   .1012892   .0179843     5.63   0.000     .0660378    .1365407
|
lagrd_dum |
D1. |  -.0173716   .0090703    -1.92   0.055    -.0351504    .0004073
|
lagrd_ta |
D1. |  -.0516802   .0286951    -1.80   0.072    -.1079261    .0045657
|
lagindmedian |
D1. |   .1787605   .0256968     6.96   0.000     .1283917    .2291294
|
lagrated |
D1. |   .0114568   .0065153     1.76   0.079     -.001314    .0242276
------------------------------------------------------------------------------

. * Table 10.4 IV and GMM estimation results dynamic model

. u "Data/debtratio.dta", clear

. eststo AH1: ivreg d.mdr (l.d.mdr=l2.d.mdr) d.lagebit_ta d.lagmb d.lagdep_ta d.laglnta d.lagfa_ta d
.lagrd_dum d.lagrd_ta d.lagindmedian d.lagrated, nocons r

Instrumental variables (2SLS) regression        Number of obs     =     11,732
F(10, 11722)      =       0.27
Prob > F          =     0.9878
R-squared         =          .
Root MSE          =     .92404

------------------------------------------------------------------------------
|               Robust
D.mdr |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
mdr |
LD. |   8.555149    11.3126     0.76   0.450    -13.61943    30.72973
|
lagebit_ta |
D1. |   1.480619   2.008451     0.74   0.461    -2.456278    5.417517
|
lagmb |
D1. |   .2955019   .3809864     0.78   0.438    -.4512949    1.042299
|
lagdep_ta |
D1. |  -2.439425   3.461122    -0.70   0.481    -9.223799    4.344949
|
laglnta |
D1. |  -.6685727   .9734362    -0.69   0.492     -2.57667    1.239524
|
lagfa_ta |
D1. |  -1.337006   1.887529    -0.71   0.479    -5.036877    2.362866
|
lagrd_dum |
D1. |   -.023188   .0957618    -0.24   0.809    -.2108971    .1645211
|
lagrd_ta |
D1. |   1.068151   1.512725     0.71   0.480    -1.897042    4.033344
|
lagindmedian |
D1. |  -4.118354   5.618381    -0.73   0.464    -15.13132    6.894608
|
lagrated |
D1. |  -.3376334   .4584422    -0.74   0.461    -1.236256    .5609896
------------------------------------------------------------------------------
Instrumented:  LD.mdr
Instruments:   D.lagebit_ta D.lagmb D.lagdep_ta D.laglnta D.lagfa_ta
D.lagrd_dum D.lagrd_ta D.lagindmedian D.lagrated L2D.mdr
------------------------------------------------------------------------------

. eststo AH2: ivreg d.mdr (l.d.mdr=l2.mdr) d.lagebit_ta d.lagmb d.lagdep_ta d.laglnta d.lagfa_ta d.l
agrd_dum d.lagrd_ta d.lagindmedian d.lagrated, nocons r

Instrumental variables (2SLS) regression        Number of obs     =     15,039
F(10, 15029)      =      10.02
Prob > F          =     0.0000
R-squared         =          .
Root MSE          =     .18243

------------------------------------------------------------------------------
|               Robust
D.mdr |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
mdr |
LD. |   1.124607   .3770692     2.98   0.003     .3855051    1.863708
|
lagebit_ta |
D1. |   .1629408   .0655393     2.49   0.013     .0344758    .2914059
|
lagmb |
D1. |   .0397811   .0114787     3.47   0.001     .0172814    .0622808
|
lagdep_ta |
D1. |  -.1506395   .1625619    -0.93   0.354    -.4692806    .1680016
|
laglnta |
D1. |  -.0319194   .0325089    -0.98   0.326    -.0956408     .031802
|
lagfa_ta |
D1. |  -.1239245    .073548    -1.68   0.092    -.2680874    .0202385
|
lagrd_dum |
D1. |  -.0206255   .0144243    -1.43   0.153     -.048899    .0076479
|
lagrd_ta |
D1. |   .0992718    .061007     1.63   0.104    -.0203094     .218853
|
lagindmedian |
D1. |  -.4627651   .1995744    -2.32   0.020    -.8539552   -.0715749
|
lagrated |
D1. |  -.0419514   .0191066    -2.20   0.028    -.0794027   -.0045001
------------------------------------------------------------------------------
Instrumented:  LD.mdr
Instruments:   D.lagebit_ta D.lagmb D.lagdep_ta D.laglnta D.lagfa_ta
D.lagrd_dum D.lagrd_ta D.lagindmedian D.lagrated L2.mdr
------------------------------------------------------------------------------

. eststo AB1: xtabond mdr  lagebit_ta lagmb lagdep_ta laglnta lagfa_ta lagrd_dum lagrd_ta lagindmedi
an lagrated, nocons

Arellano-Bond dynamic panel-data estimation     Number of obs     =     15,039
Group variable: gvkey                           Number of groups  =      2,996
Time variable: yeara
Obs per group:
min =          1
avg =   5.019693
max =         14

Number of instruments =    114                  Wald chi2(10)     =     792.24
Prob > chi2       =     0.0000
One-step results
------------------------------------------------------------------------------
mdr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
mdr |
L1. |      .4716   .0367014    12.85   0.000     .3996665    .5435335
|
lagebit_ta |   .0501892   .0112482     4.46   0.000     .0281433    .0722352
lagmb |   .0210889   .0017668    11.94   0.000     .0176259    .0245518
lagdep_ta |  -.0381627   .0769418    -0.50   0.620    -.1889658    .1126404
laglnta |   .0253849   .0046089     5.51   0.000     .0163516    .0344183
lagfa_ta |  -.0049994   .0194774    -0.26   0.797    -.0431745    .0331756
lagrd_dum |  -.0183677   .0089972    -2.04   0.041     -.036002   -.0007335
lagrd_ta |   .0186554   .0334981     0.56   0.578    -.0469996    .0843103
lagindmedian |   .1012676   .0335516     3.02   0.003     .0355078    .1670275
lagrated |  -.0089812   .0072924    -1.23   0.218    -.0232741    .0053116
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/.).mdr
Standard: D.lagebit_ta D.lagmb D.lagdep_ta D.laglnta D.lagfa_ta
D.lagrd_dum D.lagrd_ta D.lagindmedian D.lagrated

. eststo AB2: xtabond mdr  lagebit_ta lagmb lagdep_ta laglnta lagfa_ta lagrd_dum lagrd_ta lagindmedi
an lagrated, nocons two

Arellano-Bond dynamic panel-data estimation     Number of obs     =     15,039
Group variable: gvkey                           Number of groups  =      2,996
Time variable: yeara
Obs per group:
min =          1
avg =   5.019693
max =         14

Number of instruments =    114                  Wald chi2(10)     =     458.13
Prob > chi2       =     0.0000
Two-step results
------------------------------------------------------------------------------
mdr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
mdr |
L1. |   .3819695   .0438487     8.71   0.000     .2960277    .4679113
|
lagebit_ta |    .035684   .0136487     2.61   0.009      .008933     .062435
lagmb |   .0147128   .0020845     7.06   0.000     .0106272    .0187983
lagdep_ta |   .0648811    .091165     0.71   0.477    -.1137989    .2435612
laglnta |    .030107   .0061345     4.91   0.000     .0180836    .0421304
lagfa_ta |   .0150317   .0222106     0.68   0.499    -.0285004    .0585637
lagrd_dum |  -.0178784   .0101335    -1.76   0.078    -.0377397    .0019829
lagrd_ta |    .001471   .0313577     0.05   0.963     -.059989    .0629309
lagindmedian |   .0919917   .0344887     2.67   0.008     .0243951    .1595883
lagrated |  -.0066174   .0073056    -0.91   0.365    -.0209362    .0077014
------------------------------------------------------------------------------
Warning: gmm two-step standard errors are biased; robust standard
errors are recommended.
Instruments for differenced equation
GMM-type: L(2/.).mdr
Standard: D.lagebit_ta D.lagmb D.lagdep_ta D.laglnta D.lagfa_ta
D.lagrd_dum D.lagrd_ta D.lagindmedian D.lagrated

. est clear

. log close
name:  SN
log:  \5iexample10_s.smcl
log type:  smcl
closed on:   5 Jun 2020, 01:48:02

----------------------------------------------------------------------------------------------------

Previous | Home | Wooldridge I | Wooldridge II | Greene 8ed | Verbeek 5ed |  Report Error |

```