[R] mode

Murray Jorgensen maj at stats.waikato.ac.nz
Sat Dec 13 03:34:03 CET 2003


Apologies for pursuing this increasingly off-topic thread, but I've just
remembered that 'my' mode is not so hard to compute. Suppose a
one-dimensional data set is in general position (all gaps unequal), find
the smallest gap, then choose whichever endpoint has the closest neighbour.
That's the mode.

At 16:39 12/12/2003 +1300, Murray Jorgensen wrote:
>Opps! This is what I should have written:
>
>The mode of a data vector x might be defined as the limit of m_p as p 
>tends to zero from above and where m_p is the m minimizing
>sum(abs(x - m)^p).  I would not expect the mode so defined to be of much 
>use in data analysis, nor would it be easy to compute.
>
>Murray
>
>[Thanks to Duncan Murdoch for noticing the missing ^p .]
>
>Douglas Bates wrote:
>
>> "Christian Mora" <christian_mora at vtr.net> writes:
>> 
>> 
>>>How can I get the mode (most frequent value) from a dataset (continuos
>>>variables)? I can obtain it when the data is discrete (by making a table
>>>and looking at the higher frequency) but I don't know how obtain it
>>>from, for example, a density plot of the data. Does anyone know how to
>>>do it? Thanks
>> 
>> 
>> I don't think the mode of a sample from a continuous random variable is
well
>> defined.
>> 
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>> 
>> 
>
>-- 
>Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
>Department of Statistics, University of Waikato, Hamilton, New Zealand
>Email: maj at waikato.ac.nz                                Fax 7 838 4155
>Phone  +64 7 838 4773 wk    +64 7 849 6486 home    Mobile 021 1395 862
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 
Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz                                Fax 7 838 4155
Phone  +64 7 838 4773 wk    +64 7 849 6486 home    Mobile 021 1395 862




More information about the R-help mailing list