lmHAC: Heteroskedasticty and autocorrelation consistent covariance matrix
Description
The heteroskedasticty and autocorrelation consistent (HAC) covariance matrix of least square estimates (Newey & West, 1978) is applied to an object of class lm. A single group factor may be taken into account.
Usage
lmHAC(x, group = NULL)
Arguments
x
An object of class lm.
group
The name of the group factor (optional). If NULL, no groups are considered.
Value
An object of class hac and lm.
The HAC covariance matrix is stored into the component vcov of the object,
which is taken into account by the summary and the vcov methods.
The HAC covariance matrix has the attribute max.lag, indicating the maximum lag of autocorrelation, which is automatically computed based on fit to data.
References
W. K. Newey, and K. D. West (1978). A simple, positive semi-definite, heteroskedasticity and autocorrelation consistent covariance matrix. Econometrica, 55(3), 703-708.