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


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to