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

st: RE: AW: RE: "sort" over different variables

From   "Nick Cox" <>
To   <>
Subject   st: RE: AW: RE: "sort" over different variables
Date   Mon, 24 Aug 2009 20:47:48 +0100

I did later. But note that the version of -rowsort- on SSC is superseded
by that in the Stata Journal. 


Martin Weiss

The -sort- command orders by rows, not by columns. To use it, you would
in the rare situation to have to apply -xpose-.

Apart from that, -ssc d rowsort- comes to mind, although NJC himself
not mention it in his post...

Nick Cox

This is too simplified and could be any number of things. 

Renaming or re-ordering your variables may be quite enough to solve your
problem. See, e.g., -order-. 

If that doesn't make sense, please explain in more detail what your
problem is. 


I have a quick (and probably simple) question: I would like to "sort" my
dataset over several variables. At the moment my dataset looks like this
(very simplified example):

Var1   Var2   Var3    Var4 
1000   3000   2000    500

And should look like this:

Var1    Var2    Var3    Var4
500      1000    2000    3000    

*   For searches and help try:

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