Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

AW: st: re: sort


From   Buechte, Sebastian (Institut f�r Arbeitswissenscha ften) <[email protected]>
To   <[email protected]>
Subject   AW: st: re: sort
Date   Thu, 13 Jan 2005 14:17:52 +0100

Sorry for that "help order - mail", I just got i wrong. 

You could also generate a new variable and assign a position to each entry in _var and then sort using that variable. (this is a workaround...I know)

like this:

	gen pos=1 if _var=="age"
	replace pos=3 if _var=="exp"
	replace pos=2 if _var=="school"
	sort pos
	drop pos

sebastian




> -----Urspr�ngliche Nachricht-----
> Von: [email protected] 
> [mailto:[email protected]] Im Auftrag von 
> Hans J. Baumgartner
> Gesendet: Donnerstag, 13. Januar 2005 14:02
> An: [email protected]
> Betreff: Re: st: re: sort
> 
> 
> The commands order and move wouldn't work since I would like to order 
> lines, i.e. observations.
> cheers
> Hans
> 
> Buechte schrieb:
> 
> > Please see - help order -
> > the command "order"/"move" will allow you to user-define 
> the order of 
> > your variables in your dataset.
> > 
> > 
> >>-----Urspr�ngliche Nachricht-----
> >>Von: [email protected]
> >>[mailto:[email protected]] Im Auftrag von 
> >>Hans J. Baumgartner
> >>Gesendet: Donnerstag, 13. Januar 2005 12:57
> >>An: [email protected]
> >>Betreff: st: sort
> >>
> >>
> >>Dear statalist,
> >>
> >>to describe my data, I decided to use the collapse command.
> >>
> >>Since I have quite a few variables I am unhappy by sorting them in
> >>alphabetic order. Is it possible to sort them in a 
> user-defined order?
> >>
> >>The table 1 shall become table 2
> >>table1
> >>_var	_stat
> >>age	50
> >>exp	14
> >>school 	5
> >>
> >>table2
> >>_var	_stat
> >>age	50
> >>school	5
> >>exp	14
> >>
> >>All suggestions are welcomed.
> >>Thanks
> >>Hans
> >>
> >>--
> >>Hans J. Baumgartner DIW Berlin
> >>German Institute for Economic Research
> >>Dept. Public Economics
> >>K�nigin-Luise-Str. 5; 14195 Berlin; Germany
> >>Tel.: +49/30/89789-307
> >>Fax.: +49/30/89789-114
> >>http://www.diw.de
> >>http://www.hansbaumgartner.de
> >>
> >>
> >>*
> >>*   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/
> >>
> > 
> > 
> > *
> > *   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/
> > 
> 
> -- 
> Hans J. Baumgartner DIW Berlin
> German Institute for Economic Research
> Dept. Public Economics
> K�nigin-Luise-Str. 5; 14195 Berlin; Germany
> Tel.: +49/30/89789-307
> Fax.: +49/30/89789-114
> http://www.diw.de
> http://www.hansbaumgartner.de
> 
> *
> *   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/
> 

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



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