[R] Using "line" (Tukey's robust line) on 3 observations?

Stéphane Adamowicz stephane.adamowicz at avignon.inra.fr
Fri Dec 5 09:54:31 CET 2014


Le 4 déc. 2014 à 13:40, Tal Galili a écrit :

> By accident I came across the following example:
> 
> x <- 1:3
> y <- 1:3
> line(x, y) # returns:
> 
> Call:
> line(x, x)
> 
> Coefficients:
> [1]  -2   2
> 
> 
> While when using 1:4, it will give the more reasonable 0,1 coefficients.
> 
> I imagine this is in the way it calculate the quantiles (i.e.: a "feature").
> Can someone help in explaining this?
> 
> 
> Thanks,
> Tal

Strange, indeed. The problem arises also with other examples :

> line(1:8,1:8)

Call:
line(1:8, 1:8)

Coefficients:
[1]  -1.125   1.250

> line(1:9,1:9)

Call:
line(1:9, 1:9)

Coefficients:
[1]  -1.0   1.2



_________________________________
Stéphane Adamowicz
Inra, centre de recherche Paca, unité PSH
228, route de l'aérodrome
CS 40509
domaine St Paul, site Agroparc
84914 Avignon, cedex 9
France

stephane.adamowicz at avignon.inra.fr
tel.  +33 (0)4 32 72 24 35
fax. +33 (0)4 32 72 24 32
do not dial 0 when out of France
web PSH  : https://www6.paca.inra.fr/psh
web Inra : http://www.inra.fr/
_________________________________


	[[alternative HTML version deleted]]



More information about the R-help mailing list