Chapter Contents 
Previous 
Next 
The MODEL Procedure 
The single equation example shown in the preceding section was written in normalized form and specified as an assignment of the regression function to the dependent variable LHUR. However, sometimes it is impossible or inconvenient to write a nonlinear model in normalized form.
To write a general form equation, give the equation a name with the prefix "EQ." . This EQ.prefixed variable represents the equation error. Write the equation as an assignment to this variable.
For example, suppose you have the following nonlinear model relating the variables x and y:
Naming this equation `one', you can fit this model with the following statements:
proc model data=xydata; eq.one = a + b * log( c * y + d * x ); fit one; run;
The use of the EQ. prefix tells PROC MODEL that the variable is an error term and that it should not expect actual values for the variable ONE in the input data set.
For example, consider the following demand and supply system:
Assume the quantity of interest is the amount of energy consumed in the U.S.; the price is the price of gasoline, and the income variable is the consumer debt. When the market is at equilibrium, these equations determine the market price and the equilibrium quantity. These equations are written in general form as
Note that the endogenous variables quantity and price depend on two error terms so that OLS should not be used. The following example uses threestage leastsquares estimation.
Data for this model is obtained from the SASHELP.CITIMON data set.
title1 'SupplyDemand Model using Generalform Equations'; proc model data=sashelp.citimon; endogenous eegp eec; exogenous exvus cciutc; parameters a1 a2 a3 b1 b2 ; label eegp = 'Gasoline Retail Price' eec = 'Energy Consumption' cciutc = 'Consumer Debt'; /*  Supply equation  */ eq.supply = eec  (a1 + a2 * eegp + a3 * cciutc); /*  Demand equation  */ eq.demand = eec  (b1 + b2 * eegp ); /*  Instrumental variables */ lageegp = lag(eegp); lag2eegp=lag2(eegp); /*  Estimate parameters  */ fit supply demand / n3sls fsrsq; instruments _EXOG_ lageegp lag2eegp; run;
The FIT statement specifies the two equations to estimate and the method of estimation, N3SLS. Note that `3SLS' is an alias for N3SLS. The option FSRSQ is selected to get a report of the first stage R^{2} to determine the acceptability of the selected instruments.
Since threestage least squares is an instrumental variables method, instruments are specified with the INSTRUMENTS statement. The instruments selected are all the exogenous variables, selected with the _EXOG_ option, and two lags of the variable EEGP, LAGEEGP and LAG2EEGP.
The data set CITIMON has four observations that generate missing values because values for either EEGP, EEC, or CCIUTC are missing. This is revealed in the "Observations Processed" output shown in Figure 14.7. Missing values are also generated when the equations cannot be computed for a given observation. Missing observations are not used in the estimation.

The lags used to create the instruments also reduce the number of observations used. In this case, the first 2 observations were used to fill the lags of EEGP.
The data set has a total of 145 observations, of which 4 generated missing values and 2 were used to fill lags, which left 139 observations for the estimation. In the estimation summary, in Figure 14.8, the total degrees of freedom for the model and error is 139.
One disadvantage of specifying equations in general form is that there are no actual values associated with the equation, so the R^{2} statistic cannot be computed.
Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.