PLSMOD Procedure

OUTPUT Statement

  • OUTPUT OUT=libref.data-table
    <COPYVARS=(variables)>
    <keyword <=prefix>>…<keyword <=prefix>>
    ;

The OUTPUT statement creates a data table that contains observationwise statistics, which are computed after fitting the model. If you do not specify any keywords, then only the predicted values for responses are included.

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.

You must specify the following option:

OUT=libref.data-table

names the output data table for PROC PLSMOD to use. You must specify this option before any other options. libref.data-table is a two-level name, where

libref

refers to a collection of information that is defined in the LIBNAME statement and includes the library, 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 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)

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

keyword <=prefix>

specifies a statistic to include in the output data table and optionally a prefix for naming the output variables. If you do not provide a prefix, the PLSMOD procedure assigns a default prefix based on the type of statistic requested. For example, for response variables y1 and y2, a specification of PREDICTED produces two predicted value variables, Pred_y1 and Pred_y2.

You can specify the following keywords to add statistics to the OUTPUT data table:

H

requests the approximate leverage. The default prefix is H.

PREDICTED
PRED
P

requests predicted values for each response. The default prefix is Pred.

PRESS

requests approximate predicted residuals for each response. The default prefix is PRESS.

ROLE

requests numeric values that indicate the role played by each observation in fitting the model. The default prefix is _ROLE_. Table 6 shows the interpretation of this variable for each observation.

Table 6: Role Interpretation

Value Observation Role
0 Not used
1 Training
2 Testing


If you do not partition the input data by using 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 responses or predictors.

STDX

requests standardized (centered and scaled) predictor values for each predictor. The default prefix is StdX.

STDXSSE

requests the sum of squares of residuals for standardized predictors. The default prefix is StdXSSE.

STDY

requests standardized (centered and scaled) response values for each response. The default prefix is StdY.

STDYSSE

requests the sum of squares of residuals for standardized responses. The default prefix is StdYSSE.

TSQUARE
T2

requests a scaled sum of squares of score values. The default prefix is TSquare.

XRESIDUAL
XRESID
XR

requests residuals for each predictor. The default prefix is XResid.

XSCORE

requests extracted factors (X-scores, latent vectors, latent variables, and T) for each selected model factor. The default prefix is XScore.

YRESIDUAL
YRESID
YR

requests residuals for each response. The default prefix is YResid.

YSCORE

requests extracted responses (Y-scores and U) for each selected model factor. The default prefix is YScore.

The output variables that contain the requested statistic are named as follows, according to the keyword that you specify:

  • The keywords XRESIDUAL and STDX define an output variable for each predictor, so the variables that correspond to each predictor are named by appending a number (which starts from 1) to the prefix. For each defined variable, a label is also generated automatically; the label contains the prefix of the variable and the name of the predictor. For example, if the model has three predictors, then a specification of XRESIDUAL=XR produces the variables XR1, XR2, and XR3.

  • The keywords PREDICTED, YRESIDUAL, STDY, and PRESS define an output variable for each response, so the variables that correspond to each response are named by appending an underscore followed by the name of the response variable to the prefix. For example, if the model has response variables y1 and y2, then a specification of PREDICTED=P produces the variables P_y1 and P_y2.

  • The keywords XSCORE and YSCORE define an output variable for each selected model factor, so the variables that correspond to each successive factor are named by appending the factor number to the prefix. For example, if the model has three selected factors, then a specification of XSCORE=T produces the variables T1, T2, and T3.

  • The keywords H, TSQUARE, STDXSSE, STDYSSE, and ROLE each define a single output variable, so the variable name matches the prefix.

Last updated: June 22, 2026