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 at the end of May, and its replacement, statalist.org is already up and running.


[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" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Scott Merryman
Gesendet: Mittwoch, 24. Februar 2010 17:39
An: statalist@hsphsun2.harvard.edu
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 <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/


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