Confidence Interval for Regression Coefficient ,$\beta$ In the book 'Applied regression Analysis' by Draper/Smith, it is written that :
Obtain individual $100(1-\alpha)\%$ confidence interval for the various parameters separately from the formula
$$\hat\beta_i\pm t(n-p,1-\frac{\alpha}{2})se(\hat\beta_i)$$
Degrees of freedom due to error is $n-p$ and degrees of freedom due to residual is $p-1$.
Why am i considering error degrees of freedom while constructing  $100(1-\alpha)\%$ confidence interval for $\beta_i$ ?
 A: The confidence interval for a regression coefficient $\beta$ follows a $t$ distribution with $ n-p$ degrees of freedom. To calculate it the following steps are necessary:


*

*identify the parameter $\hat\beta_i$ for which you want to calculate the CI;

*specify a confidence level (e.g., 95% 99% etc...), which corresponds to $1-\alpha$);

*calculate the critical probability $1-\alpha/2$ (note that we have to halve $\alpha$ because the margin error will be doubled for the calculation of the confidence interval); for example,  if you specified a 99% confidence level, you get a $1-0.99/2=0.995$ critical probability;

*calculate the critical value: this is the t score having $n-2$ degrees of freedom and a cumulative probability equal to the critical probability (we indicate it as $ t(n-p,1-\frac{\alpha}{2})$;

*take the standard error of the parameter $se\hat\beta_i$ (it is usually given directly by the software in the regression output);

*calculate the margin of error as the product  of the critical value and the standard error  of the parameter, and use it to calculate confidence intervals as $$\hat\beta_i\pm t(n-p,1-\frac{\alpha}{2})se(\hat\beta_i)$$
