Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Dropping observations


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Dropping observations
Date   Thu, 17 Sep 2009 14:57:05 +0100

Yes. If these are string values, technique is given by 

drop if substr(mystr, 1, 1) == "0" 

drop if substr(mystr, 1, 2) == "00" 

If these are numeric values, tell us more. 

Nick 
[email protected] 

Ermias Ogbai Weldemicael

I am trying to drop observation from one variable. The variable contains
four digit values (e.g. 0011 8944 4500 3512..). Is it possible to drop
an
observation by if condition of the first digit..or first two digits.
Like
'drop if value starts with 00'

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index