13
$\begingroup$

I read here that $n-p-1$ was the number of degrees of freedom I should use when doing a t-test for the significance of a regression coefficient, but I don't understand why. My understanding was that t-tests generally had $n-1$ degrees of freedom.

$\endgroup$
  • $\begingroup$ Typically the number of parameters is p+1 since there are p slopes and 1 intercept. $\endgroup$ – PatrickT Feb 3 '19 at 10:45
15
$\begingroup$

You lose one degree of freedom for each estimated mean parameter. For an ordinary t-test that's 1 (the mean). For regression, each predictor costs you a degree of freedom. The extra one is for the intercept.

More specifically, the degrees of freedom come from the denominator in the t-test, which is based on the residual sum of squares -- there are $n-p-1$ degrees of freedom in the residual sums of squares.

$\endgroup$
  • 3
    $\begingroup$ In fact if you regress some outcome on a constant (only an intercept in the model) you get the mean, p would then be 0, and one would have n-1 degrees of freedom $\endgroup$ – Repmat Sep 28 '16 at 14:32
3
$\begingroup$

This is not true in general. The number of degrees of freedom of t-test depends on a specific model. They're talking about linear regression. So, t-test for an estimator has $n-p-1$ degrees of freedom where $p$ is number of explanatory parameters in the model.

$\endgroup$
1
$\begingroup$

Degrees of freedom is the number of independent values or quantities which can be assigned to a statistical distribution.

So in this case its n−p−1 because:

n is number of training samples. p is number of predictors. 1 is for intercept.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.