Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Richard Goldstein <richgold@ix.netcom.com> |
To | statalist@hsphsun2.harvard.edu |
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: jcwhitmer@ucdavis.edu > 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/