Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: AW: create a dataset or vector of variable names


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: create a dataset or vector of variable names
Date   Wed, 24 Feb 2010 10:39:23 -0600

See also:

http://www.stata.com/statalist/archive/2008-05/msg00352.html

Scott


On Wed, Feb 24, 2010 at 10:36 AM, Martin Weiss <martin.weiss1@gmx.de> wrote:
>
> <>
>
>
>
> *************
> sysuse auto, clear
> d, varlist
> gen str30 varnames=""
>
> loc i 1
> foreach var of varlist `r(varlist)'{
>        replace varnames="`var'" in `i'
>        loc ++i
> }
>
> keep varnames
> l in 1/20
> *************
>
>
>
> HTH
> Martin
>
>

*
*   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   |   Site index