WOOLDRIDGE CROSS-SECTION & PANEL DATA ECONOMETRICS– EXAMPLES

CHAPTER 7 – Systems of Equations

-----------------------------------------------------------------------------------------------
      name:  SN
       log:  myReplications\iiexample7
  log type:  smcl
 opened on:   9 Jun 2019, 18:26:33

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

. * Chapter 7  - Estimating Systems of Equations by OLS and GLS
. * Computer Exercises (Problems)
. ******************** SETUP *********************

. // Example 7.1  NA
. // Example 7.2  NA
. // Example 7.3 (SUR System for Wages and Fringe Benefits)
. bcuse fringe, clear nodesc
. d, short
Contains data from http://fmwww.bc.edu/ec-p/data/wooldridge/fringe.dta
  obs:           616                          
 vars:            39                          26 Jan 2000 12:16
 size:        96,096                          
Sorted by: 
. h sureg
. sureg (hrearn hrbens = edu exper* tenure* union south nrtheast nrthcen married white male)

Seemingly unrelated regression
--------------------------------------------------------------------------
Equation             Obs   Parms        RMSE    "R-sq"       chi2        P
--------------------------------------------------------------------------
hrearn               616      12      4.3089    0.2051     158.93   0.0000
hrbens               616      12    .5152603    0.3987     408.40   0.0000
--------------------------------------------------------------------------

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
hrearn       |
        educ |   .4588139    .068393     6.71   0.000     .3247662    .5928617
       exper |  -.0758428   .0567371    -1.34   0.181    -.1870455    .0353598
     expersq |   .0039945   .0011655     3.43   0.001     .0017102    .0062787
      tenure |   .1100846   .0829207     1.33   0.184     -.052437    .2726062
    tenuresq |  -.0050706   .0032422    -1.56   0.118    -.0114252    .0012839
       union |   .8079933   .4034789     2.00   0.045     .0171892    1.598797
       south |  -.4566222   .5458508    -0.84   0.403     -1.52647    .6132258
    nrtheast |  -1.150759   .5993283    -1.92   0.055     -2.32542    .0239032
     nrthcen |  -.6362663   .5501462    -1.16   0.247    -1.714533    .4420005
     married |   .6423882   .4133664     1.55   0.120     -.167795    1.452571
       white |   1.140891   .6054474     1.88   0.060    -.0457639    2.327546
        male |   1.784702   .3937853     4.53   0.000     1.012897    2.556507
       _cons |  -2.632127   1.215291    -2.17   0.030    -5.014054   -.2501997
-------------+----------------------------------------------------------------
hrbens       |
        educ |   .0767924   .0081785     9.39   0.000     .0607629    .0928219
       exper |   .0225649   .0067846     3.33   0.001     .0092673    .0358626
     expersq |  -.0004734   .0001394    -3.40   0.001    -.0007465   -.0002002
      tenure |   .0535556   .0099157     5.40   0.000     .0341212      .07299
    tenuresq |  -.0011636   .0003877    -3.00   0.003    -.0019235   -.0004038
       union |   .3659085   .0482482     7.58   0.000     .2713438    .4604733
       south |  -.0226865   .0652731    -0.35   0.728    -.1506195    .1052464
    nrtheast |  -.0567468    .071668    -0.79   0.428    -.1972135    .0837198
     nrthcen |  -.0379984   .0657867    -0.58   0.564    -.1669381    .0909413
     married |   .0578626   .0494306     1.17   0.242    -.0390195    .1547447
       white |   .0901582   .0723997     1.25   0.213    -.0517426     .232059
        male |   .2683383    .047089     5.70   0.000     .1760454    .3606311
       _cons |  -.8897471   .1453251    -6.12   0.000    -1.174579   -.6049151
------------------------------------------------------------------------------

. // Example 7.4  NA
. // Example 7.5  NA
. // Example 7.6  NA
. // Example 7.7 (Effects of Job Training Grants on Firm Scrap Rates)
. bcuse jtrain, clear nodesc
. d, short
Contains data from http://fmwww.bc.edu/ec-p/data/wooldridge/jtrain.dta
  obs:           471                          
 vars:            30                          26 Jan 2000 12:16
 size:        56,520                          
Sorted by: 

. reg lscrap d88 d89 grant grant_1

      Source |       SS           df       MS      Number of obs   =       162
-------------+----------------------------------   F(4, 157)       =      0.69
       Model |  6.15830795         4  1.53957699   Prob > F        =    0.5989
    Residual |  349.586765       157  2.22666729   R-squared       =    0.0173
-------------+----------------------------------   Adj R-squared   =   -0.0077
       Total |  355.745073       161  2.20959673   Root MSE        =    1.4922

------------------------------------------------------------------------------
      lscrap |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         d88 |  -.2393704   .3108639    -0.77   0.442    -.8533854    .3746446
         d89 |  -.4965237   .3379281    -1.47   0.144    -1.163996    .1709483
       grant |   .2000196   .3382846     0.59   0.555    -.4681564    .8681957
     grant_1 |   .0489357   .4360663     0.11   0.911    -.8123777    .9102492
       _cons |    .597434    .203063     2.94   0.004     .1963462    .9985218
------------------------------------------------------------------------------

. xtset fcode year
       panel variable:  fcode (strongly balanced)
        time variable:  year, 1987 to 1989
                delta:  1 unit

. xtgls lscrap d88 d89 grant grant_1

Cross-sectional time-series FGLS regression

Coefficients:  generalized least squares
Panels:        homoskedastic
Correlation:   no autocorrelation

Estimated covariances      =         1          Number of obs     =        162
Estimated autocorrelations =         0          Number of groups  =         54
Estimated coefficients     =         5          Time periods      =          3
                                                Wald chi2(4)      =       2.85
Log likelihood             = -292.1696          Prob > chi2       =     0.5826

------------------------------------------------------------------------------
      lscrap |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         d88 |  -.2393704    .306029    -0.78   0.434    -.8391763    .3604354
         d89 |  -.4965237   .3326723    -1.49   0.136    -1.148549     .155502
       grant |   .2000196   .3330232     0.60   0.548    -.4526939    .8527332
     grant_1 |   .0489357   .4292842     0.11   0.909    -.7924458    .8903172
       _cons |    .597434   .1999047     2.99   0.003     .2056279    .9892401
------------------------------------------------------------------------------

. // Example 7.8 (Effect of Being in Season on Grade Point Average)
. u gpa, clear

. d, short

Contains data from gpa.dta
  obs:           732                          
 vars:            26                          2 Sep 1996 22:18
 size:        50,508                          
Sorted by: id  term

. reg trmgpa spring cumgpa crsgpa frstsem season sat verbmath hsperc hssize black female

      Source |       SS           df       MS      Number of obs   =       732
-------------+----------------------------------   F(11, 720)      =     70.64
       Model |  218.156689        11  19.8324263   Prob > F        =    0.0000
    Residual |  202.140267       720  .280750371   R-squared       =    0.5191
-------------+----------------------------------   Adj R-squared   =    0.5117
       Total |  420.296956       731  .574961636   Root MSE        =    .52986

------------------------------------------------------------------------------
      trmgpa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      spring |  -.0121568   .0464813    -0.26   0.794    -.1034118    .0790983
      cumgpa |   .3146158   .0404916     7.77   0.000     .2351201    .3941115
      crsgpa |   .9840371   .0960343    10.25   0.000     .7954964    1.172578
     frstsem |   .7691192   .1204162     6.39   0.000     .5327104    1.005528
      season |  -.0462625   .0470985    -0.98   0.326    -.1387292    .0462042
         sat |   .0014097   .0001464     9.63   0.000     .0011223    .0016972
    verbmath |   -.112616   .1306157    -0.86   0.389    -.3690491    .1438171
      hsperc |  -.0066014   .0010195    -6.48   0.000    -.0086029   -.0045998
      hssize |  -.0000576   .0000994    -0.58   0.562    -.0002527    .0001375
       black |  -.2312855   .0543347    -4.26   0.000    -.3379589   -.1246122
      female |   .2855528   .0509641     5.60   0.000     .1854967    .3856089
       _cons |  -2.067599   .3381007    -6.12   0.000    -2.731381   -1.403818
------------------------------------------------------------------------------

. xtset id term
       panel variable:  id (strongly balanced)
        time variable:  term, 8808 to 8901, but with gaps
                delta:  1 unit

. xtgls trmgpa spring cumgpa crsgpa frstsem season sat verbmath hsperc hssize black female

Cross-sectional time-series FGLS regression

Coefficients:  generalized least squares
Panels:        homoskedastic
Correlation:   no autocorrelation

Estimated covariances      =         1          Number of obs     =        732
Estimated autocorrelations =         0          Number of groups  =        366
Estimated coefficients     =        12          Time periods      =          2
                                                Wald chi2(11)     =     790.00
Log likelihood             = -567.6874          Prob > chi2       =     0.0000

------------------------------------------------------------------------------
      trmgpa |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      spring |  -.0121568   .0460987    -0.26   0.792    -.1025086     .078195
      cumgpa |   .3146158   .0401583     7.83   0.000     .2359069    .3933247
      crsgpa |   .9840371   .0952439    10.33   0.000     .7973625    1.170712
     frstsem |   .7691192   .1194251     6.44   0.000     .5350503    1.003188
      season |  -.0462625   .0467108    -0.99   0.322     -.137814     .045289
         sat |   .0014097   .0001452     9.71   0.000     .0011251    .0016943
    verbmath |   -.112616   .1295406    -0.87   0.385     -.366511    .1412789
      hsperc |  -.0066014   .0010111    -6.53   0.000    -.0085831   -.0046196
      hssize |  -.0000576   .0000986    -0.58   0.559    -.0002508    .0001356
       black |  -.2312855   .0538875    -4.29   0.000     -.336903    -.125668
      female |   .2855528   .0505447     5.65   0.000      .186487    .3846185
       _cons |  -2.067599   .3353179    -6.17   0.000    -2.724811   -1.410388
------------------------------------------------------------------------------

. // Example 7.9 (Athletes’ Grade Point Averages, continued)
. u gpa, clear
. qui reg trmgpa spring cumgpa crsgpa frstsem season sat verbmath hsperc hssize black female
. predict u, r
. by id: g u_1 = u[_n-1]
(366 missing values generated)

. reg trmgpa cumgpa crsgpa season sat verbmath hsperc hssize black female u_1

      Source |       SS           df       MS      Number of obs   =       366
-------------+----------------------------------   F(10, 355)      =     56.83
       Model |  133.915693        10  13.3915693   Prob > F        =    0.0000
    Residual |  83.6475687       355  .235626954   R-squared       =    0.6155
-------------+----------------------------------   Adj R-squared   =    0.6047
       Total |  217.563261       365   .59606373   Root MSE        =    .48541

------------------------------------------------------------------------------
      trmgpa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      cumgpa |   .3488556   .0720263     4.84   0.000     .2072037    .4905075
      crsgpa |    1.00062    .117679     8.50   0.000     .7691844    1.232056
      season |  -.0271035   .0579515    -0.47   0.640     -.141075     .086868
         sat |   .0014126   .0001991     7.09   0.000      .001021    .0018042
    verbmath |  -.1136652   .1702718    -0.67   0.505    -.4485335    .2212032
      hsperc |  -.0049537   .0014175    -3.49   0.001    -.0077415    -.002166
      hssize |  -.0000843   .0001289    -0.65   0.513    -.0003378    .0001691
       black |  -.2407423   .0706801    -3.41   0.001    -.3797466    -.101738
      female |    .291915   .0732572     3.98   0.000     .1478423    .4359876
         u_1 |   .1941929   .0612068     3.17   0.002     .0738194    .3145664
       _cons |  -2.266297   .4246611    -5.34   0.000    -3.101465   -1.431129
------------------------------------------------------------------------------

. reg u u_1

      Source |       SS           df       MS      Number of obs   =       366
-------------+----------------------------------   F(1, 364)       =     22.04
       Model |  5.08904838         1  5.08904838   Prob > F        =    0.0000
    Residual |  84.0489742       364  .230903775   R-squared       =    0.0571
-------------+----------------------------------   Adj R-squared   =    0.0545
       Total |  89.1380225       365   .24421376   Root MSE        =    .48052

------------------------------------------------------------------------------
           u |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         u_1 |   .2122144   .0452035     4.69   0.000     .1233216    .3011071
       _cons |   3.16e-10   .0251174     0.00   1.000    -.0493935    .0493935
------------------------------------------------------------------------------
. log close 
      name:  SN
       log:  myReplications\iiexample7
  log type:  smcl
 closed on:   9 Jun 2019, 18:26:36
-----------------------------------------------------------------------------------------------
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *