We consider a linear regression model with regression parameters (θ1,...,θ
p) and error variance parameter σ2. Our aim is to find a confidence interval with minimum coverage probability 1 − α for a parameter of interest θ1 in the presence of nuisance parameters (θ2,...,θ p,σ2). We consider two confidence intervals, the first of which is the standard confidence interval for θ1 with coverage probability 1 − α. The second confidence interval for θ1 is obtained after a variable selection procedure has been applied to θ p. This interval is chosen to be as short as possible subject to the constraint that it has minimum coverage probability 1 − α. The confidence intervals are compared using a risk function that is defined as a scaled version of the expected length of the confidence interval. We show that, subject to certain conditions including that [(dimension of response vector) − p] is small, the second confidence interval is preferable to the first when we anticipate (without being certain) that |θ p|/σ is small. This comparison of confidence intervals is shown to be mathematically equivalent to a corresponding comparison of prediction intervals.