Chapter 16 Simultaneous Equations - Examples

-------------------------------------------------------------------------------------
      name:  SN
       log:  ~Wooldridge\intro-econx\iexample16.smcl
  log type:  smcl
 opened on:  18 Jan 2019, 20:50:29

. **********************************************
. * Solomon Negash - Replicating Examples
. * Wooldridge (2016). Introductory Econometrics: A Modern Approach. 6th ed.  
. * STATA Program, version 15.1. 

. * CHAPTER 16 Simultaneous Equations Models
. * Computer Exercises (Examples)
. ******************** SETUP *********************

. *Example 16.1. Murder Rates and Size of the Police Force
. //NA

. *Example 16.2. Housing Expenditures and Saving
. //NA

. *Example 16.3. Labor Supply of Married, Working Women
. //NA

. *Example 16.4. Inflation and Openness
. //NA

. *Example 16.5. Labor Supply of Married, Working Women

. u mroz, clear
. ivreg hours (lwage=exper*) educ age kidslt6 nwifeinc

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       428
-------------+----------------------------------   F(5, 422)       =      3.44
       Model |  -516582103         5  -103316421   Prob > F        =    0.0046
    Residual |   773893123       422  1833869.96   R-squared       =         .
-------------+----------------------------------   Adj R-squared   =         .
       Total |   257311020       427   602601.92   Root MSE        =    1354.2

------------------------------------------------------------------------------
       hours |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       lwage |   1639.556   470.5757     3.48   0.001     714.5914     2564.52
        educ |  -183.7513   59.09981    -3.11   0.002    -299.9179   -67.58462
         age |  -7.806092   9.378013    -0.83   0.406    -26.23953    10.62734
     kidslt6 |  -198.1543   182.9291    -1.08   0.279    -557.7201    161.4115
    nwifeinc |  -10.16959   6.614743    -1.54   0.125    -23.17154    2.832358
       _cons |   2225.662   574.5641     3.87   0.000     1096.298    3355.026
------------------------------------------------------------------------------
Instrumented:  lwage
Instruments:   educ age kidslt6 nwifeinc exper expersq
------------------------------------------------------------------------------

. ivreg lwage (hours= age kidslt6 nwifeinc) educ exper*  

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       428
-------------+----------------------------------   F(4, 423)       =     19.03
       Model |  28.0618831         4  7.01547077   Prob > F        =    0.0000
    Residual |  195.265558       423  .461620704   R-squared       =    0.1257
-------------+----------------------------------   Adj R-squared   =    0.1174
       Total |  223.327441       427  .523015084   Root MSE        =    .67943

------------------------------------------------------------------------------
       lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       hours |   .0001259   .0002546     0.49   0.621    -.0003746    .0006264
        educ |     .11033   .0155244     7.11   0.000     .0798155    .1408445
       exper |   .0345824   .0194916     1.77   0.077      -.00373    .0728947
     expersq |  -.0007058   .0004541    -1.55   0.121    -.0015983    .0001868
       _cons |  -.6557254   .3377883    -1.94   0.053    -1.319678    .0082272
------------------------------------------------------------------------------
Instrumented:  hours
Instruments:   educ exper expersq age kidslt6 nwifeinc
------------------------------------------------------------------------------

. *Example 16.6. Inflation and Openness

. u openness, clear
. reg open lpcinc lland

      Source |       SS           df       MS      Number of obs   =       114
-------------+----------------------------------   F(2, 111)       =     45.17
       Model |  28606.1936         2  14303.0968   Prob > F        =    0.0000
    Residual |  35151.7966       111  316.682852   R-squared       =    0.4487
-------------+----------------------------------   Adj R-squared   =    0.4387
       Total |  63757.9902       113  564.230002   Root MSE        =    17.796

------------------------------------------------------------------------------
        open |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      lpcinc |   .5464812    1.49324     0.37   0.715    -2.412473    3.505435
       lland |  -7.567103   .8142162    -9.29   0.000    -9.180527   -5.953679
       _cons |   117.0845    15.8483     7.39   0.000     85.68005     148.489
------------------------------------------------------------------------------

. ivreg inf (open=lland) lpcinc

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       114
-------------+----------------------------------   F(2, 111)       =      2.79
       Model |  2009.22775         2  1004.61387   Prob > F        =    0.0657
    Residual |   63064.194       111  568.145892   R-squared       =    0.0309
-------------+----------------------------------   Adj R-squared   =    0.0134
       Total |  65073.4217       113  575.870989   Root MSE        =    23.836

------------------------------------------------------------------------------
         inf |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        open |  -.3374871   .1441212    -2.34   0.021    -.6230728   -.0519014
      lpcinc |   .3758247   2.015081     0.19   0.852    -3.617192    4.368842
       _cons |   26.89934    15.4012     1.75   0.083    -3.619162    57.41783
------------------------------------------------------------------------------
Instrumented:  open
Instruments:   lpcinc lland
------------------------------------------------------------------------------

. *Example 16.7. Testing the Permanent Income Hypothesis

. u consump, clear
. ivreg gc (gy r3 =gy_1 gc_1 r3_1) 

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =        35
-------------+----------------------------------   F(2, 32)        =      9.59
       Model |   .00375939         2  .001879695   Prob > F        =    0.0005
    Residual |  .001786211        32  .000055819   R-squared       =    0.6779
-------------+----------------------------------   Adj R-squared   =    0.6578
       Total |  .005545602        34  .000163106   Root MSE        =    .00747

------------------------------------------------------------------------------
          gc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          gy |    .586188   .1345737     4.36   0.000     .3120703    .8603057
          r3 |  -.0002694    .000764    -0.35   0.727    -.0018257    .0012869
       _cons |   .0080597   .0032327     2.49   0.018     .0014748    .0146446
------------------------------------------------------------------------------
Instrumented:  gy r3
Instruments:   gy_1 gc_1 r3_1
------------------------------------------------------------------------------

. predict u, res
(1 missing value generated)
. g u_1 = u[_n-1]
(2 missing values generated)
. reg u u_1

      Source |       SS           df       MS      Number of obs   =        35
-------------+----------------------------------   F(1, 33)        =      0.37
       Model |   .00001996         1   .00001996   Prob > F        =    0.5456
    Residual |  .001766252        33  .000053523   R-squared       =    0.0112
-------------+----------------------------------   Adj R-squared   =   -0.0188
       Total |  .001786211        34  .000052536   Root MSE        =    .00732

------------------------------------------------------------------------------
           u |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         u_1 |  -.1083367   .1774061    -0.61   0.546    -.4692721    .2525987
       _cons |   .0000353    .001238     0.03   0.977    -.0024833     .002554
------------------------------------------------------------------------------

. ivreg gc (gy r3 =gy_1 gc_1 r3_1) u_1 

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =        35
-------------+----------------------------------   F(3, 31)        =      4.10
       Model |  .002572473         3  .000857491   Prob > F        =    0.0146
    Residual |  .002973128        31  .000095907   R-squared       =    0.4639
-------------+----------------------------------   Adj R-squared   =    0.4120
       Total |  .005545602        34  .000163106   Root MSE        =    .00979

------------------------------------------------------------------------------
          gc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          gy |   .9826985   .4108234     2.39   0.023     .1448188    1.820578
          r3 |  -.0004122   .0010104    -0.41   0.686    -.0024729    .0016485
         u_1 |  -.5945359   .5563222    -1.07   0.293    -1.729162    .5400906
       _cons |  -.0003251   .0089171    -0.04   0.971    -.0185116    .0178613
------------------------------------------------------------------------------
Instrumented:  gy r3
Instruments:   u_1 gy_1 gc_1 r3_1
------------------------------------------------------------------------------

. *Example 16.8. Effect of Prison Population on Violent Crime Rates

. u prison, clear
. local z "gpolpc gincpc cunem cblack cmetro cag0_14 cag15_17 cag18_24 cag25_34"
. ivreg gcriv (gpris = final1 final2) `z' 

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       714
-------------+----------------------------------   F(10, 703)      =      5.85
       Model | -1.36845909        10 -.136845909   Prob > F        =    0.0000
    Residual |  6.95996591       703  .009900378   R-squared       =         .
-------------+----------------------------------   Adj R-squared   =         .
       Total |  5.59150682       713  .007842226   Root MSE        =     .0995

------------------------------------------------------------------------------
       gcriv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       gpris |  -.9672195   .3523958    -2.74   0.006    -1.659094   -.2753452
      gpolpc |   .0734676   .0695233     1.06   0.291    -.0630305    .2099657
      gincpc |   .9258682   .1792322     5.17   0.000     .5739738    1.277763
       cunem |   .7298841   .3575983     2.04   0.042     .0277955    1.431973
      cblack |   -.014733   .0417904    -0.35   0.725     -.096782     .067316
      cmetro |  -1.151343    1.27324    -0.90   0.366    -3.651151    1.348465
     cag0_14 |   3.170223   2.303884     1.38   0.169    -1.353095     7.69354
    cag15_17 |   6.660936   4.365506     1.53   0.128    -1.910054    15.23193
    cag18_24 |  -.9192407   2.668297    -0.34   0.731    -6.158027    4.319546
    cag25_34 |   -4.36946   2.044066    -2.14   0.033    -8.382667   -.3562544
       _cons |   .0363202   .0243393     1.49   0.136    -.0114662    .0841066
------------------------------------------------------------------------------
Instrumented:  gpris
Instruments:   gpolpc gincpc cunem cblack cmetro cag0_14 cag15_17 cag18_24
               cag25_34 final1 final2
------------------------------------------------------------------------------

. reg gcriv gpris `z'

      Source |       SS           df       MS      Number of obs   =       714
-------------+----------------------------------   F(10, 703)      =      8.30
       Model |  .590554686        10  .059055469   Prob > F        =    0.0000
    Residual |  5.00095213       703   .00711373   R-squared       =    0.1056
-------------+----------------------------------   Adj R-squared   =    0.0929
       Total |  5.59150682       713  .007842226   Root MSE        =    .08434

------------------------------------------------------------------------------
       gcriv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       gpris |  -.1677959   .0481734    -3.48   0.001    -.2623768    -.073215
      gpolpc |   .0937815   .0584542     1.60   0.109    -.0209842    .2085472
      gincpc |    .960266   .1513979     6.34   0.000     .6630198    1.257512
       cunem |   .4068081   .2787272     1.46   0.145    -.1404294    .9540455
      cblack |  -.0112602    .035401    -0.32   0.751    -.0807646    .0582441
      cmetro |  -.3920305   1.042321    -0.38   0.707    -2.438465    1.654404
     cag0_14 |   4.293246   1.908499     2.25   0.025     .5462043    8.040287
    cag15_17 |   12.89848   2.898712     4.45   0.000     7.207309    18.58965
    cag18_24 |   1.814609   2.024703     0.90   0.370     -2.16058    5.789798
    cag25_34 |  -2.561833   1.599319    -1.60   0.110    -5.701847    .5781803
       _cons |  -.0051469   .0138499    -0.37   0.710    -.0323391    .0220452
------------------------------------------------------------------------------

. log close
      name:  SN
       log:  ~Wooldridge\intro-econx\iexample16.smcl
  log type:  smcl
 closed on:  18 Jan 2019, 20:50:29
-------------------------------------------------------------------------------------