Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Creating a new numerical variable without mathematical operations


From   "Ramani Gunatilaka" <[email protected]>
To   [email protected]
Subject   Re: st: RE: Creating a new numerical variable without mathematical operations
Date   Sat, 21 Oct 2006 15:46:27 +0100

Thanks for this. But on closer examination I realise that I can't
relate the two data sets at all. The coding is quite different. I am
very sorry for your trouble.
Ramani

On 21/10/06, Steven Stillman <[email protected]> wrote:
gen newvar = province*10000 + city.

-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of Ramani
Gunatilaka
Sent: Sunday, October 22, 2006 2:47 AM
To: [email protected]
Subject: st: Creating a new numerical variable without mathematical
operations


Dear all,
I have two numerical variables, province and city: province has two
digits, city has at least 4.
eg. province= 11, city=  6227
I want to create a new numerical variable called 'newcity' which will
combine province and city like this:
116227
This is because I have to combine this data set with another, and the
unique identifying variable in the second data set has been
constructed in this way.
Can someone please tell me what command I may use?
Thanks so much,
Ramani
*
*   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/


*
*   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/

*
*   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/



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