Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Create a variable equal to the first part of another variable


From   Mario Jose <[email protected]>
To   [email protected]
Subject   st: Create a variable equal to the first part of another variable
Date   Sat, 13 Jul 2013 15:31:30 +0100

Dear All,

I have a database where the ID is like this AT9898_DE. This specific
observation is a subsidiary located in the country DE owned by the
shareholder 9898 located in the country AT. I would like to create two
variables: one consisting the country of the sharehodler (AT in the
example) and another equal to the country of the subsidiary (DE).

I would be grateful for suggestions on how to generate from the ID
variable these two variables.  In the end I would have my
observations/databse like this:

ID                         Share_country    Subs_country
AT9898_DE                 AT                         DE
PL9769_CZ                 PL                         CZ
....                       .           ...                           ...

I would appreciate any help.

Best regards,
MJ
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index