Statalist


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

Re: st: Order variables in dataset by type of variable


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Order variables in dataset by type of variable
Date   Fri, 22 Feb 2008 13:25:15 +0000 (GMT)

--- John GIBSON <[email protected]> wrote:
> I have a dataset with 600 variables, of which about 500 are numeric
> and 100 are strings. The string variables are spread right throughout
> the dataset.
> 
> I want to order the variables to move all of the strings to the end
> and the numeric variables at the beginning, but neither the order,
> aorder or placevar commands give the option of ordering by type of
> variable.

You can use the undocumentend command ds, like in the example below.
For more on -ds- see: -help ds-. (undocumented means that it is not
documented in the paper documentation but there is an electronic help
file, see: -help undocumented-.)

*--------- begin example ---------
sysuse auto, clear
ds , has(type numeric)
order `r(varlist)'
*--------- end example ------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

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


      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Inbox. http://uk.docs.yahoo.com/nowyoucan.html
*
*   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