robust_HC4: Heteroskedasticity-Robust Variance-Covariance Matrix...

Description Usage Arguments Details Value

View source: R/RcppExports.R

Description

Heteroskedasticity-Robust Variance-Covariance Matrix Estimator (HC4)

Usage

1
robust_HC4(X, e)

Arguments

X

the model matrix. Can be obtained by applying the function model.matrix on a lm object.

e

vector of residuals. Can be obtained by applying the function resid on a lm object.

Details

The different types of robust estimators differ in their degrees-of-freedom corrections for finite sample bias. In the case of HC4, the diagonal entries of the "meat" matrix, ω_i are given as

ω_i^2 = \frac{\hat e_i^2}{(1 - h_{ii})^{δ_i}}

where \hat e_i are the residuals of the model, h_{ii} is the ith diagonal of the hat-matrix, and

δ_i = min(4, h_{ii}/\bar{h}),

where \bar{h} = n^{-1}∑_{i=1}^n h_{ii}.

Value

returns a heteroskedasticity-robust variance-covariance matrix of type HC4.


baruuum/jars documentation built on Nov. 3, 2019, 2:06 p.m.