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]

Re: st: are Macro variable always possible ?


From   daniel klein <[email protected]>
To   [email protected]
Subject   Re: st: are Macro variable always possible ?
Date   Sun, 28 Aug 2011 21:59:18 +0200

John,

think about creating an indicator variable instead of defining a macro.

For example you could code

. g byte filter = (var1=="hello") & (var2==1) & (var3==43) &
(var6=="hello again") & !missing(var34)
. reg Y X if filter

Best
Daniel

---
John wrote :
I would like to define a macro variable which stores a long sequence
of data restrictions that I use after any IF qualifier when a function
allows it ..

For example instead of writing

 regress Y X if var1=="hello"&var2==1&var3==43&var6=="hello
again"&!missing(var34) ,
*
*   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