The QUANTREG Procedure

OUTPUT Statement

  • OUTPUT <OUT=SAS-data-set> keyword=name <…keyword=name> </ COLUMNWISE>;

The OUTPUT statement creates a SAS data set to contain statistics that are calculated after PROC QUANTREG fits models for all specified quantiles that are specified in the QUANTILE= option in the MODEL statement. At least one specification of the form keyword=name is required.

All variables in the original data set are included in the new data set, along with the variables that are created from options in the OUTPUT statement. These new variables contain fitted values and estimated quantiles. If you want to create a SAS data set in a permanent library, you must specify a two-level name. For more information about permanent libraries and SAS data sets, see SAS Language Reference: Concepts.

If you specify multiple quantiles in the MODEL statement, the COLUMNWISE option arranges the created OUTPUT data set in columnwise form. This arrangement repeats the input data for each quantile. By default, the OUTPUT data set is created in rowwise form. For each appropriate keyword specified in the OUTPUT statement, one variable for each specified quantile is generated. These variables appear in the sorted order of the specified quantiles.

The following specifications can appear in the OUTPUT statement:

OUT=SAS-data-set

specifies the new data set. By default, PROC QUANTREG uses the DATAn convention to name the new data set.

keyword=name

specifies the statistics to include in the output data set and gives names to the new variables. For each desired statistic, specify a keyword from the following list of keywords, an equal sign, and the name of a variable to contain the statistic.

You can specify the following keywords:

LEVERAGE

specifies a variable to indicate leverage points. To include this variable in the OUTPUT data set, you must specify the LEVERAGE option in the MODEL statement. See the section Leverage Point and Outlier Detection for how to define LEVERAGE.

MAHADIST | MD

names a variable to contain the Mahalanobis distance. To include this variable in the OUTPUT data set, you must specify the LEVERAGE option in the MODEL statement.

OUTLIER

specifies a variable to indicate outliers. See the section Leverage Point and Outlier Detection for how to define OUTLIER.

PREDICTED | P

names a variable to contain the estimated response.

QUANTILE | Q

names a variable to contain the quantile for which the quantile regression is fitted. If you specify the COLUMNWISE option, this variable is created by default. If multiple quantiles are specified in the MODEL statement and the COLUMNWISE option is not specified, this variable is not created.

RESIDUAL | RES

names a variable to contain the residuals (unstandardized):

\[  {y_ i - \mb{x}_ i^{\prime }{\hat\bbeta }}  \]
ROBDIST | RD

names a variable to contain the robust MCD distance. To include this variable in the OUTPUT data set, you must specify the LEVERAGE option in the MODEL statement.

SPLINE | SP

names a variable to contain the estimated spline effect, which includes all spline effects in the model and their interactions.

SRESIDUAL | SR

names a variable to contain the standardized residuals:

\[  {\frac{y_ i - \mb{x}_ i^{\prime }{\hat\bbeta }}{\hat\sigma }}  \]

See the section Leverage Point and Outlier Detection for how to compute $\sigma $.

STDP

names a variable to contain the estimates of the standard errors of the estimated response.