Dear Stata users,
I have a numeric variable which takes, for instance, values like:
1017
273076
518097
3046
As you see, all these numbers have one thing in common: the third difit
starting from the right is always 0. That 0 should not be there and I want
to get rid of it so that my numeric variable looks like:
117
27376
51897
346
I think I could get what I want by using decode to transfor my numeric
variable into a string variable and then use some of the string functions
and/or some of the egen options for strings.
I guess (although I did not work it out) I could also use an algorithm. But
I have run into similar problems in the past and I would like to know
whether there is any stata routine that can be used (something similar to
what the string functions do, but for numeric varriables instead) to get the
desired result faster.
Thanks a lot in advance,
Best,
Anna
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/