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?
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?
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).