Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: are Macro variable always possible ?


From   daniel klein <klein.daniel.81@googlemail.com>
To   statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index