Tutorials › Generalized Linear Models › Inference After GLM Model Selection

Selection and Predictive Comparison · Tutorial 815 of 981

Inference After GLM Model Selection

Understand what ordinary GLM intervals do and do not account for after model selection, and choose a defensible strategy for inference.

Advanced 12 min read

What You'll Learn

  • Explain why selecting a model using the data changes the distribution of reported estimates.
  • Distinguish uncertainty within a fitted GLM from uncertainty caused by selecting the model.
  • Use an independent inference sample to separate selection from estimation.
  • Interpret a selective-inference adjustment in a simple truncated-normal example.
  • Report post-selection estimates cautiously when formal adjustment is unavailable.

Why Inference Changes After Selection

A GLM standard error describes uncertainty under a specified model and estimation procedure. If the model was chosen after inspecting the same responses—for example, by trying predictors, transformations, or interactions and retaining the most promising specification—then the reported coefficient and standard error come from a data-dependent procedure. The usual confidence interval typically treats the final model as if it had been fixed in advance. That is a different sampling problem.

This does not mean that every selected-model interval is useless, or that selection always makes an interval too narrow by the same amount. It means the ordinary calculation does not, by itself, account for the selection rule. The size and direction of the resulting error depend on what was searched, how models were compared, and what parameter the interval is intended to describe.

Definition: Post-selection inference concerns estimation, testing, or interval construction after a model or set of hypotheses has been chosen using data. Selection uncertainty is the additional uncertainty associated with that data-dependent choice. An ordinary GLM standard error generally quantifies uncertainty for coefficient estimation in the fitted model under its assumptions; it does not automatically quantify selection uncertainty.

It is useful to be precise about the target. A coefficient in a particular GLM is generally a model-specific parameter: it describes the fitted linear predictor under that model and its covariate specification. If a different model is selected, the corresponding coefficient may represent a different target. Thus, even a method that correctly accounts for selection must say what parameter it is making inference about.

A Simple Derivation of Selection Bias

The winner’s curse in GLM selection has a simple analogue. Suppose two candidate procedures estimate the same scalar quantity \(\theta\), with estimates \(Z_1\) and \(Z_2\). For illustration, assume \(Z_1\) and \(Z_2\) are independent \(N(\theta,1)\) variables, and report the larger estimate. This is not a general GLM result; it isolates the effect of choosing a winner.

Result: Under those assumptions, \(E[\max(Z_1,Z_2)] = \theta + 1/\sqrt{\pi}\). Thus, choosing the larger of two unbiased estimates produces an upward-biased reported estimate, even though each estimate separately is unbiased.

Derivation. Write \(Z_1=\theta+\epsilon_1\) and \(Z_2=\theta+\epsilon_2\), where the errors are independent \(N(0,1)\). The identity \(\max(a,b)=(a+b+|a-b|)/2\) gives

$$ E[\max(Z_1,Z_2)] =\theta+\frac{1}{2}E[|\epsilon_1-\epsilon_2|]. $$

Because \(\epsilon_1-\epsilon_2\sim N(0,2)\), it can be written as \(\sqrt{2}U\), where \(U\sim N(0,1)\). Direct integration of the standard normal density gives \(E[|U|]=\sqrt{2/\pi}\). Therefore \(E[|\epsilon_1-\epsilon_2|]=2/\sqrt{\pi}\), proving the result. The same selection logic can affect GLM analyses when candidate models, terms, or transformations are compared and the apparently strongest result is reported.

Worked Example: Selecting the Larger of Two Estimates

Suppose \(\theta=0\), and two independent procedures produce \(Z_1,Z_2\sim N(0,1)\). If the analyst reports \(M=\max(Z_1,Z_2)\), the derivation above gives \(E[M]=1/\sqrt{\pi}\approx0.564\). Each procedure has expectation zero, but the selected estimate has positive expectation.

For a particular pair of results, say \(Z_1=0.30\) and \(Z_2=1.10\), the reported estimate is 1.10 because it is the larger value. A conventional standard error attached to \(Z_2\) as if it had been specified in advance does not describe the distribution of this selection procedure. The example does not say that every GLM search has bias 0.564; its point is that selection can change the distribution even when the individual estimates are unbiased.

What the Ordinary GLM Interval Conditions On

In a regular, prespecified GLM, a Wald interval for a coefficient \(\beta_j\) commonly has the form \(\hat\beta_j\pm z_{1-\alpha/2}\widehat{\operatorname{se}}(\hat\beta_j)\). Its familiar approximate coverage relies on the model and estimation assumptions, and on the usual large-sample approximation for the estimator. If the same data were also used to choose the model, the usual calculation generally acts as though that choice had not occurred.

One way to see the issue is to examine a simplified normal calculation. Let \(Z\sim N(\theta,1)\), and suppose an analyst reports \(Z\) only when \(Z>c\). Conditional on being reported, \(Z\) no longer has its original normal distribution. Its conditional density is

$$ f(z\mid Z>c;\theta) =\frac{\phi(z-\theta)}{P_\theta(Z>c)} \quad\text{for }z>c, $$

where \(\phi\) is the standard normal density and \(P_\theta(Z>c)=1-\Phi(c-\theta)\). The denominator is required because the density is conditional on passing the selection rule. Treating the observed \(Z\) as an unselected normal observation omits that conditioning.

Result: If \(Z\sim N(0,1)\) and an estimate is reported only when \(Z>1.96\), the ordinary two-sided 95% Wald interval \(Z\pm1.96\) has conditional coverage zero for \(\theta=0\) among reported results. Indeed, every reported value satisfies \(Z>1.96\), so the interval’s lower endpoint \(Z-1.96\) is positive and the interval excludes zero.

This deliberately stark threshold example is not a description of every model-selection algorithm. It demonstrates why an unconditional standard error and interval cannot simply be assumed to retain their usual interpretation after selection. A real GLM search can involve a complicated selection event rather than one threshold, and the right adjustment depends on that event.

Worked Example: A Selective Tail Probability

Use the same standard normal setting with null value \(\theta=0\), selection rule \(Z>1.96\), and observed \(z=2.50\). The ordinary one-sided upper-tail probability is \(P(Z\ge2.50)\approx0.00621\). But conditional on passing the selection rule, the appropriate null tail probability for an observation at least this large is

$$ P(Z\ge2.50\mid Z>1.96) =\frac{P(Z\ge2.50)}{P(Z>1.96)} \approx\frac{0.00621}{0.02500} \approx0.248. $$

The numerator event is contained in the selection event, which justifies the ratio. The conditional value is much larger than the unselected tail probability because the calculation accounts for the fact that only values above 1.96 could have been reported. This illustrates a selective adjustment, not a ready-made formula for arbitrary GLM selection: in an actual application, the selection event and the relevant sampling distribution must be specified.

Three Strategies for Post-Selection Inference

There is no universal correction that can be applied to every selected GLM. Three broad strategies answer different practical needs.

StrategyHow it addresses selectionMain limitation
Sample splittingUses one data portion to select a model and an independent portion to estimate it.Uses fewer observations for each task, often reducing precision.
Selective-inference adjustmentConditions inference on a specified selection event and adjusts the sampling distribution.Requires a tractable, correctly represented selection procedure and suitable distributional assumptions.
Cautious descriptive reportingReports the search and selected estimates without presenting ordinary intervals as selection-adjusted.Does not, by itself, deliver formal post-selection coverage or a calibrated test.

Sample Splitting: Separate Selection from Estimation

With sample splitting, randomly divide the observations into a selection sample and an inference sample. Use the selection sample to choose a candidate GLM. Then, without revisiting that choice in light of inference-sample results, fit the chosen model to the inference sample and calculate its usual standard errors and intervals. The key protection is independence: conditional on the selection data, the inference observations have not been used to choose the model.

Result: Suppose the selection sample and inference sample are independent, the selected model belongs to a prespecified candidate set, and the selected model is held fixed when analyzing the inference sample. Conditional on the selection sample, the inference sample retains its original distribution. Therefore, any valid inference procedure for a fixed candidate model can be applied to the inference sample, conditional on that selection, subject to its usual model and regularity assumptions.

Justification. Let \(S\) denote the selection data, \(I\) the inference data, and \(M=g(S)\) the model chosen by a selection rule \(g\). Independence gives the joint distribution \(P(S\in A,I\in B)=P(S\in A)P(I\in B)\) for measurable sets \(A,B\). For any selection outcome with \(g(S)=m\) having positive probability, conditioning on that outcome does not change the distribution of \(I\): \(P(I\in B\mid g(S)=m)=P(I\in B)\). Thus, the inference sample is not truncated by the selection rule. Applying a fixed-model method to \(I\) still requires its own assumptions, such as correct variance specification and sufficient regularity for a Wald approximation. \(\square\)

Splitting does not make every target automatically unambiguous. It supports inference for parameters of the selected model fitted to the inference sample. If the model’s interpretation changes with the selected specification, that should be stated. Nor should the analyst repeatedly inspect the inference results, revise the model, and then continue to treat the same data as untouched.

Worked Example: A Logistic Regression on the Inference Split

Suppose a study randomly assigns patients to treatment or control. A selection sample was used to choose a treatment-only logistic regression. In the independent inference sample, the counts are:

GroupResponseNo responseTotal
Treatment302050
Control203050

For this saturated binary comparison, the estimated odds ratio is \((30/20)/(20/30)=2.25\). The treatment log odds ratio estimate is \(\hat\beta=\log(2.25)\approx0.81093\). The usual large-sample variance estimate for the log odds ratio is the sum of the reciprocals of the four cell counts:

$$ \widehat{\operatorname{Var}}(\hat\beta) =\frac{1}{30}+\frac{1}{20}+\frac{1}{20}+\frac{1}{30} =0.166667, \qquad \widehat{\operatorname{se}}(\hat\beta)=\sqrt{0.166667}\approx0.408248. $$

The ordinary 95% Wald interval on the log odds ratio scale is \(0.81093\pm1.96(0.408248)\). The margin is approximately \(0.80017\), giving endpoints \(0.01076\) and \(1.61110\), or approximately \((0.011,1.611)\). Exponentiating gives an odds-ratio estimate of 2.25 and an interval of approximately \((1.011,5.008)\).

These are conventional fixed-model, large-sample calculations. Here the independent inference split is what protects them from the stated data-driven choice, provided the chosen model was not further changed after inspecting this split. The interval may still be wide, and it does not account for other limitations such as model misspecification or small-sample approximation error.

Selective Adjustments and Their Requirements

Selective inference tries to use the data efficiently while explicitly accounting for the selection event. In the simple normal example, selection restricted the possible observations to \(Z>c\), so conditioning led to a truncated normal density. For GLMs, the relevant event may encode which terms survived a search, which model scored best, or which path a stepwise algorithm followed. An adjustment is credible only when that event is represented accurately and the assumed sampling distribution is adequate for the problem.

In many GLM applications, especially with complex searches or small samples, deriving a reliable selection-adjusted interval can be difficult. An adjustment designed for one selection rule should not be presented as if it automatically covers a different rule. Likewise, a standard error recalculated after selection is not necessarily a selective standard error: the adjustment concerns the distribution induced by the whole selection-and-estimation procedure, not merely the final model’s variance formula.

When Formal Adjustment Is Not Available

Cautious descriptive reporting is preferable to overstating what an ordinary interval means. A report can identify the candidate models and selection criterion, describe whether transformations and interactions were searched, give the selected model and its estimates, and state clearly that conventional intervals are conditional on the final specification and are not adjusted for the search. It can also emphasize effect sizes and uncertainty rather than treating a post-selection \(p\)-value just below a threshold as decisive evidence.

Worked Example: Reporting a Selected Predictor

Suppose analysts tried eight candidate predictors in separate Poisson GLMs and retained the predictor with the smallest nominal \(p\)-value. For the selected predictor, the fitted log rate ratio is 0.20 with a conventional standard error of 0.08. The nominal Wald statistic is \(0.20/0.08=2.50\), and its ordinary two-sided normal-reference \(p\)-value is approximately 0.012. Exponentiating the coefficient gives an estimated rate ratio of \(\exp(0.20)\approx1.22\).

A cautious description would say that the selected model estimated a rate ratio of about 1.22, while noting that the predictor was chosen after screening eight candidates and that the reported standard error and nominal \(p\)-value do not adjust for that search. It would not label 0.012 a selection-adjusted \(p\)-value. The calculation is still useful as a description of the fitted model, but the selection process limits its ordinary inferential interpretation.

Common Mistakes

  • “The final model is fixed now, so its usual interval covers the whole analysis.” The final model is fixed only after a data-dependent choice. If the same observations made that choice, the usual interval generally does not account for the choice.
  • “A larger standard error automatically fixes selection.” Increasing a standard error without deriving an appropriate sampling distribution does not guarantee valid coverage.
  • “Sample splitting proves the model is correct.” Splitting separates model selection from inference; it does not prevent misspecification, confounding, poor measurement, or small-sample problems.
  • “A selective adjustment is universal.” Adjustments depend on the selection rule, target parameter, and distributional assumptions. A method for one search cannot be assumed valid for another.
Key takeaway: Ordinary GLM standard errors and confidence intervals describe uncertainty under a specified-model analysis; they do not automatically include uncertainty from choosing that model using the same data. Separate selection and estimation with an independent split, use a valid selection-adjusted method when its assumptions are met, or report the result descriptively and disclose the search.

Check Your Understanding

Use the distinction between fixed-model and post-selection inference to answer these questions.

  1. Why can choosing the largest of several unbiased coefficient estimates produce a biased reported estimate?
  2. In the threshold example, why does conditioning on \(Z>c\) change the density used for inference?
  3. What independence property makes sample splitting useful for inference after GLM selection?
  4. Name two assumptions or limitations that remain even when the selection and inference samples are separate.
  5. An analyst searched several Poisson models and reports a conventional Wald interval from the winner. What qualification should accompany that interval?
Clinical Biostats