Bookmark and Share

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: Conditional statement with multiple string values?


From   Richard Goldstein <[email protected]>
To   [email protected]
Subject   Re: st: Conditional statement with multiple string values?
Date   Thu, 07 Jun 2012 16:40:01 -0400

your statement is illegal; better read up on the -if- expression

try using -inlist-

Rich

On 6/7/12 4:34 PM, John Whitmer wrote:
> Hello Statamasters,
> 
> I'm trying to run a conditional "drop" statement based on multiple values in a string variable.  
> 
> I tried the following command:
> 
>  drop if ACTION_NAME == "topic-viewed” | “organizer-viewed” | “discussion-home-viewed” | “assignments-listed” | “Web-Links-home
>> -viewed” | “folder-selected” | “compile-lm”
> 
> And  received the error message "too few quotes".  
> 
> My quotes are paired ... 
> 
> Alternatively, I tried the following:
> 
> . drop if ACTION_NAME == "topic-viewed” | ACTION_NAME ==“organizer-viewed” | ACTION_NAME ==“discussion-home-viewed” | ACTION_NAM
>> E ==“assignments-listed” | ACTION_NAME ==“Web-Links-home-viewed” | ACTION_NAME ==“folder-selected” | ACTION_NAME ==“compile-lm
>> ”
> 
> And didn't get the error message, but there were 0 observations deleted - and this is a monster logfile with a lot of records with these values.
> 
> Any ideas?  And I know the severity of the drop statement ... 
> 
> Best, John
> 
>  *********************************************
> John Whitmer
> E: [email protected]
> P: 530.554.1528
> C: 530.574.8827
> Skype: john.whitmer
> Virtual Meeting Room:  http://bit.ly/rnBS8u
> 
> Discoveries & Reflections on Google+
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index