UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS Textbook Examples
Econometric Analysis, Fourth Edition by Greene
Chapter 16: Simultaneous Equations Models

Example 16. 1

Comparing the ordinary least square regression with the instrumental variable estimator.
data example16_1;
input Year    Q     P     L    NptCost  CPI    Income;
cards; 
    1960    72    51    24     46     88.7     6036    
    1961    70    52    25     46     89.6     6113    
    1962    71    54    26     47     90.6     6271    
    1963    74    55    27     47     91.7     6378    
    1964    72    55    29     47     92.9     6727    
    1965    76    53    31     48     94.5     7027    
    1966    73    55    33     50     97.2     7280    
    1967    77    52    35     50    100.0     7513    
    1968    79    52    38     50    104.2     7728    
    1969    80    50    40     52    109.8     7891    
    1970    77    52    42     54    116.3     8134    
    1971    86    56    43     57    121.3     8322    
    1972    87    60    47     61    125.3     8562    
    1973    92    91    53     73    133.1     9042    
    1974    84   117    66     83    147.7     8867    
    1975    93   105    75     91    161.2     8944    
    1976    92   102    86     97    170.5     9175    
    1977   100   100   100    100    181.5     9381    
    1978   102   105   109    108    195.4     9735    
    1979   113   116   125    125    217.4     9829    
    1980   101   125   145    138    246.8     9722    
    1981   117   134   158    148    272.4     9769    
    1982   117   121   157    150    289.1     9725    
    1983    88   128   148    153    298.4     9930    
    1984   111   139   146    155    311.1    10421    
    1985   117   120   128    151    322.2    10563    
    1986   108   106   112    146    328.4    10780    
;
run;
proc reg data=example16_1;
  model q=p;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: Q

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F

Model                     1     4918.74252     4918.74252      71.57    <.0001
Error                    25     1718.22044       68.72882
Corrected Total          26     6636.96296

Root MSE              8.29028    R-Square     0.7411
Dependent Mean       89.96296    Adj R-Sq     0.7308
Coeff Var             9.21522

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|

Intercept     1       54.13198        4.52600      11.96      <.0001
P             1        0.41953        0.04959       8.46      <.0001
proc model data=example16_1;
      q = intercept + P_co * p;
      fit q /n2sls vardef=N;
      instruments income ;
   run;
quit;
The MODEL Procedure

                       Nonlinear 2SLS Summary of Residual Errors

                   DF       DF                                                        Adj
Equation        Model    Error         SSE         MSE    Root MSE    R-Square       R-Sq

Q                   2       25      1916.7     70.9877      8.4254      0.7112     0.6997

             Nonlinear 2SLS Parameter Estimates

                              Approx                  Approx
Parameter       Estimate     Std Err    t Value     Pr > |t|

intercept       46.93491      5.1954       9.03       <.0001
P_co            0.503798      0.0578       8.72       <.0001

Number of Observations     Statistics for System

Used                27    Objective      5.971E-26
Missing              0    Objective*N    1.612E-24

Table 16.4 Single-Equation Estimates of Klein's Consumption Function

On page 687 with four difference estimates for Klein's model.
data klein;
input Year C P Wp I  Klag  X   Wg  G  T   ;
cards;
1920 39.8 12.7 28.8  2.7 180.1 44.9 2.2  2.4  3.4
1921 41.9 12.4 25.5 -0.2 182.8 45.6 2.7  3.9  7.7
1922 45.0 16.9 29.3  1.9 182.6 50.1 2.9  3.2  3.9
1923 49.2 18.4 34.1  5.2 184.5 57.2 2.9  2.8  4.7
1924 50.6 19.4 33.9  3.0 189.7 57.1 3.1  3.5  3.8
1925 52.6 20.1 35.4  5.1 192.7 61.0 3.2  3.3  5.5
1926 55.1 19.6 37.4  5.6 197.8 64.0 3.3  3.3  7.0
1927 56.2 19.8 37.9  4.2 203.4 64.4 3.6  4.0  6.7
1928 57.3 21.1 39.2  3.0 207.6 64.5 3.7  4.2  4.2
1929 57.8 21.7 41.3  5.1 210.6 67.0 4.0  4.1  4.0
1930 55.0 15.6 37.9  1.0 215.7 61.2 4.2  5.2  7.7
1931 50.9 11.4 34.5 -3.4 216.7 53.4 4.8  5.9  7.5
1932 45.6  7.0 29.0 -6.2 213.3 44.3 5.3  4.9  8.3
1933 46.5 11.2 28.5 -5.1 207.1 45.1 5.6  3.7  5.4
1934 48.7 12.3 30.6 -3.0 202.0 49.7 6.0  4.0  6.8
1935 51.3 14.0 33.2 -1.3 199.0 54.4 6.1  4.4  7.2
1936 57.7 17.6 36.8  2.1 197.7 62.7 7.4  2.9  8.3
1937 58.7 17.3 41.0  2.0 199.8 65.0 6.7  4.3  6.7
1938 57.5 15.3 38.2 -1.9 201.8 60.9 7.7  5.3  7.4
1939 61.6 19.0 41.6  1.3 199.9 69.5 7.8  6.6  8.9
1940 65.0 21.1 45.0  3.3 201.2 75.7 8.0  7.4  9.6
1941 69.7 23.5 53.3  4.9 204.5 88.4 8.5 13.8 11.6
;
run;

data klein;
  set klein;
  W=Wp+Wg;
  A=Year-1931;
  Plag=lag(P);
  Xlag=lag(X);
  Y=C + I + G - T;
run;

/*OLS Estimate*/
proc reg data=klein;
  model C = P Plag W;
run;
quit;

The REG Procedure
Model: MODEL1
Dependent Variable: C

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F

Model                     3      923.55008      307.85003     292.71    <.0001
Error                    17       17.87945        1.05173
Corrected Total          20      941.42952


Root MSE              1.02554    R-Square     0.9810
Dependent Mean       53.99524    Adj R-Sq     0.9777
Coeff Var             1.89932


                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|

Intercept     1       16.23660        1.30270      12.46      <.0001
P             1        0.19293        0.09121       2.12      0.0495
Plag          1        0.08988        0.09065       0.99      0.3353
W             1        0.79622        0.03994      19.93      <.0001

/* 2sls Estimate*/
proc model data=klein;
      C = cons_c + P_c * P + Plag_c * Plag + W_c*W;
      ENDOGENOUS W P X;
      EXOGENOUS T Wg G;
      fit C  /n2sls  vardef=N;
      instruments G T A Wg Plag Klag Xlag ;
   run;
quit;

The MODEL Procedure

                       Nonlinear 2SLS Summary of Residual Errors

                   DF       DF                                                        Adj
Equation        Model    Error         SSE         MSE    Root MSE    R-Square       R-Sq

C                   4       17     21.9252      1.0441      1.0218      0.9767     0.9726

             Nonlinear 2SLS Parameter Estimates

                              Approx                  Approx
Parameter       Estimate     Std Err    t Value     Pr > |t|

cons_c          16.55476      1.3208      12.53       <.0001
P_c             0.017302      0.1180       0.15       0.8852
Plag_c          0.216234      0.1073       2.02       0.0599
W_c             0.810183      0.0402      20.13       <.0001


Number of Observations     Statistics for System

Used                21    Objective         0.4361
Missing              1    Objective*N       9.1580

/* GMM(H2sls)*/
proc model data=klein;
      C = cons_c + P_c * P + Plag_c * Plag + W_c*W;
      fit C /n2sls  outv=vdata;
      instruments G T A Wg Plag Klag Xlag ;
   run;
quit;

data vblkdiag;
  set vdata;
  if (eq_row ^= eq_col) then value=0; /* create block-diagonal V */
run;

/*use the block-diagonal in gmm*/
proc model data=klein OUTPARMS=parm1;
      C = cons_c + P_c * P + Plag_c * Plag + W_c*W;
      fit C / gmm vdata=vblkdiag;
      instruments  G T A Wg Plag Klag Xlag ;
run;
quit;
/*use the parameter estimate from the previous model as the initial estimate*/
proc model data=klein;
      C = cons_c + P_c * P + Plag_c * Plag + W_c*W;
      fit C /estdata=parm1 no2sls gmm kernel=(bart,0,) vardef=N;
      instruments  G T A Wg Plag Klag Xlag ;
run;
quit;

The MODEL Procedure

                        Nonlinear GMM Summary of Residual Errors

                   DF       DF                                                        Adj
Equation        Model    Error         SSE         MSE    Root MSE    R-Square       R-Sq

C                   4       17     21.7278      1.0347      1.0172      0.9769     0.9728

             Nonlinear GMM Parameter Estimates

                              Approx                  Approx
Parameter       Estimate     Std Err    t Value     Pr > |t|

cons_c          14.35319      0.8984      15.98       <.0001
P_c             0.091284      0.0626       1.46       0.1627
Plag_c          0.141792      0.0658       2.16       0.0457
W_c             0.862988      0.0291      29.62       <.0001

Number of Observations     Statistics for System

Used                21    Objective         0.1810
Missing              1    Objective*N       3.8004

/*LIML*/
proc syslin data=klein liml vardef=N;
   endogenous C P  Wp I X W Klag Y ;
   instruments Klag Plag Xlag Wg G T A;
   consume: model c = P Plag  W;
run;

The SYSLIN Procedure
Limited-Information Maximum Likelihood Estimation

Model                  CONSUME
Dependent Variable           C

                         Analysis of Variance

                               Sum of        Mean
Source                 DF     Squares      Square    F Value    Pr > F

Model                   3    854.3541    284.7847     118.42    <.0001
Error                  17    40.88419    2.404952
Corrected Total        20    941.4295

Root MSE             1.55079    R-Square       0.95433
Dependent Mean      53.99524    Adj R-Sq       0.94627
Coeff Var            2.87209

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     17.14765    1.840295       9.32      <.0001
P                 1     -0.22251    0.201748      -1.10      0.2854
Plag              1     0.396027    0.173598       2.28      0.0357
W                 1     0.822559    0.055378      14.85      <.0001
NOTE: K-Class Estimation with K=1.4987455056

Table 16.5 Estimates of Klein's Model I

Limited-Information Estimates vs. Full-Information estimates
/* 2SLS */
proc model data=klein;
      C = cons_c + P_c * P + Plag_c * Plag + W_c*W;
      I = cons_i + P_i * P + Plag_i * Plag  +Klag_i * Klag;
      Wp = cons_w + X_w * X + Xlag_w * Xlag + A_w *A;
      ENDOGENOUS W P X;
      EXOGENOUS T Wg G;
      fit C I Wp  /n2sls  vardef=N;
      instruments G T A Wg Plag Klag Xlag ;
   run;
quit;

The MODEL Procedure

                       Nonlinear 2SLS Summary of Residual Errors

                   DF       DF                                                        Adj
Equation        Model    Error         SSE         MSE    Root MSE    R-Square       R-Sq

C                   4       17     21.9252      1.0441      1.0218      0.9767     0.9726
I                   4       17     29.0469      1.3832      1.1761      0.8849     0.8646
Wp                  4       17     10.0050      0.4764      0.6902      0.9874     0.9852

             Nonlinear 2SLS Parameter Estimates

                              Approx                  Approx
Parameter       Estimate     Std Err    t Value     Pr > |t|

cons_c          16.55476      1.3208      12.53       <.0001
P_c             0.017302      0.1180       0.15       0.8852
Plag_c          0.216234      0.1073       2.02       0.0599
W_c             0.810183      0.0402      20.13       <.0001
cons_i          20.27821      7.5427       2.69       0.0155
P_i             0.150222      0.1732       0.87       0.3979
Plag_i          0.615944      0.1628       3.78       0.0015
Klag_i          -0.15779      0.0361      -4.37       0.0004
cons_w          1.500297      1.1478       1.31       0.2086
X_w             0.438859      0.0356      12.32       <.0001
Xlag_w          0.146674      0.0388       3.78       0.0015
A_w             0.130396      0.0291       4.47       0.0003

Number of Observations     Statistics for System

Used                21    Objective         0.8391
Missing              1    Objective*N      17.6215

/* LIML */
/*The standard errors for the second and third equation are different from the book*/
proc syslin data=klein liml vardef=N;
      endogenous C P  Wp I X W Klag Y ;
      instruments Klag Plag Xlag Wg G T A;
      consume: model c = P Plag  W;
      invest:  model i = P Plag  Klag;
      labor:   model wp = X Xlag  A;
   run;

The SYSLIN Procedure
Limited-Information Maximum Likelihood Estimation

Model                  CONSUME
Dependent Variable           C

                         Analysis of Variance

                               Sum of        Mean
Source                 DF     Squares      Square    F Value    Pr > F

Model                   3    854.3541    284.7847     118.42    <.0001
Error                  17    40.88419    2.404952
Corrected Total        20    941.4295

Root MSE             1.55079    R-Square       0.95433
Dependent Mean      53.99524    Adj R-Sq       0.94627
Coeff Var            2.87209

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     17.14765    1.840295       9.32      <.0001
P                 1     -0.22251    0.201748      -1.10      0.2854
Plag              1     0.396027    0.173598       2.28      0.0357
W                 1     0.822559    0.055378      14.85      <.0001
NOTE: K-Class Estimation with K=1.4987455056

The SYSLIN Procedure
Limited-Information Maximum Likelihood Estimation

Model                   INVEST
Dependent Variable           I

                         Analysis of Variance

                               Sum of        Mean
Source                 DF     Squares      Square    F Value    Pr > F

Model                   3    210.3790    70.12634      34.06    <.0001
Error                  17    34.99649    2.058617
Corrected Total        20    252.3267

Root MSE             1.43479    R-Square       0.85738
Dependent Mean       1.26667    Adj R-Sq       0.83221
Coeff Var          113.27274

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     22.59083    8.545818       2.64      0.0171
P                 1     0.075185    0.202181       0.37      0.7146
Plag              1     0.680386    0.188175       3.62      0.0021
Klag              1     -0.16826    0.040798      -4.12      0.0007
NOTE: K-Class Estimation with K=1.0859528454

The SYSLIN Procedure
Limited-Information Maximum Likelihood Estimation

Model                    LABOR
Dependent Variable          Wp

                         Analysis of Variance

                               Sum of        Mean
Source                 DF     Squares      Square    F Value    Pr > F

Model                   3    696.1485    232.0495     393.62    <.0001
Error                  17    10.02192    0.589525
Corrected Total        20    794.9095

Root MSE             0.76781    R-Square       0.98581
Dependent Mean      36.36190    Adj R-Sq       0.98330
Coeff Var            2.11156

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     1.526187    1.188405       1.28      0.2163
X                 1     0.433941    0.067937       6.39      <.0001
Xlag              1     0.151321    0.067054       2.26      0.0375
A                 1     0.131593    0.032386       4.06      0.0008
NOTE: K-Class Estimation with K=2.4685825667

/* OLS Estimate */
proc reg data=klein;
  model C= P Plag W;
  model I = P Plag Klag;
  model Wp= X Xlag A;
  run;
quit;

The REG Procedure
Model: MODEL1
Dependent Variable: C

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F

Model                     3      923.55008      307.85003     292.71    <.0001
Error                    17       17.87945        1.05173
Corrected Total          20      941.42952

Root MSE              1.02554    R-Square     0.9810
Dependent Mean       53.99524    Adj R-Sq     0.9777
Coeff Var             1.89932

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|

Intercept     1       16.23660        1.30270      12.46      <.0001
P             1        0.19293        0.09121       2.12      0.0495
Plag          1        0.08988        0.09065       0.99      0.3353
W             1        0.79622        0.03994      19.93      <.0001

The REG Procedure
Model: MODEL2
Dependent Variable: I

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F

Model                     3      235.00396       78.33465      76.88    <.0001
Error                    17       17.32270        1.01898
Corrected Total          20      252.32667

Root MSE              1.00945    R-Square     0.9313
Dependent Mean        1.26667    Adj R-Sq     0.9192
Coeff Var            79.69315

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|

Intercept     1       10.12579        5.46555       1.85      0.0814
P             1        0.47964        0.09711       4.94      0.0001
Plag          1        0.33304        0.10086       3.30      0.0042
Klag          1       -0.11179        0.02673      -4.18      0.0006

The REG Procedure
Model: MODEL3
Dependent Variable: Wp
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F

Model                     3      784.90477      261.63492     444.57    <.0001
Error                    17       10.00475        0.58851
Corrected Total          20      794.90952

Root MSE              0.76715    R-Square     0.9874
Dependent Mean       36.36190    Adj R-Sq     0.9852
Coeff Var             2.10976

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|

Intercept     1        1.49704        1.27003       1.18      0.2547
X             1        0.43948        0.03241      13.56      <.0001
Xlag          1        0.14609        0.03742       3.90      0.0011
A             1        0.13025        0.03191       4.08      0.0008

/* 3SLS */
proc model data=klein;
      C = cons_c + P_c * P + Plag_c * Plag + W_c*W;
      I = cons_i + P_i * P + Plag_i * Plag  +Klag_i * Klag;
      Wp = cons_w + X_w * X + Xlag_w * Xlag + A_w *A;
      ENDOGENOUS W P X ;
      EXOGENOUS T Wg G;
      fit C I Wp  /n3sls  vardef=N;
      instruments G T A Wg Plag Klag Xlag ;
   run;
quit;

The MODEL Procedure

                       Nonlinear 3SLS Summary of Residual Errors

                   DF       DF                                                        Adj
Equation        Model    Error         SSE         MSE    Root MSE    R-Square       R-Sq

C                   4       17     18.7270      0.8918      0.9443      0.9801     0.9766
I                   4       17     43.9540      2.0930      1.4467      0.8258     0.7951
Wp                  4       17     10.9205      0.5200      0.7211      0.9863     0.9838

             Nonlinear 3SLS Parameter Estimates

                              Approx                  Approx
Parameter       Estimate     Std Err    t Value     Pr > |t|

cons_c          16.44079      1.3045      12.60       <.0001
P_c              0.12489      0.1081       1.16       0.2641
Plag_c          0.163144      0.1004       1.62       0.1227
W_c             0.790081      0.0379      20.83       <.0001
cons_i          28.17785      6.7938       4.15       0.0007
P_i             -0.01308      0.1619      -0.08       0.9366
Plag_i          0.755724      0.1529       4.94       0.0001
Klag_i          -0.19485      0.0325      -5.99       <.0001
cons_w          1.797216      1.1159       1.61       0.1257
X_w             0.400492      0.0318      12.59       <.0001
Xlag_w          0.181291      0.0342       5.31       <.0001
A_w             0.149674      0.0279       5.36       <.0001

Number of Observations     Statistics for System

Used                21    Objective         1.1567
Missing              1    Objective*N      24.2910

/* FIML */
proc syslin data=klein fiml;
      endogenous C P Wp I X W Y  ;
      instruments Klag Plag Xlag Wg G T A;
      consume: model    C = P Plag W;
      invest:  model    I = P Plag Klag;
      labor:   model    Wp = X Xlag A;
      product: identity X = C + I + G;
      profit:  identity P = Y - Wp;
	  wage:    identity W = Wg + Wp;
	  income:  identity Y = C + I + G - T;
   run;
   
Model                  CONSUME
Dependent Variable           C

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     18.34865    2.488480       7.37      <.0001
P                 1     -0.23308    0.312439      -0.75      0.4659
Plag              1     0.385971    0.217618       1.77      0.0940
W                 1     0.801879    0.035898      22.34      <.0001

Model                   INVEST
Dependent Variable           I

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     27.26501    7.939025       3.43      0.0032
P                 1     -0.80179    0.491990      -1.63      0.1216
Plag              1     1.052094    0.352749       2.98      0.0084
Klag              1     -0.14806    0.029844      -4.96      0.0001

Model                    LABOR
Dependent Variable          Wp

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     5.797016    1.804906       3.21      0.0051
X                 1     0.234023    0.048829       4.79      0.0002
Xlag              1     0.284728    0.045214       6.30      <.0001
A                 1     0.234878    0.034506       6.81      <.0001
 
/* I3SLS */
proc syslin data=klein i3sls vardef=N;
      endogenous C P  Wp I X W Klag Y;
      instruments Klag Plag Xlag Wg G T A;
      consume: model c = P Plag  W;
      invest:  model i = P Plag  Klag;
      labor:   model wp = X Xlag  A;
   run;
  
The SYSLIN Procedure
Iterative Three-Stage Least Squares Estimation

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     16.55898    1.224394      13.52      <.0001
P                 1     0.164505    0.096198       1.71      0.1054
Plag              1     0.176562    0.090100       1.96      0.0666
W                 1     0.765804    0.034760      22.03      <.0001

Model                   INVEST
Dependent Variable           I

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     42.89425    10.59316       4.05      0.0008
P                 1     -0.35649    0.260138      -1.37      0.1884
Plag              1     1.011268    0.248757       4.07      0.0008
Klag              1     -0.26019    0.050866      -5.12      <.0001

Model                    LABOR
Dependent Variable          Wp

                        Parameter Estimates

                       Parameter    Standard
Variable         DF     Estimate       Error    t Value    Pr > |t|

Intercept         1     2.624646    1.195543       2.20      0.0423
X                 1     0.374782    0.031103      12.05      <.0001
Xlag              1     0.193650    0.032402       5.98      <.0001
A                 1     0.167923    0.028929       5.80      <.0001  

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.