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: Retrieving variable list from describe


From   Phil Schumm <pschumm@uchicago.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Retrieving variable list from describe
Date   Fri, 21 Jun 2013 14:27:48 -0500

On Jun 21, 2013, at 2:20 PM, Barth Riley <barthriley@comcast.net> wrote:
> i would like to retrieve the list of variables matching a specification used with describe, e.g.:
> 
> describe item*
> 
> I know that describe provides an r(varlist) macro, yet I can seem to use or access it. For instance:
> 
> foreach var in "`r(varlist)'" {
> ...
> }
> 
> does nothing. I have also tried not enclosing `r(vrlist)' in quotes . Does this only work in conjunction with the ds command?


You need the -varlist- option with -describe-.


-- Phil


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index