Tutorials › Regression Analysis (Undergraduate) › Comparing Stability Across Selection Procedures

Subset and Stepwise Selection · Tutorial 662 of 991

Comparing Stability Across Selection Procedures

Use a shared resampling plan to compare how often selection procedures choose each predictor and how similar their selected models are.

Advanced 9 min read

What You'll Learn

  • Set up a fair resampling comparison of best-subset, forward, and backward selection.
  • Calculate predictor inclusion frequencies from repeated selected models.
  • Measure selected-model overlap with the Jaccard index.
  • Distinguish exact model agreement from partial overlap.
  • Interpret stability summaries without treating them as proof that a predictor is important.

Why Compare Selection Procedures?

A variable-selection result can depend on more than the observed data. It can also depend on which search procedure is used and which observations happen to be in the analysis sample. With correlated predictors, for example, two variables may carry similar information, so a procedure may choose one in some samples and the other in others. A useful stability comparison therefore asks two related questions: How consistently does each procedure select each predictor? And how similar are the complete selected models?

These questions are not interchangeable. A procedure may repeatedly select one predictor while varying the rest of its model. Alternatively, two procedures may have similar predictor inclusion frequencies but select different combinations on particular resamples. Inclusion frequencies summarize predictors one at a time; model overlap summarizes the selected sets together.

A Shared Resampling Plan

For a fair comparison, all procedures should be applied to the same resampled data sets. Otherwise, a difference in results could be due to the procedures, the samples, or both. Before starting, specify the response, the candidate predictors, any forced or excluded predictors, the resampling plan, and the rule that determines the final selected model. Use the same choices wherever they apply to the three procedures.

In the hypothetical illustration below, five candidate predictors are labelled A, B, C, D, and E. A plan draws ten subsamples without replacement from one hypothetical data set. For each subsample, best-subset, forward, and backward selection are run on that same subsample, using the same candidate set and prespecified rule for choosing a final model. The table lists the predictors in each selected model. It is an illustrative set of hypothetical outcomes, not evidence from a real data set.

SubsampleBest-subsetForwardBackward
1ABABAB
2ACABABC
3ABCACAC
4ABABAB
5ACABCABD
6BDABBC
7ACADACD
8ABABAB
9BCDBDEBDE
10ACABAC

A model label such as ABC means that the selected model contains A, B, and C. The same row number always refers to the same resampled data set across all three procedures. This pairing matters: it lets us compare the procedures’ results under the same data perturbation.

Predictor Inclusion Frequencies

Definition: For a particular selection procedure, the inclusion frequency of a predictor is the number of resampled fits in which that predictor appears in the selected model, divided by the total number of resampled fits. With \(B\) resamples, its value ranges from 0 to 1. It is often reported as a proportion or percentage.

An inclusion frequency describes the behavior of a specified procedure under a specified resampling plan. It is not the probability that a predictor is truly relevant, and it is not a test of whether its regression coefficient is nonzero. Changing the resampling fraction, model-selection rule, candidate set, or procedure can change the frequency.

Worked Example: Counting Inclusion Frequencies

Calculate the inclusion frequencies of A and C for best-subset and forward selection using the ten models in the table.

For best-subset selection, A appears in models 1, 2, 3, 4, 5, 7, 8, and 10. It appears in 8 of the 10 selected models, so its inclusion frequency is

$$ \frac{8}{10}=0.80 $$

C appears in best-subset models 2, 3, 5, 7, 9, and 10. Its frequency is

$$ \frac{6}{10}=0.60 $$

For forward selection, A appears in models 1 through 8 and model 10. Model 9, BDE, is the only forward model without A. Thus A appears in 9 of 10 models, not 8:

$$ \frac{9}{10}=0.90 $$

Forward selection includes C in models 3 and 5, giving \(2/10=0.20\). In this illustration, forward selection includes A one more time than best-subset selection (9/10 versus 8/10), while best-subset selection includes C more often (6/10 versus 2/10).

The complete counts make it easier to compare patterns without relying on a few selected models. The numerator in each entry is the number of resamples in which the predictor was selected; the denominator is ten for every procedure.

PredictorBest-subsetForwardBackward
A8/10 = 0.809/10 = 0.908/10 = 0.80
B6/10 = 0.608/10 = 0.807/10 = 0.70
C6/10 = 0.602/10 = 0.205/10 = 0.50
D2/10 = 0.202/10 = 0.203/10 = 0.30
E0/10 = 0.001/10 = 0.101/10 = 0.10

These are descriptive summaries of the ten outputs. For instance, A has a high inclusion frequency for all three procedures in this illustration, while C is selected much less often by forward selection than by best-subset selection. Such differences suggest where selection behavior is sensitive to the procedure. They do not by themselves explain why the procedures differ or establish which model is scientifically preferable.

Comparing Selected-Model Overlap

Definition: For two selected predictor sets \(S_1\) and \(S_2\), the Jaccard index is the number of predictors in both sets divided by the number of predictors in either set: $$ J(S_1,S_2)=\frac{|S_1\cap S_2|}{|S_1\cup S_2|} $$ For nonempty selected models, this index ranges from 0 (no shared predictors) to 1 (identical predictor sets).

The numerator counts shared predictors; the denominator counts distinct predictors appearing in at least one of the models. The ratio is at most 1 because the intersection is contained in the union, so \(|S_1\cap S_2|\leq |S_1\cup S_2|\). It equals 1 precisely when the sets are identical: if the intersection and union have the same size, there can be no predictor in one set but not the other. It equals 0 when the intersection is empty. This measure compares predictor membership, not coefficient values or predictive accuracy.

Worked Example: Calculating Overlap on One Subsample

On subsample 5, best-subset selects AC and forward selection selects ABC. Their shared predictors are A and C, so the intersection has size 2. Their union contains A, B, and C, so the union has size 3. The Jaccard index is

$$ J(\{A,C\},\{A,B,C\})=\frac{2}{3}=0.667 $$

The models overlap substantially but are not identical: forward selection also includes B. By contrast, on subsample 1 both methods select AB, and their Jaccard index is \(2/2=1\). On subsample 6, best-subset selects BD while forward selects AB; they share only B, and their union is A, B, and D, giving \(1/3=0.333\).

To summarize overlap across the full resampling plan, calculate a Jaccard index for each paired set of outputs, then average those ten indices. The mean gives each resample equal weight. Also report the exact agreement rate when useful: it is the proportion of paired outputs whose selected predictor sets are identical. Exact agreement is stricter than a high Jaccard index, since even one additional predictor makes two sets different.

Worked Example: Summarizing Pairwise Stability

Compare best-subset with forward selection across all ten paired subsamples. Their Jaccard indices, in subsample order, are 1, 1/3, 2/3, 1, 2/3, 1/3, 1/3, 1, 1/2, and 1/3. Their mean is

$$ \frac{1+\frac{1}{3}+\frac{2}{3}+1+\frac{2}{3}+\frac{1}{3}+\frac{1}{3}+1+\frac{1}{2}+\frac{1}{3}}{10} =\frac{37}{60}\approx 0.617 $$

The two procedures select exactly the same set on subsamples 1, 4, and 8, so their exact agreement rate is \(3/10=0.30\). Their mean Jaccard index is higher than their exact agreement rate because several other paired models share some, but not all, predictors.

The same calculation gives a mean Jaccard index of \(0.750\) for forward versus backward selection and \(0.708\) for best-subset versus backward selection. Their exact agreement rates are \(5/10=0.50\) and \(4/10=0.40\), respectively. In this particular illustration, forward and backward selection have the greatest average overlap, but no procedure is guaranteed to have the greatest overlap on another data set or under another plan.

How to Read the Comparison

Inclusion frequencies and overlap answer different questions, so a useful report presents them together. Frequencies identify predictors whose selection is sensitive to the procedure or resampling. Pairwise overlap indicates whether the procedures tend to return similar combinations of predictors on the same resamples. Exact agreement adds a simple summary of how often the entire sets match.

The average Jaccard index can hide variation across resamples. For example, a moderate mean might arise from mostly similar models with a few large disagreements, or from consistently partial overlap. Looking at individual paired results, or reporting a range or distribution of the indices, helps reveal that distinction. With only ten resamples, as in this teaching illustration, the summaries are coarse; a real analysis should choose a resampling plan with enough repetitions for its descriptive purpose and report that plan clearly.

A resampling frequency is conditional on the observed data and the chosen resampling scheme. It does not account for every source of uncertainty, and it cannot turn a selected model into a confirmed scientific explanation. A predictor selected frequently may be a useful candidate under the stated procedure, but selection frequency alone is not a measure of causal effect, coefficient precision, or out-of-sample prediction quality.

Common Mistake

Wrong reasoning: “A appears in 8 of the 10 forward models, so its inclusion frequency is 0.80.” This count overlooks that forward models 1–8 and 10 include A; only model 9, BDE, omits it.

Correction: Check every row of the relevant procedure’s column. A appears in 9 of 10 forward models, so its inclusion frequency is \(9/10=0.90\). More generally, count one selection for each resample containing the predictor, and use the number of resamples—not the total number of predictor appearances—as the denominator. Also avoid treating high inclusion frequency as proof that a predictor is truly important.

Key takeaway: Compare selection procedures on the same resampled data sets. Use inclusion frequencies to summarize predictor-by-predictor selection and a set-overlap measure such as the Jaccard index to summarize paired models. Interpret both as descriptions of stability under the stated analysis plan, not as proof of scientific importance.

Check Your Understanding

Use the definitions and hypothetical results above to answer these questions.

  1. In how many best-subset models does B appear, and what is its inclusion frequency?
  2. For subsample 7, best-subset selects AC and backward selection selects ACD. Calculate their Jaccard index.
  3. Why should all three procedures be applied to the same subsamples when comparing their outputs?
  4. What is the difference between a mean Jaccard index and an exact model agreement rate?
  5. Why does an inclusion frequency of 0.90 not mean there is a 90% probability that a predictor is truly important?
Clinical Biostats