Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: global keys


From   "Sergiy Radyakin" <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: global keys
Date   Fri, 14 Sep 2007 17:27:15 +0200

Alternatively you can try string comparison:

keep if site_02>="C180" & site_02<="C189"

Just make sure that there are no other codes in between.

Best regards,
    Sergiy Radyakin


On 9/14/07, Michael McCulloch <mm@pinest.org> wrote:
> Thank you Michael!
>
> >see help inlist()
> >
> >It only works with up to 10 strings (which your example exactly meets)
> >
> >M Blasnik
> >
> >----- Original Message ----- From: "Michael McCulloch" <mm@pinest.org>
> >To: "Statalist" <statalist@hsphsun2.harvard.edu>
> >Sent: Friday, September 14, 2007 10:01 AM
> >Subject: st: global keys
> >
> >>Dear Statalist members,
> >>I have a dataset which contains a variable <site_02> containing a
> >>long list of tumor ID codes, from which I want to keep ten:
> >>C180 through C189.
> >>
> >>Is there a less labor-intensive way to do the following:
> >>
> >>keep if site_02=="C180" |  site_02=="C181" |  site_02=="C182" |  ///
> >>site_02=="C183" |  site_02=="C184" |  site_02=="C185" | ///
> >>site_02=="C186" |  site_02=="C187" |  site_02=="C188" | site_02=="C189"
> >>
> >
> >*
> >*   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/
>
> *
> *   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/
>
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index