Statalist


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

Re: st: reordering observations


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: reordering observations
Date   Fri, 1 Aug 2008 15:14:46 +0100 (BST)

There is a very good reason why that is not easy, and why I will not
tell you how to do it. Remember that the rows in a dataset represent
the observations/respondents/firms/critters on which you have a number
of measurments (var1, var2, and var3). Think of this as a survey. If
you start sorting one variable but keep the rest of the variables
constant you are basically assigning the answer to question 3 (var3 in
your example) to different persons. In other words you will have
completely ruined your dataset.

-- Maarten

--- Cindy Gao <cindy.gao@ymail.com> wrote:
> 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
> ..........
> 


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


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



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index