Skip to content

Measures of central tendency - mode

3 messages · Patrick E. McKnight, Spencer Graves

#
Thanks to Andy Liaw and J.R. Lockwood for your suggestions.  The which.max() worked great along with the rownames.  The complete solution for me was:

a <- table(varname)
[1] "1"

Amazing how a simple concept such as mode can present problems for us.  Thanks again.

To reply to Spencer Graves' question, I didn't find the disucssion via search.  I guess I might have overlooked the thread if it were titled kernel density since that seemed far too technical for this basic topic.  Sorry if I cluttered up the list though.

Cheers,

Patrick


On Fri, 30 Jan 2004 16:47:54 -0500 (EST)
"J.R. Lockwood" <lockwood at rand.org> wrote:

            
#
Evidently, I didn't read your question carefully enough.  If you 
want the mode of continuous data, that is not well defined, though there 
are devices to estimate such assuming, e.g., a specific distribution or 
a general unimodal distribution or ... .  This was discussed last Dec. 
12-13  by Ted Harding, Brian Ripley and others.  If you are interested, 
you can go www.r-project.org -> search -> "R site search" -> "harding 
mode".  When I did this just now, the first hit was an email on how to 
find the mode using a kernel density estimator.  Clicking "next in 
thread" a couple of times led me to a comment by Brian Ripley with a 
pointer to a document discussing this. 

      ... in case you are interested in more than what you already have. 

      spencer graves
Patrick E. McKnight wrote:

            
#
On Fri, 30 Jan 2004 14:56:42 -0800
Spencer Graves <spencer.graves at pdf.com> wrote:

            
Thanks greatly for the extended tip.  Yes the data are continuous in a sense but there are discrete values that can be counted and tabled.  The kernel density estimator shows up on my search as well.  

<snip rest of thread that followed>

Cheers,

Patrick