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]

st: referencing a list of variables in multiple commands


From   Vineet Bhagwat <[email protected]>
To   [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index