Shared Concepts

SELECTION Statement

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

This section applies to the following procedures: CNTSELECT and SEVSELECT.

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 to be used to select the model. You can also specify method-options to 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.

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.

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.

MCP

specifies the MCP method, which minimizes ordinary least squares plus the minimax concave penalty (MCP) function. As an alternative to the convex penalized methods such as LASSO and ELASTICNET, MCP is one of the nonconvex penalized methods.

NONE

specifies no model selection.

SCAD

specifies the SCAD method, which minimizes ordinary least squares plus the smoothly clipped absolute deviation (SCAD) function. As an alternative to the convex penalized methods such as LASSO and ELASTICNET, SCAD is one of the nonconvex penalized methods.

STEPWISE

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

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

Table 6: Applicable method-options by method

method-option FORWARD BACKWARD STEPWISE
CHOOSE = x x x
COMPETITIVE x
CRITERION = x x x
MAXEFFECTS = x x
MAXSTEPS = x x x
MINEFFECTS = x
SELECT = x x x
STOP = 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 6, not all selection method-options are applicable to every method.

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 omit the CHOOSE= method-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. If you specify the COMPETITIVE method-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= method-option.

MAXEFFECTS=n

specifies the maximum number of effects in any model that is considered during the selection process. This method-option is ignored when you specify METHOD=BACKWARD. 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 to perform. The default value of n is the number of effects in the MODEL statement when METHOD=FORWARD or METHOD=BACKWARD. The default is three times the number of effects when METHOD=STEPWISE.

MINEFFECTS=n

specifies the minimum number of effects in any model that is considered during backward selection. This method-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=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. For supported criteria, see the chapter for the relevant procedure.

STOP=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 omit this method-option but specify the SELECT= method-option, then the criterion specified in the SELECT= method-option is also used as the criterion for the STOP= method-option.

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.

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 with neither a specified L2 value nor a solver specification, 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 to apply the model hierarchy requirement. 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 SCALEMODEL or 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. The only procedure in this book that supports this option is the SEVSELECT procedure.

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 sevselect;
   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.

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 | 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.

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.

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: July 09, 2026