Skip to content
Back to formatted view

Raw Message

Message-ID: <16122.41617.256930.660287@gargle.gargle.HOWL>
Date: 2003-06-26T07:36:49Z
From: Martin Maechler
Subject: robust regression
In-Reply-To: <Pine.LNX.4.44.0306252000540.3859-100000@gannet.stats>

>>>>> "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


    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