Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The MODEL Procedure

Example 14.6: General-Form Equations

Data for this example are generated. General-form equations are estimated and forecast using PROC MODEL. The system is a basic supply-demand model. Portions of the output from the following code is shown in Output 14.6.1 through Output 14.6.4.

   title1 "General Form Equations for Supply-Demand Model";
   
   proc model;
      var price quantity income unitcost;
      parms d0-d2 s0-s2;
      eq.demand=d0+d1*price+d2*income-quantity;
      eq.supply=s0+s1*price+s2*unitcost-quantity;
   
   /* estimate the model parameters */
      fit supply demand / data=history outest=est n2sls;
      instruments income unitcost year;
   run;
   
   /* produce forecasts for income and unitcost assumptions */
      solve price quantity / data=assume out=pq;
   run;
   
   /* produce goal-seeking solutions for income and quantity assumptions*/
      solve price unitcost / data=goal out=pc;
   run;
   
   title2 "Parameter Estimates for the System";
   proc print data=est;
   run;
   
   title2 "Price Quantity Solution";
   proc print data=pq;
   run;
   
   title2 "Price Unitcost Solution";
   proc print data=pc;
   run;

Three data sets were used in this example. The first data set, HISTORY, was used to estimate the parameters of the model. The ASSUME data set was used to produce a forecast of PRICE and QUANTITY. Notice that the ASSUME data set does not have to contain the variables PRICE and QUANTITY.

   data history;
      input year income unitcost price quantity;
      datalines;
   1976    2221.87    3.31220     0.17903    266.714
   1977    2254.77    3.61647     0.06757    276.049
   1978    2285.16    2.21601     0.82916    285.858
   1979    2319.37    3.28257     0.33202    295.034
   1980    2369.38    2.84494     0.63564    310.773
   1981    2395.26    2.94154     0.62011    319.185
   1982    2419.52    2.65301     0.80753    325.970
   1983    2475.09    2.41686     1.01017    342.470
   1984    2495.09    3.44096     0.52025    348.321
   1985    2536.72    2.30601     1.15053    360.750
   ;
   
   data assume;
      input year income unitcost;
      datalines;
   1986    2571.87    2.31220
   1987    2609.12    2.45633
   1988    2639.77    2.51647
   1989    2667.77    1.65617
   1990    2705.16    1.01601
   ;

The output produced by the first SOLVE statement is shown in Output 14.6.3.

The third data set, GOAL, is used in a forecast of PRICE and UNITCOST as a function of INCOME and QUANTITY.

   data goal;
      input year income quantity;
      datalines;
   1986    2571.87     371.4
   1987    2721.08     416.5
   1988    3327.05     597.3
   1989    3885.85     764.1
   1990    3650.98     694.3
   ;

The output from the final SOLVE statement is shown in Output 14.6.4.

Output 14.6.1: Printed Output from the FIT Statement

General Form Equations for Supply-Demand Model

The MODEL Procedure

The 2 Equations to Estimate
supply = F(s0(1), s1(price), s2(unitcost))
demand = F(d0(1), d1(price), d2(income))
Instruments 1 income unitcost year


General Form Equations for Supply-Demand Model

The MODEL Procedure

Nonlinear 2SLS Summary of Residual Errors 
Equation DF Model DF Error SSE MSE Root MSE R-Square Adj R-Sq
supply 3 7 3.3240 0.4749 0.6891    
demand 3 7 1.0829 0.1547 0.3933    

Nonlinear 2SLS Parameter Estimates
Parameter Estimate Approx Std Err t Value Approx
Pr > |t|
d0 -395.887 4.1841 -94.62 <.0001
d1 0.717328 0.5673 1.26 0.2466
d2 0.298061 0.00187 159.65 <.0001
s0 -107.62 4.1780 -25.76 <.0001
s1 201.5711 1.5977 126.16 <.0001
s2 102.2116 1.1217 91.12 <.0001

Output 14.6.2: Listing of OUTEST= Data Set Created in the FIT Statement

General Form Equations for Supply-Demand Model
Parameter Estimates for the System

Obs _NAME_ _TYPE_ _STATUS_ _NUSED_ d0 d1 d2 s0 s1 s2
1   2SLS 0 Converged 10 -395.887 0.71733 0.29806 -107.620 201.571 102.212

Output 14.6.3: Listing of OUT= Data Set Created in the First SOLVE Statement

General Form Equations for Supply-Demand Model
Price Quantity Solution

Obs _TYPE_ _MODE_ _ERRORS_ price quantity income unitcost year
1 PREDICT SIMULATE 0 1.20473 371.552 2571.87 2.31220 1986
2 PREDICT SIMULATE 0 1.18666 382.642 2609.12 2.45633 1987
3 PREDICT SIMULATE 0 1.20154 391.788 2639.77 2.51647 1988
4 PREDICT SIMULATE 0 1.68089 400.478 2667.77 1.65617 1989
5 PREDICT SIMULATE 0 2.06214 411.896 2705.16 1.01601 1990

Output 14.6.4: Listing of OUT= Data Set Created in the Second SOLVE Statement

General Form Equations for Supply-Demand Model
Price Unitcost Solution

Obs _TYPE_ _MODE_ _ERRORS_ price quantity income unitcost year
1 PREDICT SIMULATE 0 0.99284 371.4 2571.87 2.72857 1986
2 PREDICT SIMULATE 0 1.86594 416.5 2721.08 1.44798 1987
3 PREDICT SIMULATE 0 2.12230 597.3 3327.05 2.71130 1988
4 PREDICT SIMULATE 0 2.46166 764.1 3885.85 3.67395 1989
5 PREDICT SIMULATE 0 2.74831 694.3 3650.98 2.42576 1990

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.