[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 <>
Subject   Re: st: Order variables in dataset by type of variable
Date   Fri, 22 Feb 2008 13:25:15 +0000 (GMT)

--- John GIBSON <> 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 )

Hope this helps,

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

Sent from Yahoo! Mail.
A Smarter Inbox.
*   For searches and help try:

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