[R] Robust covariance matrix with NeweyWest()
Andreas Klein
klein82517 at yahoo.de
Wed Sep 28 19:29:36 CEST 2011
Dear R-users,
I would like to compute a robust covariance matrix of two series of realizations of random variables:
###Begin Example###
data <- cbind(rnorm(100), rnorm(100))
model <- lm(data ~ 1)
vcov(model)
library(sandwich)
NeweyWest(model) #produces an error
###End Example###
NeweyWest() produces an error but sandwich(), vcovHAC(), kernHAC, weave(),... do not produce any errors. It seems that the model object does not fit in that special case.
Nevertheless, the problem is that I need the robust version of the covariance matrix according to Newey and West (1987, 1994).
Any ideas or suggestions to solve the problem?
Kind regards,
Andy
More information about the R-help
mailing list