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: Using arguments in a global macro
From
"Kate Ivanova" <[email protected]>
To
<[email protected]>
Subject
st: Using arguments in a global macro
Date
Sun, 9 Feb 2014 20:17:40 -0500
Hello,
I am interested whether it is possible to include a command line argument in
a global macro. So far, I have tried to do that but it does not seem to
work. What I have looks approximately like this:
global x "var1 var2 `var'"
program prog1
args var
gen var3=1
reg depvar $x, noconstant
end
prog1 var3
My "var3" variable is actually not a constant but I just used the simplest
example to illustrate my point. When I run this program, I get the
regression results but "var3" is simply omitted.
I would appreciate any help with this. If I need to clarify my question,
please let me know.
Kate
*
* 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/