Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Issue on sorting on categorical variables


From   "Grigolon, Laura" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Issue on sorting on categorical variables
Date   Wed, 1 Jun 2011 13:14:22 +0000

Dear Statalisters,
I have an issue about sorting on categorical variables.
I sorted on a variable that does not have unique values for every observation in the data and subsequently I referred to the order within the group by generating a variable id = _n. I then used the id number to replace values (such as: replace variable = 10 if id==100).
I realize that my approach is wrong, as explained in the FAQ (http://www.stata.com/support/faqs/lang/sort.html), since Stata does not keep the same ordering. However, since I implemented a huge amount of modifications, I was wondering if there is a way to be able to run the do file again and obtain the same results.
Thank you for your help,
Laura

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index