[R] Tukey's biweight

Prof Brian D Ripley ripley at stats.ox.ac.uk
Fri Sep 17 19:08:37 CEST 1999


On Fri, 17 Sep 1999, Stuart Luppescu wrote:

> I want to estimate the center of a distribution with lots of outliers in one
> tail, and thought I would use a function such as S-plus's location.m() with
> psi.fun=bisquare (as per MASS 3 p. 131). However, R seems not have such a
> function, so my questions are:
> 1) Is there an R equivalent to location.m()?

Not directly.

> 2) Would huber() give me results that are similar (i.e., close enough)?

Not if you have lots of extreme outliers on just one side.


You ought to be able to use rlm in the latest MASS to do this, as in

x <- rcauchy(100) 
rlm(x ~ 1, psi=psi.bisquare, init="lts")

but unfortunately there is a bug in lm.wfit:

    if (zero.weights) {
        save.r <- y
        save.f <- y
        save.w <- w
        ok <- w != 0
        nok <- !ok
        w <- w[ok]
        x0 <- x[!ok, , drop = FALSE] # add drop=FALSE
        x <- x[ok, , drop = FALSE]   #

which once fixed does this.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list