[R] Huber-white cluster s.e. after optim?

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Tue Apr 15 00:57:02 CEST 2008


Peter:

> Hi Achim:  Thanks for the reply!  I did notice that robcov() requires
> the X & Y and also a scores vector and that these are not readily
> available under fixed names or at all in output from such functions as
> systemfit and optim.  I wonder if it would make sense to have a
> stop-gap function that would allow the user to specify ingredients
> needed to construct the sandwich from varying components available in
> such functions as systemfit or optim, assuming the ingredients are
> available?  Wish I knew more about how sandwiches are constructed.

The "sandwich" package comes with some vignettes about this
  vignette("sandwich", package = "sandwich")
  vignette("sandwich-OOP", package = "sandwich")
Especially the latter discusses some unifying properties of sandwich
covariances and how they are implemented in an object-oriented fashion in
"sandwich".

To use this object-oriented structure, you need to provide a bread()
method (which you can compute from the Hessian if you use optim()) and an
estfun() method containing the empirical gradients.

For a clustered version of the sandwiches, I would need an additional
method for passing on the clustering vector which I haven't got a good
object-oriented solution for...

For (generalized) linear models, the standard clustered sandwiches are
available in the GEE packages for R, e.g., "geepack".

> Incidentally, thanks again for putting in the symbolic method of
> specifying linear hypothesis tests.  I have been using that
> extensively.

:-) great, thanks for the feedback!
Z

> Cheers, Peter
>
> On Mon, Apr 14, 2008 at 6:52 AM, Achim Zeileis
> <Achim.Zeileis at wu-wien.ac.at> wrote:
> > On Thu, 10 Apr 2008, Peter Muhlberger wrote:
> >
> >  This is on my wishlist for "sandwich" for a long time. Conceptually, it is
> >  quite straightforward, but I'm not quite sure how to implement it because
> >  AFAIK there is no unified way of extracting clustering information from
> >  fitted regression objects.
> >  Z
> >
> >  >  Peter
> >  >
> >  > _______
>
>



More information about the R-help mailing list