2
$\begingroup$

In the equation for Cook's distance:

$$D_i = \frac{\sum_{j=1}^{n}(\hat{y}_j - \hat{y}_{j(i)})^2}{p MSE}$$

the value of $p$ is defined as "the number of fitted parameters in the model." What does this mean?

$\endgroup$
1
  • 4
    $\begingroup$ Your formula seems to have $y$'s (observations) where I think it needs $\hat{y}$'s. In this particular formulation, $p$ is the rank of $X$ in the regression - the number of predictors including the constant. Some books and papers will make $p$ the number in addition to the constant, and adjust the formula for $D_i$ to have $p+1$ $\endgroup$
    – Glen_b
    Commented May 19, 2014 at 2:54

1 Answer 1

3
$\begingroup$

In the model, you have a vector of features (sometimes called predictors) which you use to make the prediction. For example, if you're trying to predict student test scores you might include their current class grade, parent's income, etc.. $p$ is just the number of these features (the length of the feature vector). If you're predicting test scores off the current grade and parent's income, and those are both just numeric variables, then $p = 3$ (add one for the intercept as Glen_b mentioned). It's worth noting that $p$ will go up with every dummy variable even though dummy variables relating to the same category might only come from one column in a table (typically there will be $m - 1$ dummy variables for an $m$-category categorical vairable.. increase $p$ by $m-1$ when adding in an $m$-categorical variable into the mix).

$\endgroup$
3
  • $\begingroup$ So if I am doing a simple linear regression (some value over time) then $p = 2$? $\endgroup$ Commented May 19, 2014 at 3:43
  • $\begingroup$ @AndrewGuenther That's right! $\endgroup$
    – user44764
    Commented May 19, 2014 at 4:29
  • $\begingroup$ @Glen_b edited to include the intercept term $\endgroup$
    – user44764
    Commented May 19, 2014 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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