Tutorials › Regression Analysis (Undergraduate) › Confidence Intervals After Model Selection

Subset and Stepwise Selection · Tutorial 658 of 991

Confidence Intervals After Model Selection

See how searching the data before reporting an interval changes its repeated-sampling behavior, and work through an example of post-selection undercoverage.

Advanced 9 min read

What You'll Learn

  • Define a post-selection interval and distinguish it from inference for a model specified in advance.
  • Identify how searching the same data changes the distribution of selected estimates.
  • Calculate undercoverage in a repeated-sampling example with independent candidate predictors.
  • Compare a selected coefficient’s ordinary p-value with the chance of finding an equally extreme result in a search.
  • Recognize when ordinary regression intervals are not justified after model selection.

Why Selection Changes the Meaning of an Interval

A regression confidence interval is usually introduced for a model that has already been specified. Variable-selection procedures change that setting: the data help decide which model will be reported. If the same outcomes are used both to search and to estimate the selected model, the reported coefficient is not an ordinary estimate from a model chosen in advance. The search tends to favor estimates that look unusually large relative to their standard errors.

That tendency affects more than the point estimate. A conventional standard error, confidence interval, or p-value calculated after selection generally acts as though the reported model had been fixed before observing the data. It does not account for the fact that other candidate models were considered and not reported. The resulting intervals can have less than their advertised repeated-sampling coverage, and p-values can look more impressive than the search warrants.

Definition: A post-selection confidence interval is an interval reported for a parameter in a model chosen using the observed data. A naive post-selection interval is calculated using the usual fixed-model formula, without adjusting for how the model was selected.

What the Usual Regression Interval Assumes

For a model specified in advance, write the linear regression model as \(Y=X\beta+\varepsilon\). Here \(Y\) is the response vector, \(X\) is the fixed design matrix, and \(\beta\) is the vector of regression coefficients. For the standard finite-sample \(t\) interval, assume that \(X\) has full column rank and that the errors are independent with a common variance and a normal distribution: \(\varepsilon\sim N(0,\sigma^2 I)\). The model also assumes that the conditional mean of \(Y\) is \(X\beta\).

If the model has \(q\) coefficients, including any intercept, its residual degrees of freedom are \(df=n-q\). For coefficient \(\beta_j\), the usual interval is

$$ \hat{\beta}_j \pm t_{1-\alpha/2,\,n-q}\,SE(\hat{\beta}_j). $$

Under the stated assumptions and with the model fixed in advance, this procedure has repeated-sampling coverage \(1-\alpha\): over repeated samples, the interval contains the fixed coefficient \(\beta_j\) in a proportion \(1-\alpha\) of samples. The same fixed-model framework gives a \(t\) statistic for testing a coefficient. The usual interpretation of its p-value also presumes that the model and test were specified independently of the outcome data used for the test.

After a search, the selected model is itself a function of the observed outcomes. The selected coefficient and its standard error are therefore being examined in a different sampling process. The usual formula does not include the extra variation and selection induced by that process. This does not mean every post-selection interval must miss its target, nor that every search has the same effect. It means the fixed-model guarantee no longer follows just by applying the familiar formula to the selected model.

Worked Example: Coverage After Choosing the Largest Result

Consider a hypothetical setting with eight candidate predictors. Suppose all eight true coefficients are zero, their design columns are mutually orthogonal, and the Gaussian error variance is known. A search selects the predictor with the largest absolute standardized coefficient estimate. These conditions make the calculation especially transparent; the example isolates the effect of searching.

For candidate \(j\), let \(Z_j=\hat{\beta}_j/SE(\hat{\beta}_j)\). Under the null coefficients and the stated normal-error assumptions, each \(Z_j\) has a standard normal distribution. Orthogonality makes these statistics independent. Let \(J\) be the selected predictor, so that \(|Z_J|=\max_j|Z_j|\). The ordinary nominal 95% interval for the selected coefficient is \(\hat{\beta}_J\pm1.96SE(\hat{\beta}_J)\).

All the target coefficients are zero. Consequently, the selected interval covers its target exactly when \(|Z_J|\leq1.96\). Since \(J\) is the index with the largest absolute statistic, this event occurs only when every candidate statistic lies between \(-1.96\) and \(1.96\). Independence gives

$$ P(\text{selected interval covers}) =P\left(\max_{1\leq j\leq8}|Z_j|\leq1.96\right) =\left[P(|Z_1|\leq1.96)\right]^8 \approx(0.95)^8 \approx0.6634. $$

Thus, in this hypothetical repeated-sampling setting, the selected interval covers the selected coefficient only about 66.3% of the time, not 95%. This is an unconditional coverage calculation across repetitions of the entire search-and-interval procedure. It is not a claim that every selected interval has precisely this coverage: the result depends on the example’s assumptions and selection rule.

An Apparently Strong Result From a Search

The same selection effect can be seen in a p-value. If a single test had been specified in advance, an observed statistic far from zero might provide evidence against its null hypothesis. But if many candidate tests were examined and only the most extreme result was reported, the relevant question also includes how often a search would find a result at least that extreme when all the null hypotheses are true.

Worked Example: A Selected Statistic of 2.55

Suppose a hypothetical search examines eight independent, orthogonal candidate predictors whose true coefficients are all zero. The largest absolute standardized coefficient is \(2.55\). If this one test had been fixed in advance, its two-sided standard normal p-value would be approximately \(0.0108\).

Under the global null in this example, each candidate has probability about \(0.0108\) of producing an absolute statistic at least \(2.55\). The probability that at least one of the eight does so is

$$ 1-(1-0.0108)^8 =1-(0.9892)^8 \approx0.0832. $$

The displayed calculation uses the rounded single-test p-value \(0.0108\); using the unrounded normal-tail probability gives approximately \(0.0830\). The search-level probability is therefore about 8.3%, rather than about 1.1%. In this particular independent global-null example, the ordinary p-value describes a single prespecified comparison, while the larger probability describes the chance that at least one of the eight comparisons is this extreme or more extreme. This calculation is not a universal correction for every selection algorithm or every null hypothesis.

How the Amount of Searching Matters

The previous calculation has a simple general form in the special case of \(k\) independent candidate statistics, all standard normal under their null hypotheses. If the selected statistic is the largest in absolute value, then a conventional 95% interval covers its zero target only if none of the \(k\) statistics exceeds 1.96 in absolute value. The coverage in this example is approximately \(0.95^k\). As the number of opportunities to select an unusually large result increases, the chance that all statistics remain within the ordinary interval’s limits decreases.

Worked Example: Four Candidate Predictors

Now suppose a hypothetical search compares four independent, orthogonal candidate predictors, again with all true coefficients equal to zero and normally distributed errors. It selects the predictor with the largest absolute standardized estimate. Using the same nominal 95% cutoff, the probability that the selected interval covers its zero coefficient is

$$ P(\text{coverage}) \approx(0.95)^4 =0.81450625 \approx0.8145. $$

The corresponding probability of at least one statistic exceeding the 1.96 cutoff is

$$ 1-(0.95)^4 =1-0.81450625 =0.18549375 \approx0.1855. $$

So this selected interval has about 81.5% coverage in the stated example, and there is about an 18.5% chance that the search finds at least one nominally significant result when all four coefficients are zero. The calculation illustrates the role of search size; it should not be transferred unchanged to correlated predictors, searches using different criteria, or models whose errors and assumptions differ.

What the Examples Do—and Do Not—Establish

The examples use an especially simple model so that the selection effect can be calculated exactly. Real subset and stepwise searches may compare correlated predictors, use entry or removal rules, or select model size using a criterion other than the largest individual statistic. In those settings, the selected estimates are generally dependent, and the simple powers and family-level probabilities above need not apply. The central point remains: ordinary output from the final model does not automatically account for all the candidate models considered along the way.

There is an important contrast with a model specified before examining the outcomes. If the model truly was fixed in advance and the regression assumptions hold, ordinary coefficient intervals and tests retain their familiar fixed-model interpretation. Likewise, a selection decision made using data that are independent of the data used for inference does not create this particular reuse-of-the-same-outcomes problem. But when selection and estimation use the same outcomes, the usual standard error does not by itself measure uncertainty from the entire search.

Common Mistake: Treating the Final Model as if It Was Chosen in Advance

A common mistake is to say, “The final model has a 95% interval, so it has 95% coverage,” simply because a standard regression program printed that interval. That reasoning ignores how the model was obtained. If the data were searched to find a promising model or coefficient, the ordinary interval’s fixed-model coverage result does not automatically carry over to the complete procedure.

The correction is to describe the inference honestly: the reported interval is an ordinary fixed-model interval calculated after selection, and its nominal level does not by itself guarantee that level of repeated-sampling coverage. The p-value likewise should not be read as though only one prespecified test had been carried out. Exact post-selection procedures exist for particular selection rules and assumptions, but their validity depends on accounting for the actual selection mechanism; changing only the wording on a conventional interval does not do this.

Key takeaway: A nominal 95% interval from a selected regression model is not automatically a 95% interval for the whole search-and-report procedure. Selection based on the same outcomes can make estimates look extreme and can cause ordinary standard errors, intervals, and p-values to understate the uncertainty created by searching.

Check Your Understanding

Use the assumptions and examples in this tutorial to answer the following questions.

  1. In the eight-predictor example, why does the selected interval cover zero only when all eight standardized statistics lie between \(-1.96\) and \(1.96\)?
  2. For four independent null candidate statistics, calculate the approximate coverage of a nominal 95% interval around the largest absolute result.
  3. In the example with an observed statistic of \(2.55\), distinguish the single-test p-value from the probability that at least one of eight tests is at least that extreme.
  4. Why does the usual fixed-model coverage guarantee not automatically apply when the model is selected using the same outcomes?
  5. Does the formula \(0.95^k\) apply to every stepwise or best-subset search? Explain why or why not.