PHSELECT Procedure

OUTPUT Statement

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

The OUTPUT statement creates a data table that contains observationwise statistics that PROC PHSELECT 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.

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 censoring variable is missing, values of the linear predictor and the predicted survival probabilities are computed even though these observations do not affect the model fit. This enables, for example, predicted survival probabilities to be computed for new observations.

You must specify the following option:

OUT=libref.data-table

names the output data table for PROC PHSELECT 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. For more information about libref, see the section Using SAS Viya Workbench.

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 a statistic to include in the output data table. Four statistics (DFBETA, RESSCH, RESSCO, and WTRESSCH) are multidimensional; each has a dimension equal to the number of parameters in the model. For the one-dimensional statistic, you can name the variable name. For the multidimensional statistic, name is used as the prefix; for example, if X1–X10 are the explanatory variables in the model, specifying RESSCH=sch creates the variables schX1–schX10 as the 10-dimensional Schoenfeld residual variables. If you do not provide a name, the PHSELECT procedure assigns a default name based on the type of statistic that is requested.

Table 7 summarizes the keywords available in the OUTPUT statement.

Table 7: OUTPUT Statement Keywords

Keyword Description Default Names
Statistic Options
CUMHAZ Specifies the predicted cumulative hazard _CUMHAZ_
STDXBETA Specifies the standard error estimate of the linear predictor _STDXBETA_
SURVIVAL Specifies the predicted survival probability _SURVIVAL_
XBETA Specifies the linear predictor _XBETA_
Diagnostic Options
DFBETA Specifies the standardize deletion parameter differences _DFBETA_
LD Specifies the likelihood displacement _LD_
RESDEV Specifies the deviance residual _RESDEV_
RESMART Specifies the martingale residual _RESMART_
RESSCH Specifies the Schoenfeld residuals _RESSCH_
RESSCO Specifies the score residuals _RESSCO_
WTRESSCH Specifies the weighted Schoenfeld residuals _WTRESSCH_
Other Option
ROLE Specifies the observation role _ROLE_


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

CUMHAZ

specifies the predicted cumulative hazard function at the observed time. The default name is _CUMHAZ_.

DFBETA

requests the approximate changes in the parameter estimates when the jth observation is omitted. These variables are a weighted transform of the score residual variables and are useful in assessing local influence. The default name that is used as a prefix is _DFBETA_.

LD

specifies the approximate likelihood displacement when the observation is omitted. This diagnostic can be used to assess the impact of each observation on the overall fit of the model. The default name is _LD_.

RESDEV

specifies the deviance residual. This variable is a transform of RESMART to achieve a more symmetric distribution. The default name is _RESDEV_.

RESMART

specifies the martingale residual, which, at the observed time t, can be interpreted as the difference over in the observed number of events minus the expected number of events. The default name is _RESMART_.

RESSCH

requests the Schoenfeld residuals, which are useful in assessing the proportional hazards assumption. Schoenfeld residuals are computed only at uncensored times and are missing for censored times. If an effect in the MODEL statement is not included in the final model, the corresponding Schoenfeld residuals are set to missing. The default name that is used as a prefix is _RESSCH_.

RESSCO

requests the score residuals, which are a decomposition of the first partial derivative of the log likelihood. They can be used to assess the leverage that each subject exerts in the parameter estimation. The default name that is used as a prefix is _RESSCO_.

ROLE

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

Table 8: 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.

STDXBETA

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

SURVIVAL

requests the predicted survival probabilities at the observed times. The default name is _SURVIVAL_.

WTRESSCH

requests the weighted Schoenfeld residuals, which are useful in investigating the nature of nonproportionality if the proportional hazard assumption does not hold. If an effect in the MODEL statement is not included in the final model, the corresponding weighted Schoenfeld residuals are set to missing. The default name that is used as a prefix is _WTRESSCH_.

XBETA

specifies the linear predictor. The default name is _XBETA_.

Last updated: May 14, 2026