[R] Computing the mode
rvaradha at jhsph.edu
Tue Feb 24 22:23:20 CET 2004
I remember Prof. Ripley suggesting the "taut springs" approach to
estimating the modes, sometime ago in a posting to this group. I would
be interested in knowing whether there is any R implementation of this
approach (developed by Davies (1995)), for both non-parametric
regression and density estimation.
----- Original Message -----
From: Spencer Graves <spencer.graves at pdf.com>
Date: Tuesday, February 24, 2004 7:12 am
Subject: Re: [R] Computing the mode
> The problem is that 'the statistic "mode" of a sample' has
> clear definition. If the distribution is highly discrete, then
> following will do the job:
> > set.seed(1)
> > X <- rpois(11,1)
> > (nX <- table(X))
> 0 1 2 3
> 4 4 2 1
> > names(nX)[nX==max(nX)]
>  "0" "1"
> However, if the data are continuous with no 2 numbers
> equal, then the "mode" depends on the procedure, e.g., the
> selection of breakpoints for a histogram. If you insist on
> something, you can try "www.r-project.org" -> search -> "R site
> for something like ""nonparametric density estimation" and / or
> density estimator".
> hope this helps.
> spencer graves
> p.s. This has been discussed recently on this list, but I
> not easily find it in the archives.
> Aurora Torrente wrote:
> > Hi all,
> > I think this question could be quite trivial, but I can´t find
> out the
> > solution... How can you compute the statistic "mode" of a
> sample, in
> > case it exists (as mode() returns the mode of an object)? I
> > help.search("mode") but I couldn't find a clue...
> > Any help would be much appreciated. Regards,
> > Aurora
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide! http://www.R-project.org/posting-
More information about the R-help