The LOGSELECT Procedure

OUTPUT Statement

  • OUTPUT OUT=CAS-libref.data-table<options><keyword <=name>>…<keyword <=name>>;

The OUTPUT statement creates a data table that contains observationwise statistics that PROC LOGSELECT computes after fitting the model. In order to avoid data duplication for large data tables, the variables in the input data table are not included in the output data table unless you specify them in the COPYVAR= option.

If the response variable has more than two categories, you can request the "Statistic Options" listed in Table 8; the other diagnostic statistics are not available. These statistics are computed for every response category, and the automatic variable _LEVEL_ identifies the response category on which the computed values are based. That is, every observation generates several rows in the output data set. If you also specify the OBSCAT option, then the observationwise statistics are computed only for the observed response category, which is indicated by the value of the _LEVEL_ variable. If you specify the PREDPROBS option, then only the PRED and IPRED variables are output to the data table, and a variable is created to contain the values that correspond to each response category. PROC LOGSELECT names these variables by concatenating the PRED= or IPRED= name with the response category.

The output statistics are computed based on the final parameter estimates. If the optimization does not converge, then the output data table is not created.

For observations in which only the response variable is missing, values of the linear predictor and the predicted probabilities are computed even though these observations do not affect the model fit. This enables, for example, predicted probabilities to be computed for new observations.

You must specify the following option:

OUT=CAS-libref.data-table

names the output data table for PROC LOGSELECT 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 options:

ALL
ALLSTAT

adds all available statistics to the output data table.

ALPHA=number

specifies the significance level for the construction of confidence intervals in the output data table. The confidence level is 1 minus sans-serif-italic number. The value of number must be between 0 and 1. By default, number is equal to the value of the ALPHA= option in the PROC LOGSELECT statement, or 0.05 if that option is not specified.

COPYVAR=variable
COPYVARS=(variables)

transfers one or more variables from the input data table to the output data table.

FIXEDOFFSET=number

specifies a value to use as an offset to the linear predictor instead of obtaining the value from the offset variable. This option is ignored unless you also specify the OFFSET= variable in the MODEL statement.

OBSCAT

requests (for multinomial models) that observationwise statistics be produced only for the observed response level. If you do not specify this option and the response variable has J levels, then the following outputs are created: for cumulative link models, J–1 records are output for every observation in the input data that corresponds to the J–1 lower-ordered response categories; for generalized logit models, J records are output that correspond to all J response categories.

PREDPROBS

creates variables (for multinomial models) for each response category that corresponds to the requested IPRED and PREDICTED keywords.

keyword <=name>

specifies a statistic to include in the output data table and optionally names the variable name. If you do not provide a name, the LOGSELECT procedure assigns a default name based on the type of statistic requested.

Table 8 summarizes the keywords that are available in the OUTPUT statement.

Table 8: OUTPUT Statement Keywords

Keyword Description Default Names
Statistic Options
INDIVIDUAL Specifies the individual predicted probabilities _IPRED_
LCL Specifies the lower confidence limit for the linear predictor _LCL_
LCLM Specifies the lower confidence limit for the event probability _LCLM_
POST Specifies the posterior predicted probabilities _POST_
PREDICTED Specifies the predicted probabilities _PRED_
RESRAW Specifies the raw residual _RESRAW_
STDXBETA Specifies the standard error estimate of the linear predictor _STDXBETA_
UCL Specifies the upper confidence limit for the linear predictor _UCL_
UCLM Specifies the upper confidence limit for the event probability _UCLM_
XBETA Specifies the linear predictor _XBETA_
Diagnostic Options for Binary and Binomial Response Data
CBAR Specifies the confidence interval displacement _CBAR_
DIFCHISQ Specifies the deletion chi-square goodness-of-fit change _DIFCHISQUARE_
DIFDEV Specifies the deletion deviance change _DIFDEVIANCE_
H Specifies the leverage _HATDIAG_
RESCHI Specifies the Pearson chi-square residual _RESCHI_
RESDEV Specifies the deviance residual _RESDEV_
RESLIK Specifies the likelihood residual _RESLIK_
RESWORK Specifies the working residual _RESWORK_
STDRESCHI Specifies the standardized Pearson chi-square residual _STDRESCHI_
STDRESDEV Specifies the standardized deviance residual _STDRESDEV_
Miscellaneous Options
INTO Names the level into which the observation is classified _INTO_
LEVEL Names the response level for a row of the output _LEVEL_
ROLE Names the role played by the observation in fitting the model _ROLE_


The following list describes these keywords. For more information, see the section Predicted Probabilities and Regression Diagnostics.

CBAR

specifies the confidence interval displacement diagnostic that measures the overall change in the global regression estimates that results from deleting an individual observation. The default name is _CBAR_.

DIFCHISQ

specifies the change in the chi-square goodness-of-fit statistic that results from deleting the individual observation. The default name is _DIFCHISQUARE_.

DIFDEV

specifies the change in the deviance that results from deleting the individual observation. The default name is _DIFDEVIANCE_.

H

specifies the diagonal element of the hat matrix (leverage) for detecting extreme points in the design space. The default name is _HATDIAG_.

INDIVIDUAL
IPRED
IPROB
IP

specifies the individual predicted values for multinomial response variables. For a response variable Y with three levels, 1, 2, and 3, the individual probabilities are probability left-parenthesis sans-serif upper Y equals 1 right-parenthesis, probability left-parenthesis sans-serif upper Y equals 2 right-parenthesis, and probability left-parenthesis sans-serif upper Y equals 3 right-parenthesis. The default name is _IPRED_.

INTO<(cutpoint)>

names the variable that contains the level of the response into which an observation is classified. The default name is _INTO_. Multinomial models classify observations into the level that has the largest model-predicted probability. For binary or binomial response variables, if the predicted probability of an observation equals or exceeds the cutpoint, the observation is classified as an event; otherwise it is classified as a nonevent. You can specify the cutpoint value as a number between 0 and 1. The default value is 0.5.

LCL
LOWERXBETA

names the variable that contains the lower confidence limits for the linear predictor. You can set the confidence level by specifying the ALPHA= option. The default name is _LCL_.

LCLM
LOWERMEAN
LOWER

specifies the lower confidence limits for the probability of the event. You can set the confidence level by specifying the ALPHA= option. The default name is _LCLM_.

LEVEL

names the variable that contains the level of the response for a given row of the output. The default name is _LEVEL_.

POSTERIOR
POST

specifies the posterior predicted probability of each observation. If you do not specify the PRIOR= option in the MODEL statement, then the observed proportions from the training data are used as priors, in which case the posteriors from the training data are the same as the individual predicted probabilities. The default name is _POST_.

PREDICTED
PRED
PROB
P

specifies the predicted values (predicted probabilities of events) for binary and nominal response variables and the cumulative predicted probabilities for ordinal response variables. For a response variable Y with three levels, 1, 2, and 3, the cumulative probabilities are probability left-parenthesis sans-serif upper Y less-than-or-equal-to 1 right-parenthesis and probability left-parenthesis sans-serif upper Y less-than-or-equal-to 2 right-parenthesis, but by default the last level, probability left-parenthesis sans-serif upper Y less-than-or-equal-to 3 right-parenthesis equals 1, is not output. The default name is _PRED_.

RESCHI
PEARSON

specifies the Pearson residual for identifying poorly fitted observations. The default name is _RESCHI_.

RESDEV

specifies the deviance residual for identifying poorly fitted observations. The default name is _RESDEV_.

RESLIK

specifies the likelihood residual for identifying poorly fitted observations. The default name is _RESLIK_.

RESRAW
RESIDUAL
R

specifies the raw residual for identifying poorly fitted observations. The default name is _RESRAW_.

RESWORK

specifies the working residual for identifying poorly fitted observations. The default name is _RESWORK_.

ROLE

specifies the numeric variable that indicates the role played by each observation in fitting the model. The default name is _ROLE_. Table 9 shows how this variable is interpreted for each observation.

Table 9: Role Interpretation

Value Observation Role
0 Not used
1 Training
2 Validation
3 Testing


If you do not partition the input data by specifying a PARTITION statement, then the role variable value is 1 for observations that are 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.

STDRESCHI

specifies the standardized Pearson (chi-square) residual for identifying observations that are poorly accounted for by the model. The default name is _STDRESCHI_.

STDRESDEV

specifies the standardized deviance residual for identifying poorly fitted observations. The default name is _STDRESDEV_.

STDXBETA

specifies the standard error estimates of XBETA. The default name is _STDXBETA_.

UCL
UPPERXBETA

specifies the variable that contains the upper confidence limits for the linear predictor. The default name is _UCL_. You can set the confidence level by specifying the ALPHA= option.

UCLM
UPPERMEAN
UPPER

specifies the variable that contains the upper confidence limits for the probability of the event response. The default name is _UCLM_. You can set the confidence level by specifying the ALPHA= option.

XBETA
LINP

specifies the linear predictor. The default name is _XBETA_.

Last updated: November 05, 2020