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]

Re: st: referencing a list of variables in multiple commands


From   Justin Wheeler <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: referencing a list of variables in multiple commands
Date   Sat, 3 Apr 2010 09:14:07 -0700

See the help for -local-. You can create a local variable storing your  
variable list.

Justin

On Apr 3, 2010, at 12:09 PM, "Vineet Bhagwat"  
<[email protected]> wrote:

> Sorry if this is a basic question.
>
> I want to create a varlist that I can continually reference in future
> commands in my .do file without having to type all the variables in
> the list.  For example I want to create a list of variables to include
> as independent variables in a regression without having to type them
> or copy/paste them into each reg command.
>
> Something like this:
> ------------------
> varlist v "assets roa roe ret"
>
> reg y v
> reg y v if x==0
> reg y v if x==1
> ---------------
>
> I couldn't figure out how to do this from the stata files, thanks in  
> advance!
>
> Vineet
> *
> *   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