Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: How to make macro variables last an entire session?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: How to make macro variables last an entire session?
Date   Wed, 30 Aug 2006 11:45:14 +0100

Don't do that, then! 

More seriously, you are violating the 
syntax of -regress-, or more generally of
what counts as a varlist. Simply, the " "
are not allowed in a varlist. Your 
command should be just 

regress $base 

Nick 
[email protected] 

[email protected]
 
> Thanks! For some reason, when I put quotation marks around 
> $base I get the error message 
> 
> "var1 var2 var3 var4 invalid name
> r(198);
> 
> But when I put nothing around $base, everything works fine. 
> And this holds if I use multiple global macros. For example, 
> the following works:
> 
> tabstat $base $ace $case, by(person) stats(n mean median cv)
 
Philipp Rehm <[email protected]>
 
> - -global- may be what you are looking for. See "help global"
> 
> global base "lncgdp s n popuned popprimed popseced pophighed openc"
> 
> regress "$base"
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index