Dear All,
I have a variable called ID that goes from 1 through 60, and an X
variable that takes the same value within each ID value (I have an
unbalanced panel of about 50,000 obs). I want to create a new ID
variable that is sorted in ascending or descending order by X so that I
can do a sorted twoway bar graph. Or, better yet, is there a way to sort
twoway bar or rspike graphs? Sorted graphs seem to be an option for
'graph bar' but not for 'twoway bar'. Thanks for your help, Jose.
For example:
ID X SortedID or SortedID
1 4 2 2
1 4 2 2
1 4 2 2
2 7 1 3
3 2 3 1
3 2 3 1
*
* 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/