VARREDUCE Procedure

PROC VARREDUCE Statement

  • PROC VARREDUCE <options>;

The PROC VARREDUCE statement invokes the procedure. Table 1 summarizes the important options in the PROC VARREDUCE statement by function. The options are then described fully in alphabetical order.

Table 1: PROC VARREDUCE Statement Options

Option Description
Basic Options
DATA= Specifies the input data table
Options Related to Variable Selection
NOPRINT Suppresses ODS output
MATRIX= Specifies the matrix to use to select variables
TECHNIQUE= Selects the variable selection technique
OUTCP= Outputs the CORR, COV, or SSCP matrix, which is specified in the MATRIX= option


You can specify the following options:

DATA=libref.data-table

names the input data table for PROC VARREDUCE to use. The default is the most recently created data table. 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 the data. For more information about libref, see the section Using SAS Viya Workbench.

data-table

specifies the name of the input data table.

MATRIX=CORR | COV | SSCP

specifies which matrix to use to select variables.

You can specify the following values:

CORR

selects variables based on the Pearson correlation matrix. Assuming that X and Y are two variables, the correlation between X and Y is computed by

COV

selects variables based on the covariance matrix. Assuming that X and Y are two variables, the covariance between X and Y is computed by

SSCP

selects variables based on the sums of squares and crossproducts matrix. Assuming that X and Y are two variables and that and are their corresponding variable vectors, the SSCP between X and Y is computed by

By default, MATRIX=CORR.

NOPRINT

suppresses the generation of ODS output.

OUTCP=libref.data-table < / LIST <EPS = number>>

creates a data table that contains a symmetric matrix that depicts the relationships among variables and also creates a set of statistics about the input data table and variables. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using SAS Viya Workbench. Depending on the value of the MATRIX= option, the symmetric matrix can be a correlation (CORR) matrix, a covariance (COV) matrix, or a sums of squares and crossproducts (SSCP) matrix.

When you specify the LIST option, the symmetric matrix is output in the list-of-list (LIL) format. In this format, the matrix is represented as a set of tuples , where x is an entry in the matrix and i and j denote its row and column indices, respectively. LIL format can be used when the output contains too many columns to fit in a data table. For example, in most database systems, the maximum number of columns in a table is usually limited to several thousand. If an output matrix contains more columns than the limit, you must use the LIST option to avoid errors that would arise from writing too many columns to the table. When LIL format is used, all 0 entries in the matrix are ignored in the output.

When you specify EPS= number in the LIST suboption, matrix entries whose absolute value is smaller than number are ignored in the output. This feature helps omit unreliable estimations and generate a compact representation of the matrix. When you do not specify the EPS= option, only the 0 entries in the matrix are ignored in the output.

TECHNIQUE=keyword
TECH=keyword

specifies the variable selection technique.

You can specify the following keywords:

VARIANCEANALYSIS | VAR

performs variance analysis for variable selection.

DISCRIMINANTANALYSIS | DSC

performs discriminant analysis for variable selection.

By default, TECHNIQUE=VAR.

You can use variance analysis for both supervised and unsupervised variable selection. You can use discriminant analysis only for supervised variable selection that uses one classification variable as the response. For more information, see the section Variable Selection for Classification.

Last updated: May 14, 2026