Diagonal values of the Hat matrix {Rfast2} | R Documentation |
Diagonal values of the Hat matrix
Description
Diagonal values of the Hat matrix.
Usage
leverage(x)
Arguments
x |
A matrix with independent variables, the design matrix. |
Details
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.
Value
A vector with the diagonal Hat matrix values, the leverage of each observation.
Author(s)
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
References
Hansen, B. E. (2019). Econometrics.
See Also
Examples
x <- as.matrix( iris[1:50, 1:4] )
a <- leverage(x)
[Package Rfast2 version 0.1.5.2 Index]