Leverage (statistics)

In statistics and in particular in regression analysis, leverage is a measure of how far away the independent variable values of an observation are from those of the other observations. High-leverage points, if any, are outliers with respect to the independent variables. That is, high-leverage points have no neighboring points in R p {\displaystyle \mathbb {R} ^{p}} space, where p {\displaystyle {p}} is the number of independent variables in a regression model. This makes the fitted model likely to pass close to a high leverage observation. Hence high-leverage points have the potential to cause large changes in the parameter estimates when they are deleted i.e., to be influential points. Although an influential point will typically have high leverage, a high leverage point is not necessarily an influential point. The leverage is typically defined as the diagonal elements of the hat matrix.
Consider the linear regression model y i = x i ⊤ β + ε i {\displaystyle {y}_{i}={\boldsymbol {x}}_{i}^{\top }{\boldsymbol {\beta }}+{\varepsilon }_{i}} , i = 1 , 2 , … , n {\displaystyle i=1,\,2,\ldots ,\,n} . That is, y = X β + ε {\displaystyle {\boldsymbol {y}}=\mathbf {X} {\boldsymbol {\beta }}+{\boldsymbol {\varepsilon }}} , where, X {\displaystyle \mathbf {X} } is the n × p {\displaystyle n\times p} design matrix whose rows correspond to the observations and whose columns correspond to the independent or explanatory variables. The leverage score for the i t h {\displaystyle {i}^{th}} independent observation x i {\displaystyle {\boldsymbol {x}}_{i}} is given as:
Thus the i t h {\displaystyle {i}^{th}} leverage score can be viewed as the 'weighted' distance between x i {\displaystyle {\boldsymbol {x}}_{i}} to the mean of x i {\displaystyle {\boldsymbol {x}}_{i}} 's (see its relation with Mahalanobis distance). It can also be interpreted as the degree by which the i t h {\displaystyle {i}^{th}} measured (dependent) value (i.e., y i {\displaystyle y_{i}} ) influences the i t h {\displaystyle {i}^{th}} fitted (predicted) value (i.e., y ^ i {\displaystyle {\widehat {y\,}}_{i}} ): mathematically,
Hence, the leverage score is also known as the observation self-sensitivity or self-influence. Using the fact that y ^ = H y {\displaystyle {\boldsymbol {\widehat {y}}}={\mathbf {H} }{\boldsymbol {y}}} (i.e., the prediction y ^ {\displaystyle {\boldsymbol {\widehat {y}}}} is ortho-projection of y {\displaystyle {\boldsymbol {y}}} onto range space of X {\displaystyle \mathbf {X} } ) in the above expression, we get h i i = [ H ] i i {\displaystyle h_{ii}=\left[\mathbf {H} \right]_{ii}} . Note that this leverage depends on the values of the explanatory variables ( X ) {\displaystyle (\mathbf {X} )} of all observations but not on any of the values of the dependent variables ( y i ) {\displaystyle (y_{i})} .
Large leverage h i i {\displaystyle {h_{ii}}} corresponds to an x i {\displaystyle {{\boldsymbol {x}}_{i}}} that is extreme. A common rule is to identify x i {\displaystyle {{\boldsymbol {x}}_{i}}} whose leverage value h i i {\displaystyle {h}_{ii}} is more than 2 times larger than the mean leverage h ¯ = 1 n ∑ i = 1 n h i i = p n {\displaystyle {\bar {h}}={\dfrac {1}{n}}\sum _{i=1}^{n}h_{ii}={\dfrac {p}{n}}} (see property 2 above). That is, if h i i > 2 p n {\displaystyle h_{ii}>2{\dfrac {p}{n}}} , x i {\displaystyle {{\boldsymbol {x}}_{i}}} shall be considered an outlier. Some statisticians prefer the threshold of 3 p / n {\displaystyle 3p/{n}} instead of 2 p / n {\displaystyle 2p/{n}} .
Leverage is closely related to the Mahalanobis distance (proof). Specifically, for some n × p {\displaystyle n\times p} matrix X {\displaystyle \mathbf {X} } , the squared Mahalanobis distance of x i {\displaystyle {{\boldsymbol {x}}_{i}}} (where x i ⊤ {\displaystyle {\boldsymbol {x}}_{i}^{\top }} is i t h {\displaystyle {i}^{th}} row of X {\displaystyle \mathbf {X} } ) from the vector of mean μ ^ = ∑ i = 1 n x i {\displaystyle {\widehat {\boldsymbol {\mu }}}=\sum _{i=1}^{n}{\boldsymbol {x}}_{i}} of length p {\displaystyle p} , is D 2 ( x i ) = ( x i − μ ^ ) ⊤ S − 1 ( x i − μ ^ ) {\displaystyle D^{2}({\boldsymbol {x}}_{i})=({\boldsymbol {x}}_{i}-{\widehat {\boldsymbol {\mu }}})^{\top }\mathbf {S} ^{-1}({\boldsymbol {x}}_{i}-{\widehat {\boldsymbol {\mu }}})} , where S = X ⊤ X {\displaystyle \mathbf {S} =\mathbf {X} ^{\top }\mathbf {X} } is the estimated covariance matrix of x i {\displaystyle {{\boldsymbol {x}}_{i}}} 's. This is related to the leverage h i i {\displaystyle h_{ii}} of the hat matrix of X {\displaystyle \mathbf {X} } after appending a column vector of 1's to it. The relationship between the two is:
This relationship enables us to decompose leverage into meaningful components so that some sources of high leverage can be investigated analytically.
In a regression context, we combine leverage and influence functions to compute the degree to which estimated coefficients would change if we removed a single data point. Denoting the regression residuals as e ^ i = y i − x i ⊤ β ^ {\displaystyle {\widehat {e}}_{i}=y_{i}-{\boldsymbol {x}}_{i}^{\top }{\widehat {\boldsymbol {\beta }}}} , one can compare the estimated coefficient β ^ {\displaystyle {\widehat {\boldsymbol {\beta }}}} to the leave-one-out estimated coefficient β ^ ( − i ) {\displaystyle {\widehat {\boldsymbol {\beta }}}^{(-i)}} using the formula
Young (2019) uses a version of this formula after residualizing controls. To gain intuition for this formula, note that ∂ β ^ ∂ y i = ( X ⊤ X ) − 1 x i {\displaystyle {\frac {\partial {\hat {\beta }}}{\partial y_{i}}}=(\mathbf {X} ^{\top }\mathbf {X} )^{-1}{\boldsymbol {x}}_{i}} captures the potential for an observation to affect the regression parameters, and therefore ( X ⊤ X ) − 1 x i e ^ i {\displaystyle (\mathbf {X} ^{\top }\mathbf {X} )^{-1}{\boldsymbol {x}}_{i}{\widehat {e}}_{i}} captures the actual influence of that observations' deviations from its fitted value on the regression parameters. The formula then divides by ( 1 − h i i ) {\displaystyle (1-h_{ii})} to account for the fact that we remove the observation rather than adjusting its value, reflecting the fact that removal changes the distribution of covariates more when applied to high-leverage observations (i.e. with outlier covariate values). Similar formulas arise when applying general formulas for statistical influences functions in the regression context.
If we are in an ordinary least squares setting with fixed X {\displaystyle \mathbf {X} } and homoscedastic regression errors ε i , {\displaystyle \varepsilon _{i},} y = X β + ε ; Var ⁡ ( ε ) = σ 2 I {\displaystyle {\boldsymbol {y}}=\mathbf {X} {\boldsymbol {\beta }}+{\boldsymbol {\varepsilon }};\ \ \operatorname {Var} ({\boldsymbol {\varepsilon }})=\sigma ^{2}\mathbf {I} } , then the i t h {\displaystyle {i}^{th}} regression residual, e i = y i − y ^ i {\displaystyle e_{i}=y_{i}-{\widehat {y}}_{i}} has variance
In other words, an observation's leverage score determines the degree of noise in the model's misprediction of that observation, with higher leverage leading to less noise. This follows from the fact that I − H {\displaystyle \mathbf {I} -\mathbf {H} } is idempotent and symmetric and y ^ = H y {\displaystyle {\widehat {\boldsymbol {y}}}=\mathbf {H} {\boldsymbol {y}}} , hence, Var ⁡ ( e ) = Var ⁡ ( ( I − H ) y ) = ( I − H ) Var ⁡ ( y ) ( I − H ) ⊤ = σ 2 ( I − H ) 2 = σ 2 ( I − H ) {\displaystyle \operatorname {Var} ({\boldsymbol {e}})=\operatorname {Var} ((\mathbf {I} -\mathbf {H} ){\boldsymbol {y}})=(\mathbf {I} -\mathbf {H} )\operatorname {Var} ({\boldsymbol {y}})(\mathbf {I} -\mathbf {H} )^{\top }=\sigma ^{2}(\mathbf {I} -\mathbf {H} )^{2}=\sigma ^{2}(\mathbf {I} -\mathbf {H} )} .
The corresponding studentized residual—the residual adjusted for its observation-specific estimated residual variance—is then
where σ ^ {\displaystyle {\widehat {\sigma }}} is an appropriate estimate of σ {\displaystyle \sigma } .
Partial leverage (PL) is a measure of the contribution of the individual independent variables to the total leverage of each observation. That is, PL is a measure of how h i i {\displaystyle h_{ii}} changes as a variable is added to the regression model. It is computed as:
where j {\displaystyle j} is the index of independent variable, i {\displaystyle i} is the index of observation and X j ∙ [ j ] {\displaystyle \mathbf {X} _{j\bullet [j]}} are the residuals from regressing X j {\displaystyle \mathbf {X} _{j}} against the remaining independent variables. Note that the partial leverage is the leverage of the i t h {\displaystyle {i}^{th}} point in the partial regression plot for the j t h {\displaystyle {j}^{th}} variable. Data points with large partial leverage for an independent variable can exert undue influence on the selection of that variable in automatic regression model building procedures.
Many programs and statistics packages, such as R, Python, etc., include implementations of Leverage.