[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: if vs if
On Apr 17, 2004, at 2:33 AM, Renzo wrote:
I would like to do the following thingYou are confusing the 'if' that may appear as a component of many Stata
commands, e.g. summarize income if sex==1, and the programmer's 'if'.
Furthermore, since each observation of var2 may take on a different
value, what does it mean to generate one macro with value equalling the
first observation of var1 in this context? Do you mean if any
observation of var2 takes on 'value'? Or if all observations of var2
are equal to 'value'?
. local macroname = var1 if var2==value
This is not legal syntax though. I looked on [U] and [P] to see if
were any extended macro function to help me but I did not find any.
Your workaround looks only at the first observation of var2. Is that
what you really mean? Please clarify.
* For searches and help try: