[R] robust regression (l1fit)
Roger Koenker
roger at ysidro.econ.uiuc.edu
Thu Jun 26 11:18:27 CEST 2003
On Thu, 26 Jun 2003, Martin Maechler wrote:
> >>>>> "BDR" == Prof Brian Ripley <ripley at stats.ox.ac.uk>
> >>>>> on Wed, 25 Jun 2003 20:06:49 +0100 (BST) writes:
>
> BDR> On Wed, 25 Jun 2003, Rafael Bertola wrote:
>
> >> Is there a command in R that make the same regression
> >> like l1fit in S-plus?
>
> BDR> You can use the quantreg package.
>
> This is an quite-FAQ, really. Maybe we need a list of "quite
> frequently asked questions" or rather extend the FAQ?
>
> Specifically, I wonder if it wasn't worth to add something like
> the following to the quantreg package
>
> l1fit <- function(x,y, intercept = TRUE)
> {
> warning("l1fit() in R is just a wrapper to rq(). Use that instead!")
> if(intercept) rq(y ~ x, tau = 0.5)
> else rq(y ~ x - 1, tau = 0.5)
> }
>
> (and an \alias{l1fit} to the rq.Rd help page)
> So at least all who have quantreg installed will find l1fit
I'd be happy to add such a function, but I rather doubt that it would reduce
the incidence of such questions. Putting a function like Martin's in base with the
warning replaced by require(quantreg) might be more effective.
Of course, in Splus lifit returns only coefficients and residuals without
any attempt to do any inference, so one might also want to further restrict the output
of rq() for full compatibility.
>
> BDR> However, neither
> BDR> l1fit nor that do `robust regression', so you need to
> BDR> think more carefully about what you really want. There
> BDR> are almost always better alternatives than L1 fits.
>
> I "fervently" agree.
>
> Most notably, the
> rlm() {Robust Linear Models}
>
> in package MASS (Venables and Ripley)!
Without wanting to get involved in any religious wars about robustness, I would simply
observe that Brian's comment applies to life in general: there are almost
always better alternatives to [any specified procedure]. So until someone
produces a very convincing argument for the universal applicability of one particular
procedure for robust regression, I would plea for "letting 100 flowers bloom
and 100 schools of thought contend."
url: www.econ.uiuc.edu Roger Koenker Dept. of Economics UCL,
email rkoenker at uiuc.edu Department of Economics Drayton House,
vox: 217-333-4558 University of Illinois 30 Gordon St,
fax: 217-244-6678 Champaign, IL 61820 London,WC1H 0AX, UK
More information about the R-help
mailing list