Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Is there an equivalent of ACCESS IIF function in STATA?


From   Weiwei Du <[email protected]>
To   [email protected]
Subject   st: Is there an equivalent of ACCESS IIF function in STATA?
Date   Mon, 05 Jul 2004 14:08:41 -0700

Hi,

In ACCESS the IIF function returns one value if a specified condition
evaluates to TRUE, or another value if it evaluates to FALSE:

IIF (condition, value_if_true, value_if_false)

condition is the value that you want to test.
value_if_true is the value that is returned if condition evaluates to TRUE.
value_if_false is the value that is return if condition evaluates to FALSE

I'm looking for a similar function in STATA in order to set a variable to
two different values based on a condition test.

Is there such a function existing? Or, any other easy way to work this out?

Thank you very much.

Weiwei


*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index