Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Rainer Maurer <rainer.maurer@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Using wildcards in string variables to drop observations |
Date | Mon, 30 Sep 2013 13:12:10 +0200 |
Dear Statalisters, I'm a stata-newy and have the following problem: I want to drop all observations where in a string variable the string "%" appears. I thought the straightforward command would be ' drop if variable = = "*%" '. However, using this command, nothing is eliminated. If I specify the string completly (like ' drop if variable = = "DE12%" ' the observation is eliminated just as I want it. Where is my mistake? Do wildcards like * not work in these kinds of commands? Thanks a lot for any piece of help! Rainer * * 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/