[R] extend summary.lm for hccm?

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Mon Dec 25 14:38:07 CET 2006


On Sun, 24 Dec 2006, John Fox wrote:

> Dear Dirk and Ivo,
>
> It's true that the sandwich package has more extensive facilities for
> sandwich variance estimation than the hccm function in the car package, but
> I think that the thrust of Ivo's question is to get a model summary that
> automatically uses the adjusted standard errors rather than having to
> compute them and use them "manually."

I've written the function coeftest() in package "lmtest" for this purpose.
With this you can
  coeftest(obj, vcov = sandwich)
or you can put this into a specialized summary() function as John
suggested (where you probably would want the F statistic to use the other
vcov as well). See also function waldtest() in "lmtest",
linear.hypothesis() in "car" and
  vignette("sandwich", package = "sandwich")

Although this works, it is still a nuisance to use a different function
and not summary() directly. In addition, it would also be nice to plug in
different vcovs into confint() or predict() methods. Of course, one could
write different generics or overload the methods in certain packages.
However, I guess that many practitioners want to use different vcov
estimators - especially in the social and political scieneces, and
econometrics etc. - so that this might justify that the original "lm" (and
"glm") methods are extended to allow for plugging in different vcov
matrices. Maybe we could try to convince R-core to include somthing like
this?

Best wishes,
Z



More information about the R-help mailing list