Re: [R] how to calculate the mode of a continuous variable

2008-08-29 Thread Manuel Ramon
Thanks Peter, it's a good solution. Finding on RSiteSearch I found a similar solution and I wrote a function to obtain the mode. That function is as follows. mode <- function(data) { # Function for mode estimation of a continuous variable # Kernel density estimation by Ted Harding & Dougla

Re: [R] how to calculate the mode of a continuous variable

2008-08-29 Thread Henrique Dallazuanna
Oh you are right Peter, thanks On Fri, Aug 29, 2008 at 8:37 AM, Peter Dalgaard <[EMAIL PROTECTED]>wrote: > Henrique Dallazuanna wrote: > > Try: > > > > as.numeric(names(which.max(table(x > > > > On Fri, Aug 29, 2008 at 3:13 AM, Manuel Ramon <[EMAIL PROTECTED]> wrote: > > > > You missed the wo

Re: [R] how to calculate the mode of a continuous variable

2008-08-29 Thread Peter Dalgaard
Henrique Dallazuanna wrote: > Try: > > as.numeric(names(which.max(table(x > > On Fri, Aug 29, 2008 at 3:13 AM, Manuel Ramon <[EMAIL PROTECTED]> wrote: > You missed the word "continuous" there... > x <- rnorm(10) > table(x) x -1.64244637710945 -0.836534097622312 -0.810292826933485 -0.721008

Re: [R] how to calculate the mode of a continuous variable

2008-08-29 Thread Henrique Dallazuanna
Try: as.numeric(names(which.max(table(x On Fri, Aug 29, 2008 at 3:13 AM, Manuel Ramon <[EMAIL PROTECTED]> wrote: > > Is there any R funtion that allow the estimation of mode in a continuous > variable? > Thank you > -- > View this message in context: > http://www.nabble.com/how-to-calculate-

[R] how to calculate the mode of a continuous variable

2008-08-29 Thread Manuel Ramon
Is there any R funtion that allow the estimation of mode in a continuous variable? Thank you -- View this message in context: http://www.nabble.com/how-to-calculate-the-mode-of-a-continuous-variable-tp19214243p19214243.html Sent from the R help mailing list archive at Nabble.com. __