No, this is not quite right: 

which.max

-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
R search page: http://finzi.psych.upenn.edu/

You need to be more careful 

1. For a continuous distribution, the mode is ** not ** the most frequent
value (this has no meaning) -- it is the maximum of the density function. So
you must fit a density function and then estimate the mode, perhaps by using
which.max() on a discretization of the fitted density. Or, if you have the
fitted density in closed form (and it is unimodal) you can use calculus.

2. For a discrete distribution, which could be the sample empirical
distribution,use which.max(table()). 

-- Bert Gunter

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
    • ... Tobias Verbeke
    • ... Uwe Ligges
  • ... Shaw, Philip (NIH/NIMH)
  • ... Liaw, Andy
  • ... Paolo Tommasini
    • ... Roger Bivand
    • ... Arne Henningsen
  • ... Wildi Marc, wia
  • ... Paolo Tommasini
    • ... Jonathan Baron
      • ... Berton Gunter
      • ... Charles Annis, P.E.
      • ... Tony Plate
  • ... Loke Chok Kang
  • ... Austin, Matt
  • ... Austin, Matt
    • ... Thomas Lumley
  • ... Paolo Tommasini
  • ... Наталия Титова

Reply via email to