hccme {skedastic}R Documentation

Heteroskedasticity-Consistent Covariance Matrix Estimators for Linear Regression Models

Description

Computes an estimate of the n\times n covariance matrix \Omega (assumed to be diagonal) of the random error vector of a linear regression model, using a specified method

Usage

hccme(
  mainlm,
  hcnum = c("3", "0", "1", "2", "4", "5", "6", "7", "4m", "5m", "const"),
  sandwich = FALSE,
  as_matrix = TRUE
)

Arguments

mainlm

Either an object of class "lm" (e.g., generated by lm), or a list of two objects: a response vector and a design matrix. The objects are assumed to be in that order, unless they are given the names "X" and "y" to distinguish them. The design matrix passed in a list must begin with a column of ones if an intercept is to be included in the linear model. The design matrix passed in a list should not contain factors, as all columns are treated 'as is'. For tests that use ordinary least squares residuals, one can also pass a vector of residuals in the list, which should either be the third object or be named "e".

hcnum

A character corresponding to a subscript in the name of an HCCME according to the usual nomenclature \mathrm{HC\#}. Possible values are:

  • "3", the default, corresponding to HC3 (MacKinnon and White 1985)

  • "0", corresponding to HC0 (White 1980)

  • "1", corresponding to HC1 (MacKinnon and White 1985)

  • "2", corresponding to HC1 (MacKinnon and White 1985)

  • "4", corresponding to HC4 (Cribari-Neto 2004)

  • "5", corresponding to HC5 (Cribari-Neto et al. 2007)

  • "6", corresponding to HC6 (Aftab and Chand 2016)

  • "7", corresponding to HC7 (Aftab and Chand 2018)

  • "4m", corresponding to HC4m (Cribari-Neto and da Silva 2011)

  • "5m", corresponding to HC5m (Li et al. 2017)

  • "const", corresponding to the homoskedastic estimator, (n-p)^{-1}\displaystyle\sum_{i=1}^{n}e_i^2

sandwich

A logical, defaulting to FALSE, indicating whether or not the sandwich estimator

\mathrm{Cov}{\hat{\beta}}=(X'X)^{-1}X'\hat{\Omega}X(X'X)^{-1}

should be returned instead of \mathrm{Cov}(\epsilon)=\hat{\Omega}

as_matrix

A logical, defaulting to TRUE, indicating whether a covariance matrix estimate should be returned rather than a vector of variance estimates

Value

A numeric matrix (if as_matrix is TRUE) or else a numeric vector

References

Aftab N, Chand S (2016). “A New Heteroskedastic Consistent Covariance Matrix Estimator Using Deviance Measure.” Pakistan Journal of Statistics and Operations Research, 12(2), 235–244.

Aftab N, Chand S (2018). “A Simulation-Based Evidence on the Improved Performance of a New Modified Leverage Adjusted Heteroskedastic Consistent Covariance Matrix Estimator in the Linear Regression Model.” Kuwait Journal of Science, 45(3), 29–38.

Cribari-Neto F (2004). “Asymptotic Inference under Heteroskedasticity of Unknown Form.” Computational Statistics & Data Analysis, 45, 215–233.

Cribari-Neto F, Souza TC, Vasconcellos KLP (2007). “Inference under Heteroskedasticity and Leveraged Data.” Communications in Statistics - Theory and Methods, 36(10), 1877–1888.

Cribari-Neto F, da Silva WB (2011). “A New Heteroskedasticity-Consistent Covariance Matrix Estimator for the Linear Regression Model.” Advances in Statistical Analysis, 95(2), 129–146.

Li S, Zhang N, Zhang X, Wang G (2017). “A New Heteroskedasticity-Consistent Covariance Matrix Estimator and Inference under Heteroskedasticity.” Journal of Statistical Computation and Simulation, 87(1), 198–210.

MacKinnon JG, White H (1985). “Some Heteroskedasticity-Consistent Covariance Matrix Estimators with Improved Finite Sample Properties.” Journal of Econometrics, 29(3), 305–325.

White H (1980). “A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity.” Econometrica, 48(4), 817–838.

See Also

vcovHC

Examples

mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
Omega_hat <- hccme(mtcars_lm, hcnum = "4")
Cov_beta_hat <- hccme(mtcars_lm, hcnum = "4", sandwich = TRUE)


[Package skedastic version 2.0.2 Index]