## Verbeek 5ed. Chapter 5 - Endogeneity, IV and GMM

### Examples

```----------------------------------------------------------------------------------------------------
name:  SN
log:  \5iexample5_s.smcl
log type:  smcl
opened on:   9 Jun 2020, 23:38:34
. **********************************************
.   * Solomon Negash - Examples
.   * Verbeek(2017). A Giude To Modern Econometrics. 5ed.
.   * STATA Program, version 16.1.

.   * Chapter 5  - Endogeneity, Instrumental Variables and GMM
. ******************** **** *********************
. * Table 5.1 Wage equation estimated by OLS

. u "Data/schooling.dta", clear
. g exp76sq = exp76^2
. reg lwage76 ed76 exp76 exp76sq black smsa76 south76
Source |       SS           df       MS      Number of obs   =     3,010
-------------+----------------------------------   F(6, 3003)      =    204.93
Model |   172.16563         6  28.6942716   Prob > F        =    0.0000
Residual |  420.476016     3,003  .140018653   R-squared       =    0.2905
-------------+----------------------------------   Adj R-squared   =    0.2891
Total |  592.641646     3,009  .196956346   Root MSE        =    .37419
------------------------------------------------------------------------------
lwage76 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
ed76 |    .074009   .0035054    21.11   0.000     .0671357    .0808823
exp76 |   .0835958   .0066478    12.57   0.000     .0705612    .0966305
exp76sq |  -.0022409   .0003178    -7.05   0.000    -.0028641   -.0016177
black |  -.1896315   .0176266   -10.76   0.000    -.2241929   -.1550702
smsa76 |    .161423   .0155733    10.37   0.000     .1308876    .1919583
south76 |  -.1248615   .0151182    -8.26   0.000    -.1545046   -.0952184
_cons |   4.733664   .0676026    70.02   0.000     4.601112    4.866216
------------------------------------------------------------------------------

. *Table 5.2 Reduced form for schooling, estimated by OLS

. g age76sq=age76^2
. reg ed76 age76 age76sq black smsa76 south76 nearc4
Source |       SS           df       MS      Number of obs   =     3,010
-------------+----------------------------------   F(6, 3003)      =     67.29
Model |  2555.48762         6  425.914603   Prob > F        =    0.0000
Residual |  19006.5924     3,003  6.32920161   R-squared       =    0.1185
-------------+----------------------------------   Adj R-squared   =    0.1168
Total |  21562.0801     3,009  7.16586243   Root MSE        =    2.5158
------------------------------------------------------------------------------
ed76 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
age76 |   1.061441   .3013985     3.52   0.000     .4704727     1.65241
age76sq |  -.0187598   .0052314    -3.59   0.000    -.0290173   -.0085024
black |  -1.468367   .1154434   -12.72   0.000    -1.694723   -1.242011
smsa76 |   .8354027   .1092524     7.65   0.000     .6211856     1.04962
south76 |  -.4596997   .1024337    -4.49   0.000    -.6605469   -.2588524
nearc4 |    .347105   .1069972     3.24   0.001     .1373098    .5569002
_cons |  -1.869524   4.298357    -0.43   0.664    -10.29755    6.558497
------------------------------------------------------------------------------

. * Table 5.3 Wage equation estimated by IV

. ivreg lwage76 (ed76=age76 age76sq nearc4) exp76 exp76sq black smsa76 south76
Instrumental variables (2SLS) regression
Source |       SS           df       MS      Number of obs   =     3,010
-------------+----------------------------------   F(6, 3003)      =    204.93
Model |   172.16563         6  28.6942716   Prob > F        =    0.0000
Residual |  420.476016     3,003  .140018653   R-squared       =    0.2905
-------------+----------------------------------   Adj R-squared   =    0.2891
Total |  592.641646     3,009  .196956346   Root MSE        =    .37419
------------------------------------------------------------------------------
lwage76 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
ed76 |    .074009   .0035054    21.11   0.000     .0671357    .0808823
exp76 |   .0835958   .0066478    12.57   0.000     .0705612    .0966305
exp76sq |  -.0022409   .0003178    -7.05   0.000    -.0028641   -.0016177
black |  -.1896315   .0176266   -10.76   0.000    -.2241929   -.1550702
smsa76 |    .161423   .0155733    10.37   0.000     .1308876    .1919583
south76 |  -.1248615   .0151182    -8.26   0.000    -.1545046   -.0952184
_cons |   4.733664   .0676026    70.02   0.000     4.601112    4.866216
------------------------------------------------------------------------------
Instrumented:  ed76
Instruments:   exp76 exp76sq black smsa76 south76 age76 age76sq nearc4
------------------------------------------------------------------------------

. * Table 5.4 OLS results explaining GDP per capita

. u "Data/institutions.dta", clear
. reg loggdp qi latitude
Source |       SS           df       MS      Number of obs   =        64
-------------+----------------------------------   F(2, 61)        =     41.18
Model |  39.3997135         2  19.6998568   Prob > F        =    0.0000
Residual |   29.182005        61  .478393524   R-squared       =    0.5745
-------------+----------------------------------   Adj R-squared   =    0.5605
Total |  68.5817185        63  1.08859871   Root MSE        =    .69166
------------------------------------------------------------------------------
loggdp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
qi |   .4678871   .0641642     7.29   0.000     .3395827    .5961914
latitude |   1.576884     .71031     2.22   0.030     .1565313    2.997237
_cons |   4.728082   .3973208    11.90   0.000      3.93359    5.522574
------------------------------------------------------------------------------
. reg loggdp qi latitude africa asia malfal94
Source |       SS           df       MS      Number of obs   =        62
-------------+----------------------------------   F(5, 56)        =     31.90
Model |  48.1941941         5  9.63883882   Prob > F        =    0.0000
Residual |  16.9204974        56   .30215174   R-squared       =    0.7401
-------------+----------------------------------   Adj R-squared   =    0.7169
Total |  65.1146915        61  1.06745396   Root MSE        =    .54968
------------------------------------------------------------------------------
loggdp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
qi |    .363567   .0562582     6.46   0.000     .2508684    .4762656
latitude |   .2339876   .6253381     0.37   0.710    -1.018715     1.48669
africa |  -.4137759   .2264297    -1.83   0.073    -.8673691    .0398174
asia |  -.4569281   .2205636    -2.07   0.043    -.8987701   -.0150862
malfal94 |  -.7876686   .2775151    -2.84   0.006    -1.343598   -.2317391
_cons |   6.177701   .4035055    15.31   0.000     5.369382     6.98602
------------------------------------------------------------------------------

. * Table 5.5 OLS results reduced form (QI explained from exogenous variables

. reg qi logem4 latitude
Source |       SS           df       MS      Number of obs   =        64
-------------+----------------------------------   F(2, 61)        =     12.82
Model |  40.2217245         2  20.1108623   Prob > F        =    0.0000
Residual |  95.6645164        61  1.56827076   R-squared       =    0.2960
-------------+----------------------------------   Adj R-squared   =    0.2729
Total |  135.886241        63  2.15692446   Root MSE        =    1.2523
------------------------------------------------------------------------------
qi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
logem4 |  -.5102681   .1410186    -3.62   0.001    -.7922521    -.228284
latitude |   2.001775   1.337176     1.50   0.140    -.6720747    4.675624
_cons |   8.529432   .8123128    10.50   0.000     6.905113    10.15375
------------------------------------------------------------------------------
. reg qi logem4 euro1900 latitude
Source |       SS           df       MS      Number of obs   =        63
-------------+----------------------------------   F(3, 59)        =     11.42
Model |  49.7402149         3  16.5800716   Prob > F        =    0.0000
Residual |  85.6315451        59  1.45138212   R-squared       =    0.3674
-------------+----------------------------------   Adj R-squared   =    0.3353
Total |   135.37176        62  2.18341548   Root MSE        =    1.2047
------------------------------------------------------------------------------
qi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
logem4 |  -.3684413   .1485276    -2.48   0.016    -.6656444   -.0712382
euro1900 |   .0211563   .0082455     2.57   0.013     .0046571    .0376554
latitude |   .2004581   1.495034     0.13   0.894    -2.791099    3.192015
_cons |   7.853131   .8308378     9.45   0.000     6.190628    9.515633
------------------------------------------------------------------------------
. reg qi logem4 latitude africa asia malfal94
Source |       SS           df       MS      Number of obs   =        62
-------------+----------------------------------   F(5, 56)        =      5.33
Model |  43.3212268         5  8.66424536   Prob > F        =    0.0004
Residual |  91.0431828        56  1.62577112   R-squared       =    0.3224
-------------+----------------------------------   Adj R-squared   =    0.2619
Total |   134.36441        61  2.20269524   Root MSE        =    1.2751
------------------------------------------------------------------------------
qi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
logem4 |  -.3283306    .199037    -1.65   0.105    -.7270497    .0703885
latitude |   1.887605   1.456952     1.30   0.200    -1.031022    4.806231
africa |   .1351493   .5271787     0.26   0.799    -.9209166    1.191215
asia |   .4874198   .5190193     0.94   0.352    -.5523008     1.52714
malfal94 |   -.774151   .6952049    -1.11   0.270    -2.166814    .6185117
_cons |   7.871536   .9634927     8.17   0.000     5.941428    9.801643
------------------------------------------------------------------------------
. reg qi logem4 euro1900 latitude africa asia malfal94
Source |       SS           df       MS      Number of obs   =        62
-------------+----------------------------------   F(6, 55)        =      8.91
Model |  66.2240621         6  11.0373437   Prob > F        =    0.0000
Residual |  68.1403475        55  1.23891541   R-squared       =    0.4929
-------------+----------------------------------   Adj R-squared   =    0.4375
Total |   134.36441        61  2.20269524   Root MSE        =    1.1131
------------------------------------------------------------------------------
qi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
logem4 |  -.0313996   .1869719    -0.17   0.867    -.4060997    .3433005
euro1900 |   .0437873   .0101841     4.30   0.000     .0233778    .0641967
latitude |  -1.654378    1.51534    -1.09   0.280    -4.691188    1.382431
africa |   1.272259   .5307838     2.40   0.020     .2085447    2.335974
asia |   1.988919   .5720464     3.48   0.001     .8425125    3.135326
malfal94 |  -1.241118   .6165232    -2.01   0.049    -2.476658   -.0055777
_cons |   5.861295   .9623004     6.09   0.000     3.932802    7.789788
------------------------------------------------------------------------------

. * Table 5.6 IV results explaining GDP per capita

. ivreg loggdp (qi=logem4) latitude
Instrumental variables (2SLS) regression
Source |       SS           df       MS      Number of obs   =        64
-------------+----------------------------------   F(2, 61)        =     17.01
Model |  7.02799121         2   3.5139956   Prob > F        =    0.0000
Residual |  61.5537273        61   1.0090775   R-squared       =    0.1025
-------------+----------------------------------   Adj R-squared   =    0.0730
Total |  68.5817185        63  1.08859871   Root MSE        =    1.0045
------------------------------------------------------------------------------
loggdp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
qi |    .995704   .2216816     4.49   0.000     .5524243    1.438984
latitude |  -.6472071   1.335141    -0.48   0.630    -3.316986    2.022572
_cons |   1.691814   1.292985     1.31   0.196    -.8936697    4.277297
------------------------------------------------------------------------------
Instrumented:  qi
Instruments:   latitude logem4
------------------------------------------------------------------------------
. ivreg loggdp (qi=logem4 euro1900) latitude
Instrumental variables (2SLS) regression
Source |       SS           df       MS      Number of obs   =        63
-------------+----------------------------------   F(2, 60)        =     21.67
Model |  11.6179812         2  5.80899058   Prob > F        =    0.0000
Residual |  55.0714197        60  .917856995   R-squared       =    0.1742
-------------+----------------------------------   Adj R-squared   =    0.1467
Total |  66.6894008        62   1.0756355   Root MSE        =    .95805
------------------------------------------------------------------------------
loggdp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
qi |   .9458258   .1733918     5.45   0.000     .5989906    1.292661
latitude |  -.5971357   1.186311    -0.50   0.617    -2.970111    1.775839
_cons |   1.994732   1.017551     1.96   0.055     -.040674    4.030137
------------------------------------------------------------------------------
Instrumented:  qi
Instruments:   latitude logem4 euro1900
------------------------------------------------------------------------------
. ivreg loggdp (qi=logem4) latitude africa asia malfal94
Instrumental variables (2SLS) regression
Source |       SS           df       MS      Number of obs   =        62
-------------+----------------------------------   F(5, 56)        =     10.03
Model |  21.4528204         5  4.29056408   Prob > F        =    0.0000
Residual |  43.6618711        56   .77967627   R-squared       =    0.3295
-------------+----------------------------------   Adj R-squared   =    0.2696
Total |  65.1146915        61  1.06745396   Root MSE        =    .88299
------------------------------------------------------------------------------
loggdp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
qi |   .8928218   .4198073     2.13   0.038     .0518467    1.733797
latitude |  -1.069974   1.424529    -0.75   0.456    -3.923649    1.783701
africa |  -.4452049   .3645429    -1.22   0.227    -1.175472    .2850623
asia |   -.824812   .4546847    -1.81   0.075    -1.735655    .0860309
malfal94 |  -.1057658   .6911819    -0.15   0.879     -1.49037    1.278838
_cons |   2.771564   2.716873     1.02   0.312    -2.670986    8.214114
------------------------------------------------------------------------------
Instrumented:  qi
Instruments:   latitude africa asia malfal94 logem4
------------------------------------------------------------------------------
. ivreg loggdp (qi=logem4 euro1900) latitude africa asia malfal94
Instrumental variables (2SLS) regression
Source |       SS           df       MS      Number of obs   =        62
-------------+----------------------------------   F(5, 56)        =     24.32
Model |  44.9497008         5  8.98994017   Prob > F        =    0.0000
Residual |  20.1649907        56   .36008912   R-squared       =    0.6903
-------------+----------------------------------   Adj R-squared   =    0.6627
Total |  65.1146915        61  1.06745396   Root MSE        =    .60007
------------------------------------------------------------------------------
loggdp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
qi |   .5479184   .1147917     4.77   0.000      .317963    .7778737
latitude |  -.2202115    .723272    -0.30   0.762    -1.669099    1.228676
africa |  -.4247233   .2472542    -1.72   0.091     -.920033    .0705864
asia |  -.5850704   .2500416    -2.34   0.023    -1.085964   -.0841767
malfal94 |  -.5501465   .3277119    -1.68   0.099    -1.206632    .1063394
_cons |   4.991267   .7639299     6.53   0.000     3.460931    6.521602
------------------------------------------------------------------------------
Instrumented:  qi
Instruments:   latitude africa asia malfal94 logem4 euro1900
------------------------------------------------------------------------------

. * Table 5.7 GMM estimation results consumption-based asset pricing model

. log close
name:  SN
log:  \5iexample5_s.smcl
log type:  smcl
closed on:   9 Jun 2020, 23:38:34
----------------------------------------------------------------------------------------------------

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

```