Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The LOESS Procedure

Output Data Sets

PROC LOESS assigns a name to each table it creates. You can use the ODS OUTPUT statement to place one or more of these tables in output data sets. See the section "ODS Table Names" for a list of the table names created by PROC LOESS. For detailed information on ODS, see Chapter 15, "Using the Output Delivery System."

For example, the following statements create an output data set named MyOutStats containing the OutputStatistics table and an output data set named MySummary containing the FitSummary table.

   proc loess data=Melanoma;
      model Incidences=Year;
      ods output OutputStatistics = MyOutStats
                 FitSummary       = MySummary;                 
   run;

Often, a single MODEL statement describes more than one model. For example, the following statements fit eight different models (4 smoothing parameters for each dependent variable).

 
   proc loess data=notReal;
      model y1 y2 = x1 x2 x3/smooth =0.1 to 0.7 by 0.2;
      ods output OutputStatistics = MyOutStats;                 
   run;

The eight OutputStatistics tables for these models are stacked in a single data set called MyOutStats. The data set contains a column named DepVarName and a column named SmoothingParameter that distinguish each model (see Figure 38.4 for an example). If you want the OutputStatistics table for each model to be in its own data set, you can do so by using the MATCH_ALL option in the ODS OUTPUT statement. The following statements create eight data sets named MyOutStats, MyOutStats1, ... , MyOutStats7.

 
   proc loess data=notReal;
      model y1 y2 = x1 x2 x3/smooth =0.1 to 0.7 by 0.2;
      ods output OutputStatistics(match_all) = MyOutStats;                 
   run;

For further options available in the ODS OUTPUT statement, see Chapter 15, "Using the Output Delivery System."

Only the ScaleDetails and FitSummary tables are displayed by default. The other tables are optionally displayed by using the DETAILS option in the MODEL statement and the PRINT option in the SCORE statement. Note that it is not necessary to display a table in order for that table to be used in an ODS OUTPUT statement. For example, the following statements display the OutputStatistics and kdTree tables but place the OutputStatistics and PredAtVertices tables in output data sets.

 
   proc loess data=Melanoma;
      model Incidences=Year/details(OutputStatistics kdTree);   
      ods output OutputStatistics = MyOutStats
                 PredAtVertices   = MyVerticesOut;                 
   run;

Using the DETAILS option alone causes all tables to be displayed.

The MODEL statement options CLM, RESIDUAL, STD, SCALEDINDEP, and T control which optional columns are added to the OutputStatistics table. For example, to obtain an OutputStatistics output data set containing residuals and confidence limits in addition to the model variables and predicted value, you need to specify the RESIDUAL and CLM options in the MODEL statement as in the following example:

 
   proc loess data=Melanoma;
      model Incidences=Year/residual clm;   
      ods output OutputStatistics = MyOutStats;                 
   run;

Finally, note that the ALL option in the MODEL statement includes all optional columns in the output. Also, ID columns can be added to the OutputStatistics table by using the ID statement.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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