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]

st: referencing a list of variables in multiple commands


From   Vineet Bhagwat <vineet.bhagwat@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: referencing a list of variables in multiple commands
Date   Sat, 3 Apr 2010 12:08:13 -0400

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/


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