The OUTPUT statement creates a data table that contains observationwise statistics, which are computed after the model is fitted. The variables in the input data table are not included in the output data table, in order to avoid data duplication for large data tables; however, variables that you specify in the COPYVARS= option are included.
The output statistics are computed based on the parameter estimates for the selected model. For observations in which only the response variable is missing, predicted values are computed even though these observations do not affect the model fit. This enables, for example, predicted values to be computed for new observations.
You must specify the following option:
-
OUT=CAS-libref.data-table
-
names the output data table for PROC REGSELECT to use. You must specify this option before any other options. CAS-libref.data-table is a two-level name, where
- CAS-libref
refers to a collection of information that is defined in the LIBNAME statement and includes the caslib, which includes a path to where the data table is to be stored, and a session identifier, which defaults to the active session but which can be explicitly defined in the LIBNAME statement. For more information about CAS-libref, see the section Using CAS Sessions and CAS Engine Librefs.
- data-table
specifies the name of the output data table.
You can also specify the following syntax elements:
-
COPYVAR=variable
COPYVARS=(variables)
transfers one or more variables from the input data table to the output data table.
-
keyword <=name>
-
specifies the statistics to include in the output data table and optionally names the new variables that contain the statistics. Specify a keyword for each desired statistic (see the following list of keywords), followed optionally by an equal sign and a variable to contain the statistic.
If you specify keyword=name, the new variable that contains the requested statistic has the specified name. If you omit the optional =name after a keyword, then a default name is used.
You can specify the following values for keyword to request statistics that are available with all selection methods:
-
PREDICTED
PRED
P
requests predicted values for the response variable. The default is Pred.
-
RESIDUAL
RESID
R
requests the residual, calculated as ACTUAL – PREDICTED. The default is Residual.
-
ROLE
-
requests a numeric variable that indicates the role played by each observation in fitting the model. The default is _ROLE_. For each observation, the interpretation of this variable is shown in Table 6.
Table 6: Role Interpretation
| Value | Observation Role |
|---|
| 0 | Not used |
| 1 | Training |
| 2 | Validation |
| 3 | Testing |
If you do not partition the input data by using a PARTITION statement, then the role variable value is 1 for observations used in fitting the model, and 0 for observations that have at least one missing or invalid value for the response, regressor, frequency, or weight variables.
In addition to the preceding statistics, you can also use the keywords listed in Table 7 in the OUTPUT statement to obtain additional statistics. These statistics are not available if you specify METHOD=LAR or METHOD=LASSO or METHOD=ELASTICNET in the SELECTION statement. For computational formulas, see the section Diagnostic Statistics. All the statistics available in the OUTPUT statement are conditional on the selected model and do not take into account the variability introduced when you do model selection.
This statement is ignored if you perform best-subset selection.