bysort name : gen negfreq = -_N
sort negfreq name
Nick
[email protected]
[email protected]
> I have a dataset of 50,000 names. I need to order them by
> frequency so
> that the names that recur the most are at the top of the
> list, decreasing
> by frequency. Thus far I have used bigtab to tabulate the
> results, but I
> don't know how to order such a large dataset by freq. , since
> many commands
> are refused due to having "too many variables". The names
> are listed as
> string variables. I used encode name, gen(firstname) to create a new
> variable with numerical value, but when I use the sort
> command it sorts it
> into alphabetical order. Do you have any idea how I order
> the data by frequency?
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/