[Rd] proposal: allowing alternative variance estimators in glm/lm

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Wed 27 Dec 2006 - 17:54:36 GMT

There has been recent discussion about alternatives to the model-based standard error estimators for lm. While some people like the sandwich estimator and others don't, it is clear that neither estimator dominates the other for any sane loss function. It is also worth noting that the sandwich estimator is the default for t.test().

I think it would be useful for models using other variance estimators to be able to inherit from lm and use summary.lm and predict.lm (and similarly for glm). The main step in making this possible would be moving the variance-covariance matrix computation that is currently duplicated in summary.lm and predict.lm into vcov.lm, and then having summary.lm and predict.lm call vcov().

This allows a fitting function (whether lm() or another function) to produce objects that inherit usefully from lm and glm but have other standard error estimators, by supplying a new vcov method for the class. The initial discusssion was about heteroscedasticity-consistent sandwich estimators, but from my point of view autocorrelation-consistent estimators and estimators that handle sampling weights are more interesting.

OOP purists might point out that the relationship involved is not, strictly speaking, inheritance. They would be quite right. However, unless someone wants to rewrite glm and lm for S4 classes I think that battle is lost.

     -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley@u.washington.edu	University of Washington, Seattle

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Dec 28 13:21:11 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 28 Dec 2006 - 11:31:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.