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

st: dropping digits from variables in Stata 10

From   Ekaterina Hertog <>
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 Hertog (née Korobtseva)
Career Development Fellow
Department of Sociology and Nissan Institute of Japanese Studies
University of Oxford

27 Winchester Road
United Kingdom

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index