Misplaced Pages

Leverage (statistics)

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
(Redirected from High-leverage point) Statistical term

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.

Definition and interpretations

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:

h i i = [ H ] i i = x i ( X X ) 1 x i {\displaystyle h_{ii}=\left_{ii}={\boldsymbol {x}}_{i}^{\top }\left(\mathbf {X} ^{\top }\mathbf {X} \right)^{-1}{\boldsymbol {x}}_{i}} , the i t h {\displaystyle {i}^{th}} diagonal element of the ortho-projection matrix (a.k.a hat matrix) H = X ( X X ) 1 X {\displaystyle \mathbf {H} =\mathbf {X} \left(\mathbf {X} ^{\top }\mathbf {X} \right)^{-1}\mathbf {X} ^{\top }} .

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,

h i i = y ^ i y i {\displaystyle h_{ii}={\frac {\partial {\widehat {y\,}}_{i}}{\partial y_{i}}}} .

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_{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})} .

Properties

  1. The leverage   h i i {\displaystyle h_{ii}} is a number between 0 and 1, 0 h i i 1. {\displaystyle 0\leq h_{ii}\leq 1.}
    Proof: Note that H {\displaystyle \mathbf {H} } is idempotent matrix ( H 2 = H {\displaystyle \mathbf {H} ^{2}=\mathbf {H} } ) and symmetric ( h i j = h j i {\displaystyle h_{ij}=h_{ji}} ). Thus, by using the fact that [ H 2 ] i i = [ H ] i i {\displaystyle \left_{ii}=\left_{ii}} , we have h i i = h i i 2 + j i h i j 2 {\displaystyle h_{ii}=h_{ii}^{2}+\sum _{j\neq i}h_{ij}^{2}} . Since we know that j i h i j 2 0 {\displaystyle \sum _{j\neq i}h_{ij}^{2}\geq 0} , we have h i i h i i 2 0 h i i 1 {\displaystyle h_{ii}\geq h_{ii}^{2}\implies 0\leq h_{ii}\leq 1} .
  2. Sum of leverages is equal to the number of parameters ( p ) {\displaystyle (p)} in β {\displaystyle {\boldsymbol {\beta }}} (including the intercept).
    Proof: i = 1 n h i i = Tr ( H ) = Tr ( X ( X X ) 1 X ) = Tr ( X X ( X X ) 1 ) = Tr ( I p ) = p {\displaystyle \sum _{i=1}^{n}h_{ii}=\operatorname {Tr} (\mathbf {H} )=\operatorname {Tr} \left(\mathbf {X} \left(\mathbf {X} ^{\top }\mathbf {X} \right)^{-1}\mathbf {X} ^{\top }\right)=\operatorname {Tr} \left(\mathbf {X} ^{\top }\mathbf {X} \left(\mathbf {X} ^{\top }\mathbf {X} \right)^{-1}\right)=\operatorname {Tr} (\mathbf {I} _{p})=p} .

Determination of outliers in X using leverages

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

Relation to Mahalanobis distance

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:

D 2 ( x i ) = ( n 1 ) ( h i i 1 n ) {\displaystyle D^{2}({\boldsymbol {x}}_{i})=(n-1)(h_{ii}-{\tfrac {1}{n}})}

This relationship enables us to decompose leverage into meaningful components so that some sources of high leverage can be investigated analytically.

Relation to influence functions

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

β ^ β ^ ( i ) = ( X X ) 1 x i e ^ i 1 h i i {\displaystyle {\widehat {\boldsymbol {\beta }}}-{\widehat {\boldsymbol {\beta }}}^{(-i)}={\frac {(\mathbf {X} ^{\top }\mathbf {X} )^{-1}{\boldsymbol {x}}_{i}{\widehat {e}}_{i}}{1-h_{ii}}}}

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.

Effect on residual variance

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

Var ( e i ) = ( 1 h i i ) σ 2 {\displaystyle \operatorname {Var} (e_{i})=(1-h_{ii})\sigma ^{2}} .

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

t i = e i σ ^ 1 h i i   {\displaystyle t_{i}={e_{i} \over {\widehat {\sigma }}{\sqrt {1-h_{ii}\ }}}}

where σ ^ {\displaystyle {\widehat {\sigma }}} is an appropriate estimate of σ {\displaystyle \sigma } .

Partial leverage

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:

( P L j ) i = ( X j [ j ] ) i 2 k = 1 n ( X j [ j ] ) k 2 {\displaystyle \left(\mathrm {PL} _{j}\right)_{i}={\frac {\left(\mathbf {X} _{j\bullet }\right)_{i}^{2}}{\sum _{k=1}^{n}\left(\mathbf {X} _{j\bullet }\right)_{k}^{2}}}}

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

Software implementations

Many programs and statistics packages, such as R, Python, etc., include implementations of Leverage.

Language/Program Function Notes
R hat(x, intercept = TRUE) or hatvalues(model, ...) See
Python (x * np.linalg.pinv(x).T).sum(-1) See

See also

References

  1. Everitt, B. S. (2002). Cambridge Dictionary of Statistics. Cambridge University Press. ISBN 0-521-81099-X.
  2. James, Gareth; Witten, Daniela; Hastie, Trevor; Tibshirani, Robert (2021). An introduction to statistical learning: with applications in R (Second ed.). New York, NY: Springer. p. 112. ISBN 978-1-0716-1418-1. Retrieved 29 October 2024.
  3. Cardinali, C. (June 2013). "Data Assimilation: Observation influence diagnostic of a data assimilation system" (PDF).
  4. Prove the relation between Mahalanobis distance and Leverage?
  5. Kim, M. G. (2004). "Sources of high leverage in linear regression model (Journal of Applied Mathematics and Computing, Vol 16, 509–513)". arXiv:2006.04024 .
  6. Miller, Rupert G. (September 1974). "An Unbalanced Jackknife". Annals of Statistics. 2 (5): 880–891. doi:10.1214/aos/1176342811. ISSN 0090-5364.
  7. Hiyashi, Fumio (2000). Econometrics. Princeton University Press. p. 21.
  8. Young, Alwyn (2019). "Channeling Fisher: Randomization Tests and the Statistical Insignificance of Seemingly Significant Experimental Results". The Quarterly Journal of Economics. 134 (2): 567. doi:10.1093/qje/qjy029.
  9. Chatterjee, Samprit; Hadi, Ali S. (August 1986). "Influential Observations, High Leverage Points, and Outliers in Linear Regression". Statistical Science. 1 (3): 379–393. doi:10.1214/ss/1177013622. ISSN 0883-4237.
  10. "regression - Influence functions and OLS". Cross Validated. Retrieved 2020-12-06.
Category: