Statalist


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

Re: st: List command


From   "Gabi Huiber" <ghuiber@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: List command
Date   Wed, 30 Jul 2008 18:41:39 -0400

gen byte tags=(regexm([name of the variable],"^TAG|^Tag|^tag"))

Tags will be equal to 1 for any cases where your variable of interest
starts with TAG, Tag or tag. It may be a bit of overkill, but it will
do the job.

Gabi

On Wed, Jul 30, 2008 at 1:43 PM, Daniel Sepulveda-Adams
<sepul003@umn.edu> wrote:
> Thank you again
>
> Daniel A. Sepulveda Adams
> Research Scientist - PRIME Institute
> College of Pharmacy - University of Minnesota
> 308 Harvard ST SE, Weaver Densford Hall, 7-159
> Minneapolis, MN, 55455, USA
> Phone: 612-624-8489
> Cell Phone: 651-295-7771
> Fax: 612-625-9931
> Email: sepul003@umn.edu
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Radu Ban
> Sent: Wednesday, July 30, 2008 12:21 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: List command
>
> look at the -strpos- function (among string functions). in your case
> what you may need is
>
> List [name of the variable] if strpos(x, "TAG") ~= 0
>
>
>
> 008/7/30, Daniel Sepulveda-Adams <sepul003@umn.edu>:
>> Thank you, now if I need all the subject that start with TAG
>>
>> Daniel A. Sepulveda Adams
>> Research Scientist - PRIME Institute
>> College of Pharmacy - University of Minnesota
>> 308 Harvard ST SE, Weaver Densford Hall, 7-159
>> Minneapolis, MN, 55455, USA
>> Phone: 612-624-8489
>> Cell Phone: 651-295-7771
>> Fax: 612-625-9931
>> Email: sepul003@umn.edu
>>
>> -----Original Message-----
>> From: owner-statalist@hsphsun2.harvard.edu
>> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Gabi Huiber
>> Sent: Wednesday, July 30, 2008 12:10 PM
>> To: statalist@hsphsun2.harvard.edu
>> Subject: Re: st: List command
>>
>> try =="TAGAMET"
>>
>> On Wed, Jul 30, 2008 at 1:05 PM, Daniel Sepulveda-Adams
>> <sepul003@umn.edu> wrote:
>> > Greetings,
>> >
>> > I know this is a basic question but I'm having problems to list a
> specific
>> > element in a variable. The elements in the variables are drugs names,
>> > therefore are string format.
>> >
>> > The command that I'm using is:
>> >
>> > List [name of the variable] if [name of the variable]==TAGAMET
>> >
>> > Could somebody tell me what I'm doing wrong? or if there is other way to
>> do
>> > that? Thank your for your time.
>> >
>> > Best regards -- Daniel Sepulveda
>> >
>> >
>> >
>> > *
>> > *   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/
>>
>> *
>> *   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/
>>
>
>
> --
> picasaweb.google.com/raduban
> *
> *   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/
>
*
*   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   |   What's new   |   Site index