Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: keep if string for more variables
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: keep if string for more variables
Date
Tue, 10 Dec 2013 15:39:15 +0000
Should be
given a _string_ variable
Nick
[email protected]
On 10 December 2013 15:38, Nick Cox <[email protected]> wrote:
> What you typed is legal in Stata, given a variable whose name
> abbreviates to -color-, but it will catch only
>
> "blue*"
>
> as a literal string which is the value of that string variable.
>
> You appear to want
>
> keep blue*
>
> which is a beast of a different colour (as we say in English).
>
> Nick
> [email protected]
>
>
> On 10 December 2013 15:31, Nick Bornschein <[email protected]> wrote:
>> Hi,
>>
>> I have string variables, blue01 to blue10 and yellow01 to yellow10. I want
>> to keep some data by using:
>>
>> keep if color == "blue*" to keep all blue data, but it does not work. Any
>> idea?
>>
>> Thanks a lot
>> -Nick
>> *
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/