I believe there is also a canned mode function in the dprep library.
library(dprep)
moda() #gives the mode
Best,
Ian
On Tue, 25 Apr 2006, Lucy Barnes wrote:
I've been using:
as.numeric(names(table(data$VARIABLE))[table(data$VARIABLE)==max(table(data$VARIABLE))])
which is long-winded but general.
-Lucy
On Tue, 25 Apr 2006, Juan Vargas wrote:
Hi all,
How can I set a variable at its mode?
Juan
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l