Shared Concepts

SELECTION Statement

  • SELECTION <METHOD=method<(method-options)>><options>;

This section applies to the following procedures: GENSELECT, LOGSELECT, PHSELECT, QTRSELECT, and REGSELECT.

Procedures in this book that support model selection use the SELECTION statement to control details about the model selection process.

You can specify the following methods in the SELECTION statement:

METHOD=method <(method-options)>

specifies the method used to select the model. You can also specify method-options that apply to the specified method by enclosing them in parentheses after the method.

The following methods are available and are explained in detail in the section Model Selection Methods. By default, METHOD=STEPWISE.

NONE

specifies no model selection.

BACKWARD

specifies backward elimination. This method starts with all effects in the model and deletes effects.

FORWARD

specifies forward selection. This method starts with no effects in the model and adds effects.

STEPWISE

specifies stepwise regression. This method is similar to the FORWARD method except that effects already in the model do not necessarily stay there.

FORWARDSWAP

specifies forward-swap selection, which is an extension of the forward selection method. Before any addition step, the procedure makes all pairwise swaps of one effect in the model and one effect out of the current model that improve the selection criterion. When the selection criterion is R square, this method is the same as the MAXR method in the REG procedure in SAS/STAT software. The only procedure in this book that supports this method is the REGSELECT procedure.

LAR

specifies least angle regression. Like forward selection, this method starts by adding effects to an empty model. The parameter estimates at any step are "shrunk" when they are compared to the corresponding least squares estimates. If the model contains classification variables, then these classification variables are split. For more information, see the SPLIT option in the CLASS statement. The only SAS Viya procedure that supports this method is the REGSELECT procedure.

LASSO

specifies the LASSO method, which adds and deletes parameters by using a version of ordinary least squares in which the sum of the absolute regression coefficients is constrained. If the model contains classification variables, then these classification variables are split. For more information, see the SPLIT option in the CLASS statement.

ELASTICNET

specifies the elastic net method, which is an extension of LASSO that estimates parameters by using a version of ordinary least squares in which both the sum of the absolute regression coefficients and the sum of the squared regression coefficients are constrained.

Note that not all selection methods are applicable to every procedure. Table 8 lists the applicable methods for each of the procedures.

Table 8: Applicable methods by Procedure

method GENSELECT LOGSELECT PHSELECT QTRSELECT REGSELECT
NONE x x x x x
BACKWARD x x x x x
FORWARD x x x x x
STEPWISE x x x x x
FORWARDSWAP x
LAR x
LASSO x x x x
ELASTICNET x


Table 9 lists the applicable method-options for each of these methods.

Table 9: Applicable method-options by method

method-option FORWARD BACKWARD STEPWISE LAR LASSO ELASTICNET
ADAPTIVE x x
CHOOSE= x x x x x x
COMPETITIVE x
CRITERION= x x x
ENSCALE= x
FAST x
LSCOEFFS x x
L2= x
L2HIGH= x
L2LOW= x
L2STEPS= x
MAXEFFECTS= x x x x x
MAXSTEPS= x x x x x x
MINEFFECTS= x x
SELECT= x x x
SLENTRY= x x x x x
SLSTAY= x x x x
STOP= x x x x x x


The syntax of the method-options that you can specify in parentheses after the SELECTION= option method follows. As described in Table 9, not all selection method-options are applicable to every method.

ADAPTIVE <(GAMMA=nonnegative number)>

applies adaptive weights to each of the coefficients when METHOD=LASSO or METHOD=ELASTICNET. Ordinary least squares estimates of the model parameters are used to form the adaptive weights. You use the GAMMA= option to specify the power transformation that is applied to the parameters in forming the adaptive weights. By default, GAMMA=1.

CHOOSE=criterion

chooses from the list of models (at each step of the selection process) the model that yields the best value of the specified criterion. If the optimal value of the specified criterion occurs for models at more than one step, then the model that has the smallest number of parameters is chosen. If you do not specify the CHOOSE= option, then the selected model is the model at the final step in the selection process. The criteria that are supported depend on the type of model that is being fit. For the supported values of criterion, see the chapters for the relevant procedures.

COMPETITIVE

is applicable as a method-option only when METHOD=STEPWISE and the SELECT= criterion is not SL. If you specify the COMPETITIVE option, then the SELECT= criterion is evaluated for all models in which an effect currently in the model is dropped or an effect not yet in the model is added. The effect whose removal from or addition to the model yields the maximum improvement to the SELECT= criterion is dropped or added.

CRITERION=criterion

is an alias for the SELECT= option.

ENSCALE

scales the results of the elastic net method to offset bias from the double shrinkage inherent in this method (Zou and Hastie 2005). This option applies only when you specify METHOD=ELASTICNET. The default is not to rescale the solution; this is the so-called naive elastic net.

FAST

implements the computational algorithm of Lawless and Singhal (1978) to compute a first-order approximation to the remaining slope estimates for each subsequent elimination of a variable from the model. When applied in backward selection, this option essentially leads to approximating the selection process as the selection process of a linear regression model in which the crossproducts matrix equals the Hessian matrix in the full model under consideration. This option is available only when METHOD=BACKWARD is specified. It is computationally efficient because the model is not fit after removal of each effect.

LSCOEFFS

requests a hybrid version of the LAR and LASSO methods, in which the sequence of models is determined by the LAR or LASSO algorithm but the coefficients of the parameters for the model at any step are determined by using ordinary least squares.

L2=value

specifies the ridge regularization parameter to use when you specify METHOD=ELASTICNET. The L2= option is available only when you specify SELECTION=ELASTICNET. If you specify the L2= option, then the value that you specify is used to define the elastic net method, and the L2HIGH=, L2LOW=, and L2STEPS= options are ignored. If you do not specify the L2= option together with METHOD=ELASTICNET, then PROC REGSELECT searches for the suitable value of the L2 parameter according to the values of the L2HIGH=, L2LOW=, and L2STEPS= options.

L2HIGH=value

specifies the highest value to use in the search for the suitable value of the ridge regression parameter L2 when you specify METHOD=ELASTICNET. If you specify the L2= option, then the L2HIGH= option is ignored. By default, L2HIGH=1.

L2LOW=value

specifies the lowest value to use in the search for the suitable value of the ridge regression parameter L2 when you specify METHOD=ELASTICNET. If you specify the L2= option, then the L2LOW= option is ignored. By default, L2LOW=0.

L2STEPS=n

specifies the number of steps in the search for the suitable value of the ridge regression parameter L2 when you specify METHOD=ELASTICNET. If you specify the L2= option, then the L2STEPS= option is ignored. By default, L2STEPS=50.

MAXEFFECTS=n

specifies the maximum number of effects in any model that is considered during the selection process. This option is ignored when METHOD=BACKWARD is specified. If, at some step of the selection process, the model contains the specified maximum number of effects, then no candidates for addition are considered.

MAXSTEPS=n

specifies the maximum number of selection steps that are performed. The default value of n is the number of effects in the MODEL statement when METHOD=FORWARD, METHOD=BACKWARD, or METHOD=LAR. The default is three times the number of effects when METHOD=STEPWISE or METHOD=LASSO.

MINEFFECTS=n

specifies the minimum number of effects in any model that is considered during backward selection. This option is ignored unless METHOD=BACKWARD is specified. The backward selection process terminates if, at some step of the selection process, the model contains the specified minimum number of effects.

SELECT=SL| criterion

specifies the criterion that the procedure uses to determine the order in which effects enter or leave at each step of the selection method. For each step, the effect whose addition to or removal from the current model yields the maximum improvement in the specified criterion is selected. You can use the traditional significance-level approach by specifying the SL criterion; for other supported criteria, see the chapter for the relevant procedure. This option is not valid when METHOD=LAR, METHOD=LASSO, METHOD=ELASTICNET or METHOD=GROUPLASSO.

SLENTRY=value
SLE=value

specifies the significance level for entry when STOP=SL or SELECT=SL. By default, SLENTRY=0.05.

SLSTAY=value
SLS=value

specifies the significance level for staying in the model when STOP=SL or SELECT=SL. By default, SLSTAY=0.05.

STOP=SL | NONE | criterion

specifies a criterion that is used to stop the selection process. The criteria that are supported depend on the type of model that is being fit. For information about the supported criteria, see the chapter for the relevant procedure.

If you do not specify the STOP= option but do specify the SELECT= option, then the criterion specified in the SELECT= option is also used as the STOP= criterion.

You can specify the following values:

NONE

stops the selection process if no suitable add or drop candidates can be found or if a size-based limit is reached. For example, if you specify STOP=NONE MAXEFFECTS=5, then the selection process stops at the first step that produces a model that has five effects.

SL

stops the selection process at the step where the significance level of the candidate for entry is greater than the SLENTRY= value for addition steps when METHOD=FORWARD or METHOD=STEPWISE and where the significance level of the candidate for removal is greater than the SLSTAY= value when METHOD=BACKWARD or METHOD=STEPWISE.

criterion

stops the selection process if the selection process produces a local extremum of this criterion or if a size-based limit is reached. For example, if you specify STOP=AIC MAXSTEPS=5, then the selection process stops before step 5 if the sequence of models has a local minimum of the AIC criterion before step 5. The determination of whether a local minimum is reached is made on the basis of a stop horizon. The default stop horizon is 3, but you can change it by using the STOPHORIZON= option. If the stop horizon is n and the STOP= criterion at any step is better than the stop criterion at the next n steps, then the selection process terminates.

In addition, you can also specify the following options:

DETAILS=NONE | SUMMARY | ALL
DETAILS=STEPS<(CANDIDATES(ALL | n))>

specifies the level of detail to be produced about the selection process. The default is DETAILS=SUMMARY.

The DETAILS=ALL and DETAILS=STEPS options produce the following output:

  • tables that provide information about the model that is selected at each step of the selection process.

  • entry and removal statistics for inclusion or exclusion candidates at each step. By default, only the top 10 candidates at each step are shown. If you specify STEPS(CANDIDATES(n)), then the best n candidates are shown. If you specify STEPS(CANDIDATES(ALL)), then all candidates are shown.

  • a selection summary table that shows by step the effect that is added to or removed from the model in addition to the values of the SELECT, STOP, and CHOOSE criteria for the resulting model.

  • a stop reason table that describes why the selection process stopped.

  • a selection reason table that describes why the selected model was chosen.

  • a selected effects table that lists the effects that are in the selected model.

The DETAILS=SUMMARY option produces only the selection summary, stop reason, selection reason, and selected effects tables. In addition, for METHOD=ELASTICNET without specified L2 value, the DETAILS=SUMMARY option also displays an elastic net summary table, which shows the ridge regularization parameter L2 (in the ratio scaling) and CHOOSE criterion values in each L2 search step.

HIERARCHY=NONE | SINGLE | SINGLECLASS

specifies whether and how the model hierarchy requirement is applied. You can specify that only classification effects, or both classification and continuous effects, be subject to the hierarchy requirement. This option is ignored unless you also specify one of the following options: METHOD=FORWARD, METHOD=BACKWARD, or METHOD=STEPWISE.

Model hierarchy refers to the requirement that, for any term to be in the model, all model effects that are contained in the term must be present in the model. For example, in order for the interaction A*B to enter the model, the main effects A and B must be in the model. Likewise, neither effect A nor effect B can leave the model while the interaction A*B is in the model.

You can specify the following values:

NONE

specifies that model hierarchy not be maintained. Any single effect can enter or leave the model at any step of the selection process.

SINGLE

specifies that only one effect enter or leave the model at one time, subject to the model hierarchy requirement. For example, suppose that the model contains the main effects A and B and the interaction A*B. In the first step of the selection process, either A or B can enter the model. In the second step, the other main effect can enter the model. The interaction effect can enter the model only when both main effects have already entered. Also, before A or B can be removed from the model, the A*B interaction must first be removed. All effects (CLASS and interval) are subject to the hierarchy requirement.

SINGLECLASS

is the same as HIERARCHY=SINGLE except that only CLASS effects are subject to the hierarchy requirement.

By default, HIERARCHY=NONE.

ORDERSELECT

specifies that effects in the selected model are displayed in the order in which they first entered the model. If you do not specify the ORDERSELECT option, then effects in the selected model are displayed in the order in which they appear in the MODEL statement.

PLOT <(global-plot-options)> <= plot-request <(options)>>
PLOTS <(global-plot-options)> <= (plot-request <(options)> <…plot-request <(options)>>)>

controls the selection process plots that are produced through ODS Graphics.

When you specify only one plot request, you can omit the parentheses around it. Here are some examples:

plots=all
plots=coefficients(unpack)
plots(unpack)=(coefficients criteria)

ODS Graphics must be enabled before you can request plots. For example:

ods graphics on;

proc regselect;
   model y = x1-x100;
   selection method=forward plots=all;
run;

ods graphics off;

Global Plot Options

Each global-plot-option applies to all plots that the SELECTION statement generates, unless you alter the option by using a specific plot option that follows a plot-request. You can specify the following global-plot-options:

ENDSTEP=n

terminates the step ranges shown on the horizontal axes of plots at the specified step. By default, the step range that is shown terminates at the final step of the selection process.

LOGP | LOGPVALUE

uses a logarithmic axis to display entry and removal significance levels.

MAXPARMLABEL=n

specifies the maximum number of characters beyond which all parameter labels on the coefficient progression panel and the coefficient progression plot are suppressed. By default, MAXPARMLABEL=20.

MAXSTEPLABEL=n

specifies the maximum number of characters of effect labels to display on the horizontal axes of the plots. By default, MAXSTEPLABEL=20. If the length of any effect label exceeds n, then step numbers are used on the horizontal axes of the plots.

STARTSTEP=n

specifies that the step ranges shown on the horizontal axes of plots start at the specified step. By default, the step range that is shown starts at the initial step of the selection process.

STEPAXIS=EFFECT | NORMB | NUMBER

specifies the horizontal axis to be used on the plots, where this axis represents the sequence of entering or departing effects. You can specify the following values:

EFFECT

requests that each step be labeled by a prefix followed by the name of the effect that enters or leaves at that step. The prefix consists of the step number, followed by a "+" or a "-" sign, depending on whether the effect enters (+) or leaves (-) at that step.

NORMB

requests that the horizontal axis value at step i be the L1 norm of the parameters at step i, normalized by the L1 norm of the parameters at the final step. STEPAXIS=NORMB is valid only with the LAR, LASSO, and elastic net selection methods.

NUMBER

requests that each step be labeled by the step number.

UNPACK | UNPACKPANEL

suppresses paneling. By default, multiple plots can appear in the coefficient progression panel and the criteria panel. Specify UNPACK to see each plot individually. You can also specify UNPACK as a suboption of the CRITERIA and COEFFICIENTS options.

Specific Plot Options

You can specify the following plot-requests and their options:

ALL

produces all relevant plots.

COEFFICIENTS | COEFFICIENTPANEL <(UNPACK | UNPACKPANEL)>

creates a panel of two plots. The upper plot shows the progression of the parameter values as the selection process proceeds. The lower plot shows the progression of the CHOOSE= criterion. If no CHOOSE= criterion is in effect, then only the coefficient progression is shown. If you specify the UNPACK option, then the coefficient progression and the CHOOSE= criterion progression are shown in separate plots.

CRITERIA | CRITERIONPANEL <(UNPACK | UNPACKPANEL)>

creates a panel of model fit criteria. If you specify the UNPACK option, then each criterion progression is shown in a separate plot.

FITBYROLE

plots the progression of a fit statistic on the training, test, and validation data. The fit statistic that is displayed depends on the type of model that is being fit. The fit by role plot is not produced if you do not specify a PARTITION statement.

NONE

suppress all selection process plots, even if you specify other plot options.

SELECTION=method <(method-options)>

is an alias for the METHOD= option.

STOPHORIZON=n

specifies the number of consecutive steps at which the STOP= criterion must worsen in order for a local extremum to be detected. For example, suppose that STOP=AIC and the sequence of AIC values at steps 1 to 6 of a selection are 10, 7, 4, 6, 5, 2. If STOPHORIZON=2, then the AIC criterion is deemed to have a local minimum at step 3 because the AIC value at the next two steps are greater than the value 4 that occurs at step 3. However, if STOPHORIZON=3, then the value at step 3 is not deemed to be a local minimum because the AIC value at step 6 is lower than the AIC value at step 3. If you specify STOP=NONE then the stop horizon value is ignored. If you specify STOP=SL, then n is ignored and STOPHORIZON=1 is used. By default, STOPHORIZON=3 unless otherwise stated in individual procedure chapters.

Last updated: November 05, 2020