Skip to content
Prev 33851 / 398513 Next

robust regression


        
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


    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)!
Martin