OUTPUT <OUT=SAS-data-set> keyword=names <…keyword=names> <option>;
The OUTPUT statement creates a new SAS data set that saves diagnostic measures calculated after fitting the model. At least one specification of the form keyword=names is required.
All the variables in the original data set are included in the new data set, along with variables created in the OUTPUT statement. These new variables contain the values of a variety of diagnostic measures that are calculated for each observation in the data set. If you want to create a SAS data set in a permanent library, you must specify a two-level name. For more information about permanent libraries and SAS data sets, see SAS Language Reference: Concepts.
Details on the specifications in the OUTPUT statement follow.
The following statements show the syntax for creating an output data set with a single dependent variable.
proc glm; class a b; model y=a b a*b; output out=new p=yhat r=resid stdr=eresid; run;
These statements create an output data set named new
. In addition to all the variables from the original data set, new
contains the variable yhat
, with values that are predicted values of the dependent variable y
; the variable resid
, with values that are the residual values of y
; and the variable eresid
, with values that are the standard errors of the residuals.
The following statements show a situation with five dependent variables.
proc glm; by group; class a; model y1-y5=a x(a); output out=pout predicted=py1-py5; run;
The data set pout
contains five new variables, py1
through py5
. The values of py1
are the predicted values of y1
; the values of py2
are the predicted values of y2
; and so on.
For more information about the data set produced by the OUTPUT statement, see the section Output Data Sets.