leverage: Diagonal values of the Hat matrix

View source: R/leverage.R

Diagonal values of the Hat matrixR 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

gee.reg, bic.regs, ztp.reg

Examples

x <- as.matrix( iris[1:50, 1:4] )
a <- leverage(x)

Rfast2 documentation built on Aug. 8, 2023, 1:11 a.m.