Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: reordering observations


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: reordering observations
Date   Fri, 1 Aug 2008 16:00:32 +0200

Well, - which reorder- tells me there is no such command in Stata, but surely there is an -order- command. Your request is unusual because a -sort- is supposed to affect all vars at the same time so that the observations gathered in the rows of the dataset remain intact. Why do you not just -keep- this one var, -save- it under a different name, -sort- it and then -merge- it back with the old data? I imagine that might also be possible with a -tempfile-...

Martin Weiss
_________________________________________________________________

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany

Fon: 0049-7071-2978184

Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130

Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131

SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Cindy Gao
Sent: Friday, August 01, 2008 3:44 PM
To: [email protected]
Subject: st: reordering observations

Hello,

I need to reorder one of my variables (from lowest to highest) without changing the order of other variables in my dataset. Is there any simply way to do this?

Like, I have now:
var1    var2       var3 ...
3        7             9
2        10           3
7        8             5
..........

And I like to reorder var3 to get:
var1    var2       var3 ...
3        7             3
2        10           5
7        8             9
..........

Please, this is not the -reorder- command which is already there in Stata, it is something different.

Many thanks!
Cindy



      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html


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


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index