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 on April 23, and its replacement, 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 <>
Subject   Re: st: are Macro variable always possible ?
Date   Sun, 28 Aug 2011 21:59:18 +0200


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


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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index