I just replied to Rodrigo Briceno
< snip >
> His code is similar, if I'm understanding properly:
>
> bysort clave1 : gen freq = _N
> egen tag = tag(clave1)
> gsort - tag - freq
> gen order = _n
> tabdisp order in 1/10 if tag, c(clave1 freq)
>
That's all using official Stata.
Here's an alternative solution, using the
-egen- function -egroup()- downloadable from
-egenmore-, and discussed yesterday on Statalist.
Note the minus sign in the first command.
bysort clave1 : gen freq = - _N
egen group = egroup(freq clave1) , l(clave1)
tabulate group if group < 11
<<attachment: winmail.dat>>