Leverage and influential points
The question
Five observations stay put. Where would you place a sixth to change the fitted slope as much as possible?
Move one point and compare the two fits.
- 1 SeeMove a point and check its pull.
- 2 TryPredict and test what changes.
- 3 ProveBuild the deletion argument.
- 4 ApplyDiagnose points in new fits.
Before you start · 3 quick checks on a mean, a slope, and a residual
Two ideas before you start
2 ideasMeasure the miss vertically
A vertical segment connects a point to the line at the same horizontal coordinate.
A residual is the observed height minus the fitted height at the same input.
Exact definition
At the observation \((x_i,y_i)\), a fitted line \(f(x)=a+bx\) gives residual \(e_i=y_i-f(x_i)\). Positive residuals lie above the line. Ordinary least squares chooses the intercept \(a\) and slope \(b\) that minimize the sum of squared vertical residuals over the observations used for that fit. The line on this card is held fixed so you can read the sign of a miss.
Read position along the input axis
Marks on an input axis show the observed inputs and the gap from their mean to a selected input.
Compare each input with the center of the inputs. The outcome values stay out of this calculation.
Exact definition
For \(n\) observations, write \(\bar{x}=\sum_j x_j/n\) for the input mean, \(d_j=x_j-\bar{x}\) for a centered input, and \(S_{xx}=\sum_j d_j^2\) for the total squared spread of the inputs. The same centering appears in covariance and correlation. Here it describes where a single input sits within the design.
Refresher on fitting and refitting
With an intercept and at least two distinct inputs, the fitted slope is \(\sum_j d_j(y_j-\bar y)/S_{xx}\), where \(\bar y\) is the outcome mean. The fitted line passes through \((\bar x,\bar y)\). When you remove a row, calculate the means and the centered sums again using the retained rows.
Removing a row can make the remaining inputs all equal. In that case the retained data have no unique fitted slope. The activities keep distinct inputs among the retained rows. They treat the data as fixed numbers.
Move one observation
- Use the two sliders or their number boxes to move the marked point. The other observations stay fixed.
- Try to make the slope change as large as possible in either direction. Press Check my point to score your placement.
What the scorecards measure
Positive slope change means including the marked point makes the slope larger. The game ranks placements by the absolute change, so either direction can score. It checks every placement offered by the sliders.
Leverage \(h_i\) is a property of the inputs in the full data. Cook’s distance \(D_i\) measures how much all fitted heights move when the point is omitted, relative to the residual mean square of the full fit. The scores can rank placements differently. A refit can move the intercept, and the full-fit mean square can vary across placements.
Compare two vertical gaps
Explorer
- Set the input and the point’s offset above or below the line fitted to the retained rows.
- Compare that offset with the residual measured from the full fit.
Goals
Calculate the diagnostics
Use the full data with an intercept and at least two distinct inputs. For row \(i\), \(h_i=1/n+d_i^2/S_{xx}\). The same outcome at a different input can change this number. Changing the outcome alone leaves it fixed.
Let \(r_i=y_i-\hat y_{-i}(x_i)\) be the gap to the fit that omits row \(i\), with \(\hat y_{-i}(x_i)\) its fitted height at \(x_i\). With distinct inputs still present after deletion, the full-fit residual satisfies \(e_i=(1-h_i)r_i\). A high-leverage observation can pull the full fit toward itself, making its full-fit residual small relative to the deleted residual.
When \(n\gt2\) and the full fit has positive residual sum of squares, let \(s^2=\sum_j e_j^2/(n-2)\). For simple regression with an intercept, Cook’s distance is
\[D_i=\frac{h_i r_i^2}{2s^2}.\]For an exactly collinear full fit the denominator is zero, so this version of Cook’s distance is undefined. The explorer keeps an imperfectly fitted set of retained points to guarantee positive residual sum of squares.
Derive the effect of deleting a row
Fit an intercept and one slope to \(n\gt2\) real pairs by least squares. Assume the inputs remaining after dropping row \(i\) include two distinct values. Let \(\hat y\) and \(\hat y^{(-i)}\) be the full and retained fitted vectors, both evaluated at all the original inputs. Set \(r_i=y_i-\hat y^{(-i)}_i\), \(e_i=y_i-\hat y_i\), and let \(h_i\) be row \(i\)’s leverage. Then \(e_i=(1-h_i)r_i\). If the full-fit residual mean square \(s^2\) is positive, Cook’s distance \(D_i\) is the squared change in the fitted vector divided by \(2s^2\). It equals \(h_i r_i^2/(2s^2)\).
In the proof choices take \(r_i\ne0\), so opposite signs and multipliers give distinct options. The derivation also applies when \(r_i=0\). In that case both fits coincide and Cook’s distance is zero when \(s^2\gt0\).
Refresher on design and projection
Use the full design matrix \(X\) with rows \((1,x_j)\). Its two columns are independent because the inputs vary. Write \(\hat\beta\) for the full fit’s intercept and slope as a column. Write \(A=X^\mathsf{T}X\) and let \(v=(1,x_i)^\mathsf{T}\) be row \(i\) written as a column. The normal equations \(A\hat\beta=X^\mathsf{T}y\) express that the residual has zero dot product with each column. The same equations apply on the retained rows with their own matrix. Thus \(A-A_-=vv^\mathsf{T}\), where \(A_-\) is the retained design’s matrix.
The projection matrix \(H=XA^{-1}X^\mathsf{T}\) maps outcomes to fitted values. It is symmetric and satisfies \(H^2=H\). This is the geometry of OLS as a projection. \(H_{\cdot i}\) denotes column \(i\) and \(h_i=H_{ii}\). Centering the input column leaves the fitted space unchanged. The centered column \(d\) and the all-ones column are orthogonal, giving
\[H=\frac{\mathbf 1\mathbf 1^\mathsf{T}}{n}+\frac{dd^\mathsf{T}}{S_{xx}}.\]In particular \(h_i\ge 1/n\). The projection of the unit vector supported at row \(i\) has squared length \(h_i\), by symmetry and idempotence. Projection cannot increase length. Equality \(h_i=1\) would put the unit vector in the fitted space, giving a line zero at every retained input and one at the deleted input. A line zero at two distinct inputs is identically zero, so \(h_i\lt1\).
Write \(\hat\beta_-\) for the coefficients of the retained fit and \(\delta=\hat\beta-\hat\beta_-\) for their change. In particular, \(\hat y^{(-i)}_i=v^\mathsf{T}\hat\beta_-\).
At each step choose the statement that holds under the theorem’s assumptions.
Diagnose a point
Each problem fits a single predictor with an intercept. Use a decimal. Each answer box gives its accepted absolute error.
Further reading
- R. Dennis Cook, Detection of Influential Observation in Linear Regression, Technometrics.
- R. Dennis Cook and Sanford Weisberg, Residuals and Influence in Regression.