Hexa Scholar

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. 1 SeeMove a point and check its pull.
  2. 2 TryPredict and test what changes.
  3. 3 ProveBuild the deletion argument.
  4. 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 ideas

Measure 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.

1 See

Move one observation

The solid line uses the fixed observations. The dashed line includes the marked point. Each line spans the displayed input range.
2 Try

Compare two vertical gaps

3 Prove

Derive the effect of deleting a row

Theorem

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.

4 Apply

Diagnose a point

Each problem fits a single predictor with an intercept. Use a decimal. Each answer box gives its accepted absolute error.

Key point Report the diagnostic that answers your question. Use leverage for input position, a deleted residual for prediction from the retained rows, and a refit when the quantity of interest is a particular coefficient.
Level Intermediate Prerequisites Least squares and centered inputs Time ~30 min

Further reading