Regarding sorting rows: There is also Nick Cox's -rowsort- or Jeff
Arnold's -sortrow- (use -findit- to locate and download).
Scott
On Wed, Jul 13, 2011 at 2:22 PM, Daifeng He <dhe.statlist@gmail.com> wrote:
> Thanks, Scott. The code works and it's exactly what I had wanted.
>
> Oliver, your codes look reasonable to me too but when I run them, only
> the first obs is filled in with values for the two newly-generated
> variables. I will try to figure it out.
>
> Joerg, yes, my weight variables are sorted for each obs, but your
> codes are illuminating and I learned from them too.
>
> Guys, thanks for all your help!
>
> Kind regards,
> Daifeng
>
>
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/