Fred Wolfe
>
> Practically, if the if condition is complicated one often
> makes a new
> variable or local macro, as in
>
> gen newvar = cond(x == 1 & age >27 & date >mdy(01,01,2002),1,0)
>
> then just using - if newvar- for the if condition.
>
In turn, it's perhaps worth pointing that this example is
equivalent to
gen newvar = x == 1 & age >27 & date >mdy(01,01,2002)
That is
cond(true_or_false_condition,1,0)
is equivalent to
true_or_false_condition
Nick
[email protected]
*
* 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/