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, statalist.org is already up and running.


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

RE: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS?


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS?
Date   Tue, 21 Sep 2010 01:05:48 +0200

<>
I am not sure, Anisa, that this is a good recommendation. The request was to have a qualifier set to one whenever a variable matches one of several values. How does the greater than operator address this issue?

HTH
Martin

-original message-
Subject: Re: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS?
From: Anisa Shyti <anisa.shyti@gmail.com>
Date: 21-09-2010 00:41

Try the cond(.) function:

cond( x>y, 1, 0) where x>y can be anything you wish (including
multiple conditions in your list) and it returns 1 (or any
thing else) for true and 0 (or anything else) for false.

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


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