Learn R Programming

svrep (version 0.7.0)

wls_hat_matrix: Create the "hat matrix" for weighted least squares regression

Description

Create the "hat matrix" for weighted least squares regression

Usage

wls_hat_matrix(X, w)

Value

An \(n \times n\) matrix. This is the "hat matrix" for a WLS regression.

Arguments

X

Matrix of predictor variables, with n rows

w

Vector of weights (should all be nonnegative), of length n