Hi,
I am trying to generate a new variable call (ID_new) as shown below, from an existing variable in my data set called (ID_orginal). where my new (ID_new) is to be the exact same of the old variable value except that its values are contained between two square Brackets [as shown in bold], and combined with the (ID_1) variable value.
Here is an example of my data, I created this part manually in excel but could not figure how to do it in stata to run it for my entire data set:
thank you
I am trying to generate a new variable call (ID_new) as shown below, from an existing variable in my data set called (ID_orginal). where my new (ID_new) is to be the exact same of the old variable value except that its values are contained between two square Brackets [as shown in bold], and combined with the (ID_1) variable value.
Here is an example of my data, I created this part manually in excel but could not figure how to do it in stata to run it for my entire data set:
ID_1 | ID_orginal | ID_new |
31010011 | 2 | 31010011[2] |
11020051 | 7 | 11020051[7] |
81030016 | 1 | 81030016[1] |
19040016 | 2 | 19040016[2] |
thank you
Comment