<>
Use a -local-:
****
sysuse auto, clear
local myregressors " weight length turn displacement"
regress price weight length turn displacement
*equivalently
regress price `myregressors'
*****
HTH
Martin
_______________________
----- Original Message -----
From: "Shuaizhang Feng" <[email protected]>
To: <[email protected]>
Sent: Wednesday, March 25, 2009 6:49 PM
Subject: st: abbreviating a variable list in regression commands
dear all:
i am wondering how to use an abbreviation for a long list of explanatory
variables in a regression command (for the purpose of repeating it).
for example, consider the command:
reg y xyz qwe abc
if I want to use z to refer to the list "xyz qwe abc" so that I can write
something shorter such as:
reg y z
I am not quite clear about the exact syntax that would work. Thanks a lot
for your help.
Shuaizhang
*
* 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/