5.7 Practice problems

Problem 5.7.1. For the crop data of Example 3.2.1, using the residuals and leverages of Example 4.2.6:

(a)
compute Cook’s distance, DFFITS and COVRATIO for each plot;
(b)
which plots have high leverage? Which are influential? Explain the difference for plot 6.

Show solution

Solution. (a) Here \(p = 3\), \(n = 6\), \(n - p = 3\), and from Example 4.2.6 we have \(r_i\), \(t_i\), \(S^2_{(i)}\) and \(h_{ii}\). For plot 2, exactly, \(r_2^2 = 189/104\) and \(h_{22}/(1 - h_{22}) = 37/26\), so \[ D_2 = \frac {189}{3 \times 104}\cdot \frac {37}{26} = \frac {63}{104}\cdot \frac {37}{26} = \frac {2331}{2704} = 0.862 , \] \[ \mathrm {DFFITS}_2 = 1.753\sqrt {37/26} = 1.753 \times 1.193 = 2.091 , \] \[ \mathrm {COVRATIO}_2 = \left (\frac {0.788}{1.333}\right )^3\frac {63}{26} = 0.2068 \times 2.423 = 0.501 . \] In full:

Plot \(h_{ii}\) \(D_i\) DFFITS COVRATIO
1 0.421 0.313 \(-1.050\) 1.070
2 0.587 0.862 \(2.091\) 0.501
3 0.397 0.273 \(0.965\) 1.123
4 0.230 0.097 \(-0.536\) 1.350
5 0.587 0 0 8.178
6 0.778 0 0 15.19

For plots 5 and 6, \(e_i = 0\), so \(S^2_{(i)} = 4/2 = 2\) and \(\mathrm {COVRATIO}_6 = (2/1.333)^3/(2/9) = 3.375 \times 4.5 = 15.19\).

(b) The leverage cut-off is \(2p/n = 1\), which no point can exceed: with \(p = 3\) and only \(n = 6\), every point carries a large share of the fit, and the rule is useless. Relative to the average \(p/n = 0.5\), plots 2, 5 and 6 stand out. No \(D_i\) exceeds \(1\), but plot 2 comes close, and \(\mathrm {DFFITS}_2 = 2.09\) exceeds \(2\sqrt {3/6} = 1.41\). Plot 2 is the most influential observation.

Plot 6 has the highest leverage of all but no influence on the estimates: the plane passes exactly through it, so deleting it changes nothing (\(D_6 = 0\)). Its COVRATIO of \(15.2\) shows what it does do: without it the generalised variance of the estimates would be fifteen times larger. It is a high-leverage point that lies on the trend, panel 2 of Figure 10, and it is the most valuable observation in the data.

Problem 5.7.2. In simple linear regression, show that deleting observation \(i\) changes the estimates by \begin {align*} \hat \beta _1 - \hat \beta _{1(i)} &= \frac {(x_i - \bar x)\,e_i}{S_{xx}(1 - h_{ii})} , \\ \hat \beta _0 - \hat \beta _{0(i)} &= \frac {e_i}{1 - h_{ii}}\left (\frac {1}{n} - \frac {\bar x(x_i - \bar x)}{S_{xx}}\right ) . \end {align*}

Deduce that an observation at \(x_i = \bar x\) cannot change the slope, however large its residual.

Show solution

Solution. By Theorem 4.2.3(ii), \(\hat {\boldsymbol \beta } - \hat {\boldsymbol \beta }_{(i)} = \mathbf {C}\mathbf {x}_i e_i/(1 - h_{ii})\). From Example 3.3.2, with \(\sum x_j^2 = S_{xx} + n\bar x^2\), \[ \mathbf {C}\mathbf {x}_i = \frac {1}{nS_{xx}}\begin {bmatrix} \sum x_j^2 - n\bar x x_i \\ -n\bar x + n x_i \end {bmatrix} = \begin {bmatrix} \dfrac {1}{n} - \dfrac {\bar x(x_i - \bar x)}{S_{xx}} \\[2mm] \dfrac {x_i - \bar x}{S_{xx}} \end {bmatrix} , \] since \(\sum x_j^2 - n\bar x x_i = S_{xx} - n\bar x(x_i - \bar x)\). Multiply by \(e_i/(1 - h_{ii})\). At \(x_i = \bar x\) the slope change is \(0\); the point moves the line up or down, parallel to itself, by \(e_i/(n(1 - h_{ii})) = e_i/(n - 1)\), since \(h_{ii} = 1/n\) there. This is panel 1 of Figure 10. The further \(x_i\) is from \(\bar x\), the larger both factors \(x_i - \bar x\) and \(1/(1 - h_{ii})\) become.

Problem 5.7.3. Show that \(\mathrm {DFFITS}_i^2 = p\,D_i\,MS_{\mathrm {Res}}/S^2_{(i)}\). Then, for the mistyped yield data of Example 4.4.1, compute \(D_4\) and \(\mathrm {DFFITS}_4\) and explain why the two measures disagree about observation 4.

Show solution

Solution. By Theorems 5.2.3 and 5.3.2, \[ \frac {\mathrm {DFFITS}_i^2}{p\,D_i} = \frac {t_i^2\,h_{ii}/(1 - h_{ii})}{r_i^2\,h_{ii}/(1 - h_{ii})} = \frac {t_i^2}{r_i^2} = \frac {e_i^2/\bigl (S^2_{(i)}(1 - h_{ii})\bigr )}{e_i^2/\bigl (MS_{\mathrm {Res}}(1 - h_{ii})\bigr )} = \frac {MS_{\mathrm {Res}}}{S^2_{(i)}} . \] For observation 4 of Example 4.4.1, \(r_4 = 1.989\), \(t_4 = 16.39\) and \(h_{44} = 0.181\), so \(h_{44}/(1 - h_{44}) = 0.221\), and with \(p = 2\), \[ D_4 = \frac {1.989^2}{2} \times 0.221 = 0.437, \qquad \mathrm {DFFITS}_4 = 16.39 \times \sqrt {0.221} = 7.70 . \] Cook’s distance is well below \(1\); DFFITS is nearly seven times its cut-off \(2\sqrt {2/6} = 1.15\). They disagree because \(D_i\) is built on the studentized residual, which here cannot exceed \(\sqrt {n - p} = 2\), while DFFITS is built on R-student, which has no such bound. The ratio \(MS_{\mathrm {Res}}/S^2_{(4)} = 25/0.368 = 68\) is exactly the factor by which the bad value has inflated the residual mean square. Observation 4 is near the middle of the \(x\)-range, so it has little leverage and moves the slope only moderately, which is what \(D_4\) reports; but it is a gross outlier, which is what DFFITS reports.

Problem 5.7.4. Suppose a ninth branch, identical to branch 8 (\(x = 20\), \(y = 9\)), is added to the data of Example 5.5.1. The refitted line is \(\hat y = 5.94 + 0.199x\), and for each of the two large stores \(h_{ii} = 0.474\), \(r_i = -0.565\), \(D_i = 0.144\), \(\mathrm {DFFITS}_i = -0.508\).

(a)
Which cut-offs do the two stores exceed?
(b)
Explain why deleting one of them changes so little, and what would show the problem.

Show solution

Solution. (a) With \(n = 9\), \(p = 2\): \(2p/n = 0.444\), so both have (just) high leverage; but \(D_i = 0.144 < 1\) and \(|\mathrm {DFFITS}_i| = 0.508 < 2\sqrt {2/9} = 0.943\). On the deletion measures neither is influential.

(b) Deleting one large store leaves the other at the same point, and it holds the line almost exactly where it was: the fit to the remaining eight is the fit of Example 5.5.1, \(\hat y = 5.75 + 0.25x\), little different from \(5.94 + 0.199x\). Each store masks the other. Deleting both together gives \(\hat y = 2 + 1.25x\), the dramatic change of the example. The problem is plain in a scatter plot, and in the leverages: two points share a leverage of almost \(0.95\) out of a total of \(p = 2\). Deleting the pair, and computing the analogue of Cook’s distance for the pair, would reveal it.

Problem 5.7.5.

(a)
In simple linear regression with an intercept, show that \(\sum _i (h_{ii} - 1/n) = 1\), and hence that at most one observation can have \(h_{ii} - 1/n \ge 1/2\).
(b)
Five values of \(x\) are to be chosen in \([0, 4]\). Compare the leverages of the designs \(0, 1, 2, 3, 4\) and \(0, 0, 0, 0, 4\). Which is safer against a single faulty observation, and why?

Show solution

Solution. (a) By Example 4.1.2, \(h_{ii} - 1/n = (x_i - \bar x)^2/S_{xx}\), and these add to \(S_{xx}/S_{xx} = 1\). They are all non-negative, so two of them cannot both be at least \(1/2\) unless they are exactly \(1/2\) each and the rest are zero.

(b) For \(0, 1, 2, 3, 4\): \(\bar x = 2\), \(S_{xx} = 10\), and \(h_{ii} = 0.2 + (x_i - 2)^2/10\), which is \(0.6, 0.3, 0.2, 0.3, 0.6\). For \(0, 0, 0, 0, 4\): \(\bar x = 0.8\), \(S_{xx} = 4(0.64) + 3.2^2 = 12.8\), and \(h_{ii} = 0.2 + 0.64/12.8 = 0.25\) for the four points at \(0\), but \(h_{55} = 0.2 + 10.24/12.8 = 1\) for the point at \(4\). In the second design the single observation at \(x = 4\) alone determines the slope: the line must pass through it (Problem 4.7.5), its residual is always zero, and an error in it cannot be detected at all. The first design spreads the leverage, so every observation is checked by the others. (The second design does have a smaller variance for \(\hat \beta _1\), \(\sigma ^2/12.8\) against \(\sigma ^2/10\), but only by trusting one observation completely; it also gives no way of seeing whether the relationship is a straight line.)

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.