Hello,
I've noticed that median command is producing the result 3 for the list [1,2,3,4,5,6]. But since its size is an even number, shouldn't the median be equal to the arithmetic mean of the elements surrounding the "middle" of the list, in this case 3.5 (Octave, for example, returns this result)?
median of even-number sized lists
Modérateur : xcasadmin
Re: median of even-number sized lists
There are several definitions for median, the precise definition is not important to do descriptive statistics. I have selected the simplest to implement (and it also has the advantage that it can be extended to every kind of objects with an ordering, not necessarily requiring arithmetic operations).
Re: median of even-number sized lists
Thanks for the explanation. Now it's also clear why Octave developers chose the definition returning 3.5 in the above case, as they are focused almost exclusively on floating point computation.