dot-h: Leverage

Description Usage Arguments Details Value Author(s) References See Also

Description

Calculates leverage, that is, how far away the regressor values of an observation are from those of the other observations using

h_{ii} = x_{i}^{T} ≤ft( \mathbf{X}^{T} \mathbf{X} \right)^{-1} x_{i}

where x_{i}^{T} is the ith row of the \mathbf{X} matrix. Note that \mathbf{X} ≤ft( \mathbf{X}^{T} \mathbf{X} \right)^{-1} \mathbf{X}^{T} is the projection matrix (or hat matrix) \mathbf{P} and h_{ii} is the diagonal of \mathbf{P}.

Usage

1
.h(P = NULL, X = NULL)

Arguments

P

Numeric matrix The projection matrix.

X

n by k numeric matrix. The data matrix \mathbf{X} (also known as design matrix, model matrix or regressor matrix) is an n \times k matrix of n observations of k regressors, which includes a regressor whose value is 1 for each observation on the first column.

Details

If P = NULL, P is computed with X as a required argument. X is ignored if P is provided.

Value

Returns leverage.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Leverage

See Also

Other projection matrix functions: .M(), M(), P(), h()


jeksterslabds/jeksterslabRlinreg documentation built on Jan. 7, 2021, 8:30 a.m.