Displaying 8 results from an estimated 8 matches for "mmline".
Did you mean:
lmline
2017 May 30
2
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
...ttp://stackoverflow.com/questions/3224731/john-tukey-median-median-or-resistant-line-statistical-test-for-r-and-line
## median_median_line by Richie Cotton (July 12 2010, last edited at 13:49)
##
## Shorter variable names, fixed bug in step 1, added 'plot.' option: Martin Maechler, May 2017
MMline <- function(x, y, data, plot. = FALSE)
{
if(!missing(data))
{
x <- eval(substitute(x), data)
y <- eval(substitute(y), data)
}
stopifnot((n <- length(x)) == length(y), n >= 2)
## Step 1
n.3 <- n %/% 3L
groups <- rep(1:3, times = switch((n %% 3) + 1L,...
2017 May 30
3
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
...ints (of 19 in
> total), while line()'s definition of quantile leads to 8
> points. The same numbers (6 and 8) are on the other end of
> sample.
so the number of obs. for the three thirds for line() are
{8, 3, 8} in line() [also, after your patch, right?]
whereas in MMline() they are as they should be, namely
{6, 7, 6}
But the {8, 3, 8} split is not at all what all "the literature",
including Tukey himself says that "should" be done.
(Other literature on the topic suggests that the optimal sizes
of the split in three groups depends on the...
2017 May 31
0
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
...le line()'s definition of quantile leads to 8
> > points. The same numbers (6 and 8) are on the other end of
> > sample.
>
> so the number of obs. for the three thirds for line() are
> {8, 3, 8} in line() [also, after your patch, right?]
>
> whereas in MMline() they are as they should be, namely
>
> {6, 7, 6}
>
> But the {8, 3, 8} split is not at all what all "the literature",
> including Tukey himself says that "should" be done.
> (Other literature on the topic suggests that the optimal sizes
> of the sp...
2017 May 29
3
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
Here is an attached patch.
Best,
Serguei.
Le 29/05/2017 ? 12:21, Serguei Sokol a ?crit :
> The problem or actual R implementation relies on an assumption
> that median(x[i] | x[i] <= quantile(x, 1/3)) == quantile(x, 1/6)
> which reveals not to be true despite very trustful appearance.
>
> If we continue with the example of x=y=1:9
> then quantile(x, 1/6)=2.5 (here quantile()
2017 May 31
2
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
...ops. I have read the first ref returned by google and it happened to be
tibco's doc, not the R's one. The layout is very similar hence my mistake.
The latter does not mention "thirds" but ...
Anyway, here is a new line's patch which still gives a result slightly different
form MMline(). The slope is the same but not the intercept.
What are the exact terms for intercept calculation that should be implemented?
Serguei.
-------------- next part --------------
--- line.c.orig 2016-03-17 00:03:03.000000000 +0100
+++ line.c 2017-05-31 18:24:55.330030280 +0200
@@ -17,7 +17,7 @@
*...
2017 May 31
2
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
...f quantile leads to 8
>> > points. The same numbers (6 and 8) are on the other end of
>> > sample.
>>
>> so the number of obs. for the three thirds for line() are
>> {8, 3, 8} in line() [also, after your patch, right?]
>>
>> whereas in MMline() they are as they should be, namely
>>
>> {6, 7, 6}
>>
>> But the {8, 3, 8} split is not at all what all "the literature",
>> including Tukey himself says that "should" be done.
>> (Other literature on the topic suggests that the optima...
2017 May 31
0
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
...ned by google and it happened to be
> tibco's doc, not the R's one. The layout is very similar hence my mistake.
> The latter does not mention "thirds" but ...
> Anyway, here is a new line's patch which still gives a result slightly different
> form MMline(). The slope is the same but not the intercept.
> What are the exact terms for intercept calculation that should be implemented?
> Serguei.
Sorry Serguei, I have new version of line.c since yesterday,
and will not be disturbed anymore.
Note that I *did* give the litterature, and...
2017 May 31
4
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
Seriously, if a method gives a wrong result, it's wrong. line() does NOT
implement the algorithm of Tukey, even not after the patch. We're not
discussing Excel here, are we?
The method of Tukey is rather clear, and it is NOT using the default
quantile definition from the quantile function. Actually, it doesn't even
use quantiles to define the groups. It just says that the groups