Skip to contents

This function calculates the covariance structure for heteroskedasticity linear regression model.

Usage

HC(model, method=4, k=0.7)

Arguments

model

Any object of class lm;

method

Method HC that will be used to estimate the covariance structure. The argument method may be 0, 2, 3, 4 or 5;

k

Constant used by the method HC5. The suggestion of the authors is to use \(k = 0.7\).

References

Cribari-Neto, F. (2004). Asymptotic inference under heteroskedasticity of unknown form. Computational Statistics and Data Analysis, 45, 215-233.

Cribari-Neto, F.; Souza, T.C.; Vasconcellos, K.L.P. (2007). Inference under heteros- kedasticity and leveraged data. Communications in Statistics, Theory and Methods, 36, 1877-1888. [Errata: 37, 2008, 3329-3330.]

Horn, S.D.; Horn, R.A.; Duncan, D.B. (1975). Estimating heteroskedastic variances in linear models. Journal of the American Statistical Association, 70, 380-385.

MacKinnon, J.G.; White, H. (1985). Some heteroskedasticity-consistent covariance matrix estimators with improved finite-sample properties. Journal of Econometrics, 29, 305-325.

White, H. (1980). A heteroskedasticity-consistent covariance matrix estimator and a direct test for heteroskedasticity. Econometrica, 48, 817-838.

Author

Pedro Rafael Diniz Marinho <pedro.rafael.marinho@gmail.com>

Examples

data(schools)
datas = schools[-50,]
y = datas$Expenditure 
x = datas$Income/10000
model = lm(y ~ x)
HC(model, method=4)
#>           [,1]      [,2]
#> [1,]  29045.25 -39769.76
#> [2,] -39769.76  54555.63