Statalist


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

st: dropping digits from variables in Stata 10


From   Ekaterina Hertog <ekaterina.hertog@sociology.ox.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: dropping digits from variables in Stata 10
Date   Mon, 23 Feb 2009 11:02:56 +0000

Dear All,
I am rather new to Stata so I apologize in advance if these are rather silly questions, but I googled around extensively and searched Stata help and cannot find an adequate solution. 1) I have got a variable consisting of 7 digit zipcodes. I want to create a second variable which will only consist of the first 3 digits of each zip-code and I cannot find a way to do it. 2) Some of the zipcodes start with 00, e.g 0037845 and Stata drops the front 00 turning such zipcodes into 5-digit numbers (e.g. 37845). I need to make Stata understand that these 00 are meaningful and return them back into the zipcodes and I cannot find how to do this. They were present in my original csv file, but when I converted it into a Stata file using Stattransfer they were gone.
I will be most grateful for any help or advice,
Sincerely yours,
Ekaterina

--
Ekaterina Hertog (née Korobtseva)
Career Development Fellow
Department of Sociology and Nissan Institute of Japanese Studies
University of Oxford

27 Winchester Road
Oxford
OX2 6NA
United Kingdom


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