Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

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


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: st: AW: create a dataset or vector of variable names
Date   Wed, 24 Feb 2010 17:47:57 +0100

<> 


Sure, my approach is way too cumbersome, by all means use -ssc d descsave-
by Roger Newson.



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Scott Merryman
Gesendet: Mittwoch, 24. Februar 2010 17:39
An: [email protected]
Betreff: Re: st: AW: create a dataset or vector of variable names

See also:

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

Scott


On Wed, Feb 24, 2010 at 10:36 AM, Martin Weiss <[email protected]> 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/


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index