Statalist The Stata Listserver


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

Re: st: how to distinguish observations with the same code


From   "natalie chan" <[email protected]>
To   [email protected]
Subject   Re: st: how to distinguish observations with the same code
Date   Mon, 7 May 2007 14:13:39 +0100

Dear Johannes,

Thanks so much for your quick reply.

I have actually created a new variable country to distinguish the
firms before appending, I am wondering if it is possible to create a
new variable combining the information of "code" and "country", so
that the observations can be distinguished by one variable? Thanks
alot.

natalie

On 5/7/07, Johannes Geyer <[email protected]> wrote:
Dear Natalie,

you could just create a variable "country" in both data sets with "1" for
country a and "2" for b, afterwards you append the data. Then you can
identify each observation as a combination of "code" and "country" - so
you could also generate a new identifier.

johannes

Dear statalisters,

 This may be an elementary question but I could not find a solution in
Stata and the list archives, so here I am.

 I am working with two large datasets, each including more than
100,000 firms from two countries respectively. Each firm is assigned a
code number. so the structure of both datasets is as follows:

Code   sales profit turnover

1              3        4         6

2              3        5         6

3              7        4         2

?

1000000   4       5         8

 I have put the two datasets into one dataset using "Append", however,
how can I distinguish the firms from different regions since they have
the same code? Is it possible to generate a new variable with the
prefix before the code, for example, "german1"  "france1" etc.?


Thanks.

Natalie___________________
Johannes Geyer
Deutsches Institut f�r Wirtschaftsforschung (DIW Berlin)
German Institute for Economic Research
Graduate Center
Koenigin-Luise-Stra�e 5
14195 Berlin, Germany
Tel: +49-30-89789-258

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