Data for this example are generated. General form equations are estimated and forecast by using PROC MODEL. The system is a basic supply and demand model.
The following statements specify the form of the model:
title1 "General Form Equations for Supply-Demand Model"; proc model outmodel=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; run;
Three data sets are used in this example. The first data set, HISTORY, is used to estimate the parameters of the model. The ASSUME data set is used to produce a forecast of PRICE and QUANTITY. Notice that the ASSUME data set does not need to contain the variables PRICE and QUANTITY. The HISTORY data set is shown as follows:
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 ... more lines ...
The ASSUME data set is shown as follows:
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 third data set, GOAL, used in a forecast of PRICE and UNITCOST as a function of INCOME and QUANTITY is as follows:
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 following statements fit the model to the HISTORY data set and solve the fitted model for the ASSUME data set.
proc model model=model outmodel=model; /* 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; title2 "Parameter Estimates for the System"; proc print data=est; run; title2 "Price Quantity Solution"; proc print data=pq; run;
The model summary of the supply and demand model is shown as follows:
The estimation results are shown in Output 19.6.2 and the OUTEST= data set is show in Output 19.6.3. The output data set produced by the SOLVE statement is shown in Output 19.6.4.
Output 19.6.4: 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 |
The following statements produce the goal-seeking solutions for PRICE and UNITCOST by using the GOAL dataset.
title2 "Price Unitcost Solution"; /* produce goal-seeking solutions for income and quantity assumptions*/ proc model model=model; solve price unitcost / data=goal out=pc; run; proc print data=pc; run;
The output data set produced by the final SOLVE statement is shown in Output 19.6.5.
Output 19.6.5: 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 |