Diagonal values of the Hat matrix
Diagonal values of the Hat matrix.
leverage(x)
x |
A matrix with independent variables, the design matrix. |
The function returns the diagonal values of the Hat matrix used in linear regression. We did not call it "hatvalues" as R contains a built-in function with such a name.
A vector with the diagonal Hat matrix values, the leverage of each observation.
Michail Tsagris
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr
Hansen, B. E. (2019). Econometrics. https://www.ssc.wisc.edu/~bhansen/econometrics/Econometrics.pdf
x <- as.matrix( iris[1:50, 1:4] ) a <- leverage(x)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.