Skip to content
Prev 360257 / 398503 Next

Interquartile Range

Well, instead of your functions try:

Mode <- function(x) {
     tabx <- table(x)
     tabx[which.max(tabx)]
}

and use R's IQR function instead of yours.

... so I still don't get why you want to return a character string
instead of a value for the IQR;
and the mode of a sample defined as above is generally a bad estimator
of the mode of the distribution. To say more than that would take me
too far afield. Post on stats.stackexchange.com if you want to know
why (if it's even relevant).

Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Tue, Apr 19, 2016 at 4:25 PM, Michael Artz <michaeleartz at gmail.com> wrote: