Skip to content
Prev 53579 / 63424 Next

stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3

A usually trustworthy R correspondent posted a pure R implementation on SO at some point in his lost youth:

https://stackoverflow.com/questions/3224731/john-tukey-median-median-or-resistant-line-statistical-test-for-r-and-line

This one does indeed generate the line of identity for the (1:9, 1:9) case, so I do suspect that we have a genuine scr*wup in line().

Notice, incidentally, that
Call:
line(1:9 + rnorm(9, , 0.1), 1:9 + rnorm(9, , 0.1))

Coefficients:
[1]  -0.9407   1.1948

I.e., it is not likely an issue with exact integers or perfect fit.

-pd

  
    

Thread (24 messages)

GlenB stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 27 Joris Meys stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 28 Duncan Murdoch stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 28 GlenB stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 28 GlenB stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 28 Peter Dalgaard stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 29 Serguei Sokol stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 29 Serguei Sokol stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 29 GlenB stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 29 Serguei Sokol stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 29 Martin Maechler stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 30 Serguei Sokol stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 30 Martin Maechler stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 30 GlenB stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 30 Serguei Sokol stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Joris Meys stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Serguei Sokol stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Joris Meys stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Joris Meys stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Peter Dalgaard stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Serguei Sokol stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Joris Meys stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Serguei Sokol stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31 Martin Maechler stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3 May 31