Displaying 2 results from an estimated 2 matches for "bwneweywest".
2011 Sep 28
1
Robust covariance matrix with NeweyWest()
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
2011 Jul 25
1
biglm() and NeweyWest()
...gnificant ARCH effects which I try to account
for using the Newey-West correction.
So far, I have worked with NeweyWest() in the sandwich package. NeweyWest()
however seems to be unable to handle an object of class "biglm".
Looking into the code, I figured out that NeweyWest() calls i) bwNeweyWest()
and ii) vcovHAC(), and that both of these functions use estfun(x)... which
is unable to handle the object. I tried:
est <- biglm(y~x1+x2,...)
res <- y - predict(est,...)
estfun<-function(res,x1,x2){
return(res*cbind(1,x1,x2))
}
...but NeweyWest() still did not work.
Is there a way t...