Kip, I get the same result as Raul.  No need to load 'stats'.  My new mean
does not include  @  .



l=: 13 :'(i.<.-:#y){y'
r=: 13 :'|.(i.<.-:#y){|.y'

me=: 13 :'-:+/((<.,>.)-:<:#y){/:~y'
(<./;([:me l);me;([: me r);>./)1 2 2 4 6 
--T---T-T-T-┐
│1│1.5│2│5│6│
L-+---+-+-+--

I'm happy because the definition is all forks.

5!:4 <'me'
-- [: 
+- -: 
│ -- [: 
│ +- / --- + 
--+ │ -- [: 
│ │ │ -- <. 
│ │ +----+- , 
L----+ │ L- >. 
│ ------+ 
│ │ │ -- [: 
│ │ │ +- -: 
│ │ L----+ -- [:
L-----+ L----+- <:
│ L- # 
+- { 
L- ~ --- /:
   

It looks better in J !

Linda

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kip Murray
Sent: Tuesday, May 06, 2014 5:15 PM
To: [email protected]
Subject: Re: [Jprogramming] Five Number Summary

Tukey used the name "fourths" because they are a little different from
quartiles.

On Tuesday, May 6, 2014, Joe Bogner <[email protected]> wrote:

> On Tue, May 6, 2014 at 4:33 PM, Kip Murray
<[email protected]<javascript:;>>
> wrote:
>
> >    jtfns 1 2 2 4 6  NB. correct
> > 1 1.5 2 5 6
> >    five 1 2 2 4 6  NB. doesn't work if repetitions in data
> > 1 1 2 5 6
> >
> >
> On Tue, May 6, 2014 at 4:33 PM, Kip Murray
<[email protected]<javascript:;>>
> wrote:
>
> >    five 1 2 2 4 6  NB. doesn't work if repetitions in data
> > 1 1 2 5 6
> >
> >
> It's interesting that R gives even a different result (
> http://en.wikipedia.org/wiki/Five-number_summary#Example_in_R)
>
> > z <- c(1,2,2,4,6)
> > fivenum(z)
> [1] 1 2 2 4 6
> > summary(z)
>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
>       1       2       2       3       4       6
>
>
> For the 1st quartile, Excel gives 2 with QUARTILE.INC and 1.5
> with QUARTILE.EXC
> For the 3rd, Excel gives 4 and 5 respectively
>
> So R is following the "INC" method
>
> http://stats.stackexchange.com/questions/28123/quartiles-in-excel is an
> interesting read
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


-- 
Sent from Gmail Mobile
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to