WOOLDRIDGE CROSS-SECTION & PANEL DATA ECONOMETRICS– EXAMPLES

CHAPTER 5 – Instrumental Variables Estimation of Single-Equation Linear Models

------------------------------------------------------------------------------------------
       name:  SN
       log:  myReplications\iiexample5
  log type:  smcl
 opened on:   5 Jun 2019, 22:10:25

. **********************************************
. * Solomon Negash - Examples
. * Wooldridge (2016). Economic Analysis of Cross-Section and Panel Data. 2nd ed.  
. * STATA Program, version 15.1. 

. * Chapter 5  - IV estimation of Single-Equation Linear Models
. * Computer Exercises (Problems)
. ******************** SETUP *********************
. //Chap5 Examples - IV Estimation of Single-Equation Linear Models
. //Example 5.1   NA
. //Example 5.2   NA
. //Example 5.3 Parents’ and Husband’s Education as IVs 
. bcuse mroz, clear nodesc
. reg lwage exper expersq educ

      Source |       SS           df       MS      Number of obs   =       428
-------------+----------------------------------   F(3, 424)       =     26.29
       Model |  35.0223023         3  11.6741008   Prob > F        =    0.0000
    Residual |  188.305149       424  .444115917   R-squared       =    0.1568
-------------+----------------------------------   Adj R-squared   =    0.1509
       Total |  223.327451       427  .523015108   Root MSE        =    .66642

------------------------------------------------------------------------------
       lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       exper |   .0415665   .0131752     3.15   0.002     .0156697    .0674633
     expersq |  -.0008112   .0003932    -2.06   0.040    -.0015841   -.0000382
        educ |   .1074896   .0141465     7.60   0.000     .0796837    .1352956
       _cons |  -.5220407   .1986321    -2.63   0.009    -.9124668   -.1316145
------------------------------------------------------------------------------

. ivreg lwage exper expersq (educ=mothedu fatheduc huseduc)

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       428
-------------+----------------------------------   F(3, 424)       =     11.52
       Model |  33.3927427         3  11.1309142   Prob > F        =    0.0000
    Residual |  189.934709       424  .447959218   R-squared       =    0.1495
-------------+----------------------------------   Adj R-squared   =    0.1435
       Total |  223.327451       427  .523015108   Root MSE        =     .6693

------------------------------------------------------------------------------
       lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        educ |   .0803918    .021774     3.69   0.000     .0375934    .1231901
       exper |   .0430973   .0132649     3.25   0.001     .0170242    .0691704
     expersq |  -.0008628   .0003962    -2.18   0.030    -.0016415   -.0000841
       _cons |  -.1868574   .2853959    -0.65   0.513    -.7478243    .3741096
------------------------------------------------------------------------------
Instrumented:  educ
Instruments:   exper expersq motheduc fatheduc huseduc
------------------------------------------------------------------------------

. test educ

 ( 1)  educ = 0

       F(  1,   424) =   13.63
            Prob > F =    0.0003


. //Example 5.4 Parents’ and Husband’s Education as IVs, cont'd
. //F-test 
. bcuse mroz, clear nodesc
. ivreg lwage exper expersq (educ=mothedu fatheduc huseduc) kidslt6 kidsge6

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       428
-------------+----------------------------------   F(5, 422)       =      7.08
       Model |  33.6045899         5  6.72091798   Prob > F        =    0.0000
    Residual |  189.722861       422   .44958024   R-squared       =    0.1505
-------------+----------------------------------   Adj R-squared   =    0.1404
       Total |  223.327451       427  .523015108   Root MSE        =    .67051

------------------------------------------------------------------------------
       lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        educ |   .0798678   .0223575     3.57   0.000      .035922    .1238137
       exper |   .0414939   .0134453     3.09   0.002     .0150658    .0679221
     expersq |  -.0008576   .0003972    -2.16   0.031    -.0016384   -.0000768
     kidslt6 |  -.0313333   .0861049    -0.36   0.716    -.2005811    .1379146
     kidsge6 |  -.0182225   .0271427    -0.67   0.502    -.0715741    .0351292
       _cons |  -.1315326   .3038534    -0.43   0.665    -.7287873    .4657221
------------------------------------------------------------------------------
Instrumented:  educ
Instruments:   exper expersq kidslt6 kidsge6 motheduc fatheduc huseduc
------------------------------------------------------------------------------

. test kidslt6 kidsge6

 ( 1)  kidslt6 = 0
 ( 2)  kidsge6 = 0

       F(  2,   422) =    0.31
            Prob > F =    0.7368

. //LM test
. qui ivreg lwage exper expersq (educ=mothedu fatheduc huseduc)
. predict u2, residuals
(325 missing values generated)

. qui ivreg u2 exper expersq (educ=mothedu fatheduc huseduc) kidslt6 kidsge6

. display "LM = " e(N)* e(r2) " & p = " chi2tail(2, e(r2)*e(N))
LM = .47737781 & p = .78765988


. // Hetroskedasticity-Robust Inference pp106
. ivreg lwage exper expersq (educ=mothedu fatheduc huseduc), r

Instrumental variables (2SLS) regression        Number of obs     =        428
                                                F(3, 424)         =       9.19
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1495
                                                Root MSE          =      .6693

------------------------------------------------------------------------------
             |               Robust
       lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        educ |   .0803918   .0217033     3.70   0.000     .0377323    .1230512
       exper |   .0430973   .0153064     2.82   0.005     .0130114    .0731832
     expersq |  -.0008628   .0004217    -2.05   0.041    -.0016916    -.000034
       _cons |  -.1868574   .3012625    -0.62   0.535    -.7790113    .4052966
------------------------------------------------------------------------------
Instrumented:  educ
Instruments:   exper expersq motheduc fatheduc huseduc
------------------------------------------------------------------------------

. //Hteroskedasticity robust F test, page 107 (F=.25 & p-value=.781)
. ivreg lwage exper* (edu=mothedu fathed hused) kids*, r

Instrumental variables (2SLS) regression        Number of obs     =        428
                                                F(5, 422)         =       5.96
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1505
                                                Root MSE          =     .67051

------------------------------------------------------------------------------
             |               Robust
       lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        educ |   .0798678   .0224613     3.56   0.000     .0357179    .1240177
       exper |   .0414939   .0154463     2.69   0.008     .0111328    .0718551
     expersq |  -.0008576   .0004212    -2.04   0.042    -.0016856   -.0000297
     kidslt6 |  -.0313333   .1013967    -0.31   0.757    -.2306389    .1679723
     kidsge6 |  -.0182225   .0283579    -0.64   0.521    -.0739629    .0375179
       _cons |  -.1315326    .320634    -0.41   0.682    -.7617712     .498706
------------------------------------------------------------------------------
Instrumented:  educ
Instruments:   exper expersq kidslt6 kidsge6 motheduc fatheduc huseduc
------------------------------------------------------------------------------

. test kidslt kidsg

 ( 1)  kidslt6 = 0
 ( 2)  kidsge6 = 0

       F(  2,   422) =    0.25
            Prob > F =    0.7812


. //LM test page 107 
. ivreg lwage exper* (edu=mothedu fathed hused),

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       428
-------------+----------------------------------   F(3, 424)       =     11.52
       Model |  33.3927427         3  11.1309142   Prob > F        =    0.0000
    Residual |  189.934709       424  .447959218   R-squared       =    0.1495
-------------+----------------------------------   Adj R-squared   =    0.1435
       Total |  223.327451       427  .523015108   Root MSE        =     .6693

------------------------------------------------------------------------------
       lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        educ |   .0803918    .021774     3.69   0.000     .0375934    .1231901
       exper |   .0430973   .0132649     3.25   0.001     .0170242    .0691704
     expersq |  -.0008628   .0003962    -2.18   0.030    -.0016415   -.0000841
       _cons |  -.1868574   .2853959    -0.65   0.513    -.7478243    .3741096
------------------------------------------------------------------------------
Instrumented:  educ
Instruments:   exper expersq motheduc fatheduc huseduc
------------------------------------------------------------------------------

. predict u, residual
(325 missing values generated)

. foreach x of var kidslt kidsg{ 
  2. ivreg `x' exper* (edu=mothedu fathed hused)  
  3. predict r_`x', residual
  4. gen ures`x'= u*r_`x'
  5. }

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       753
-------------+----------------------------------   F(3, 749)       =     14.83
       Model |  9.46507581         3  3.15502527   Prob > F        =    0.0000
    Residual |  196.983795       749  .262995721   R-squared       =    0.0458
-------------+----------------------------------   Adj R-squared   =    0.0420
       Total |  206.448871       752  .274533073   Root MSE        =    .51283

------------------------------------------------------------------------------
     kidslt6 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        educ |   .0472331   .0122358     3.86   0.000     .0232126    .0712536
       exper |  -.0164951   .0067825    -2.43   0.015    -.0298101   -.0031801
     expersq |   .0001038   .0002183     0.48   0.635    -.0003248    .0005324
       _cons |  -.1857562   .1492894    -1.24   0.214    -.4788317    .1073193
------------------------------------------------------------------------------
Instrumented:  educ
Instruments:   exper expersq motheduc fatheduc huseduc
------------------------------------------------------------------------------
(325 missing values generated)

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       753
-------------+----------------------------------   F(3, 749)       =     25.64
       Model |  123.638191         3  41.2127304   Prob > F        =    0.0000
    Residual |  1186.39634       749  1.58397375   R-squared       =    0.0944
-------------+----------------------------------   Adj R-squared   =    0.0908
       Total |  1310.03453       752  1.74206719   Root MSE        =    1.2586

------------------------------------------------------------------------------
     kidsge6 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        educ |  -.0150236   .0300284    -0.50   0.617    -.0739734    .0439262
       exper |  -.0233173   .0166452    -1.40   0.162    -.0559942    .0093595
     expersq |  -.0008754   .0005358    -1.63   0.103    -.0019273    .0001765
       _cons |   1.941585   .3663774     5.30   0.000     1.222336    2.660834
------------------------------------------------------------------------------
Instrumented:  educ
Instruments:   exper expersq motheduc fatheduc huseduc
------------------------------------------------------------------------------
(325 missing values generated)

. gen one=1

. reg one ures*, noc 

      Source |       SS           df       MS      Number of obs   =       428
-------------+----------------------------------   F(2, 426)       =      0.43
       Model |  .867685628         2  .433842814   Prob > F        =    0.6490
    Residual |  427.132314       426  1.00265801   R-squared       =    0.0020
-------------+----------------------------------   Adj R-squared   =   -0.0027
       Total |         428       428           1   Root MSE        =    1.0013

------------------------------------------------------------------------------
         one |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 ureskidslt6 |  -.1150184   .1606478    -0.72   0.474    -.4307793    .2007425
 ureskidsge6 |  -.0284026    .056554    -0.50   0.616    -.1395622    .0827569
------------------------------------------------------------------------------

. display "LM= N-SSRo = " e(N)-e(rss) " & p = " chi2tail(3, e(N)-e(rss))
LM= N-SSRo = .86768563 & p = .83321816


. //Example 5.5 IQ and KWW as indicator of Ability 
. bcuse nls80, clear nodesc
. ivreg lwage exper tenur marri south urban black edu (iq=kww)

Instrumental variables (2SLS) regression

      Source |       SS           df       MS      Number of obs   =       935
-------------+----------------------------------   F(8, 926)       =     36.96
       Model |  31.4665121         8  3.93331401   Prob > F        =    0.0000
    Residual |  134.189771       926   .14491336   R-squared       =    0.1900
-------------+----------------------------------   Adj R-squared   =    0.1830
       Total |  165.656283       934  .177362188   Root MSE        =    .38067

------------------------------------------------------------------------------
       lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          iq |   .0130473   .0049341     2.64   0.008     .0033641    .0227305
       exper |     .01442   .0033208     4.34   0.000     .0079029    .0209371
      tenure |   .0104562   .0026012     4.02   0.000     .0053512    .0155612
     married |   .2006903   .0406775     4.93   0.000     .1208595    .2805211
       south |  -.0515532   .0311279    -1.66   0.098    -.1126426    .0095361
       urban |   .1767058   .0282117     6.26   0.000     .1213394    .2320722
       black |  -.0225612   .0739597    -0.31   0.760    -.1677093    .1225869
        educ |   .0250321   .0166068     1.51   0.132    -.0075591    .0576234
       _cons |   4.592453   .3257807    14.10   0.000     3.953099    5.231807
------------------------------------------------------------------------------
Instrumented:  iq
Instruments:   exper tenure married south urban black educ kww
------------------------------------------------------------------------------
. log close 
      name:  SN
       log:  myReplications\iiexample5
  log type:  smcl
 closed on:   5 Jun 2019, 22:10:27
------------------------------------------------------------------------------------------
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.