The SYSLIN Procedure

OUTPUT Statement

  • OUTPUT < PREDICTED=variable > < RESIDUAL=variable > ;

The OUTPUT statement writes predicted values and residuals from the preceding model to the data set specified by the OUT= option in the PROC SYSLIN statement. An OUTPUT statement must come after the MODEL statement to which it applies. The OUT= option must be specified in the PROC SYSLIN statement.

The following options can be specified in the OUTPUT statement:

PREDICTED=variable

names a new variable to contain the predicted values for the response variable. The PREDICTED= option can be abbreviated as PREDICT=, PRED=, or P=.

RESIDUAL=variable

names a new variable to contain the residual values for the response variable. The RESIDUAL= option can be abbreviated as RESID= or R=.

For example, the following statements create an output data set named B. In addition to the variables in the input data set, the data set B contains the variable YHAT, with values that are predicted values of the response variable Y, and YRESID, with values that are the residual values of Y.

   proc syslin data=a out=b;
      model y = x1 x2;
      output p=yhat r=yresid;
   run;

For example, the following statements create an output data set named PRED. In addition to the variables in the input data set, the data set PRED contains the variables Q_DEMAND and Q_SUPPLY, with values that are predicted values of the response variable Q for the demand and supply equations respectively, and R_DEMAND and R_SUPPLY, with values that are the residual values of the demand and supply equations respectively.

   proc syslin data=in out=pred;
      demand: model q = p y s;
      output p=q_demand r=r_demand;
      supply: model q = p u;
      output p=q_supply r=r_supply;
   run;

See the section OUT= Data Set for details.