The heteroskedasticty and autocorrelation consistent (HAC) covariance matrix of least square estimates (Newey & West, 1978) is computed. A single group factor may be taken into account.
An object of class
The name of the group factor (optional). If
A matrix if
x is of class
lm, or, if
x is of class
dlsem, a list of matrices, one for each regression model.
Each matrix has the attribute
max.lag, indicating the maximum lag of autocorrelation, automatically computed based on fit to data.
group is not
NULL, this is computed within each group.
Residuals are assumed to be temporally ordered within each group.
W. K. Newey, and K. D. West (1978). A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix. Econometrica, 55(3), 703-708.
1 2 3 4 5 6 7 8
Loading required package: graph Loading required package: BiocGenerics Loading required package: parallel Attaching package: 'BiocGenerics' The following objects are masked from 'package:parallel': clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap, parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB The following objects are masked from 'package:stats': IQR, mad, sd, var, xtabs The following objects are masked from 'package:base': Filter, Find, Map, Position, Reduce, anyDuplicated, append, as.data.frame, basename, cbind, colMeans, colSums, colnames, dirname, do.call, duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply, union, unique, unsplit, which, which.max, which.min Loading required package: Rgraphviz Loading required package: grid traditional hac Region1 6.40615073 6.92023281 Region2 5.93683392 6.66213635 Region3 7.25925699 8.31215085 Region4 7.33081795 8.63348557 Region5 7.33584368 8.50646415 Region6 6.67594033 10.03832277 Region7 7.68156340 11.43634646 Region8 4.97581770 5.93481885 Region9 4.43846357 4.25452702 Region10 6.27941589 6.95906473 quec.lag(Job, 0, 5, x.group = Region) 0.01001767 0.01198433
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.