{smcl} {* 13 May 2003}{...} {hline} help for {hi:modes} {right:(SJ3-2: sg113_1)} {hline} {title:Tabulation of mode(s)} {p 8 17 2} {cmd:modes} {it:varname} [{it:weight}] [{cmd:if} {it:exp}] [{cmd:in} {it:range}] [ {cmd:,} {c -(} {cmdab:m:in(}{it:#}{cmd:)} {c |} {cmdab:n:modes(}{it:#}{cmd:)} {c )-} ] {title:Description} {p 4 4 2} {cmd:modes} tabulates the mode(s) of {it:varname}, that is, the value(s) of {it:varname} that occur most frequently. {it:varname} may be numeric or string. {cmd:fweight}s and {cmd:aweight}s are allowed. {p 4 4 2} {cmd:modes} is most obviously useful with a discrete or categorical variable. Continuous variables may need to be placed in bins or classes first. {title:Options} {p 4 8 2}{cmd:min(}{it:#}{cmd:)} specifies that all values with a frequency of {it:#} or more should be shown. {p 4 8 2}{cmd:nmodes(}{it:#}{cmd:)} specifies that {it:#} modes should be shown. However, if ties in frequency make identification of precisely {it:#} modes arbitrary, all such tied modes will be shown. {title:Examples} {p 4 8 2}{cmd:. modes rep78}{p_end} {p 4 8 2}{cmd:. modes rep78 if foreign}{p_end} {p 4 8 2}{cmd:. modes mpg, min(3)}{p_end} {p 4 8 2}{cmd:. modes mpg, nmodes(3)} {title:Author} Nicholas J. Cox, University of Durham, U.K. n.j.cox@durham.ac.uk {title:Acknowledgment} {p 4 4 2}A problem posed by Sylvain Friederich led to the {cmd:nmodes()} option. {title:Also see} {p 4 13 2}STB:{space 4} STB-50 sg113{p_end} {p 4 13 2}Online: help for {help tabulate}, {help kdensity}