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]

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 08:20:31 +0200 |

<> Sorry, I cannot see how this is more handy than -inlist()-, but you would have to double the equal signs in the -cond()- in any case: ************* clear* set obs 10 gen byte x=_n gen byte myvar= cond(x==3 | x==4 | x==5, 1, 0) l ************* HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Anisa Shyti Sent: Dienstag, 21. September 2010 01:27 To: statalist@hsphsun2.harvard.edu Subject: Re: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS? Martin, let me be more precise: in the condition should be cond(x=3 | x=4 | x=5, 1, 0) - it depend on the condition one needs to set - I was giving a handy example. The cond(.) is pretty flexible. * * 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/

**Follow-Ups**:**Re: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS?***From:*Anisa Shyti <anisa.shyti@gmail.com>

**References**:**RE: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS?***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**Re: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS?***From:*Anisa Shyti <anisa.shyti@gmail.com>

- Prev by Date:
**Re: st: 2-stages cluster analysis** - Next by Date:
**Re: st: RE: Loop for creating a sum of previous observations in an unbalanced panal data set** - Previous by thread:
**Re: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS?** - Next by thread:
**Re: st: RE: RE: RE: Comparison operator, similar to "IN" in SAS?** - Index(es):