Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
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/