Hi,
I have two queries regarding the following string variables in my database:
1. String Variable #1: Location of Export (- this variable contains values such as Singapore, US, India, Ghana etc.)
I have created a separate mapping file that maps individual countries to regions (eg. Singapore = Asia, US = North America, India = Asia, Ghana = Africa etc.)
I was wondering if there is any elegant way for me to replace the country names in "Location of Export" with the corresponding regions.
2. String Variable #2: Export Share (- this variable contains the absolute amount in USD million and the % share eg. 132.8 (54.0%))
Is there any way for me to extract only 54.0 from the above variable. I do not need the rest since I am working with only the % exports.
Thanks very much.
Related Posts with String variable related commands
How to get rid of unwanted characters based on a varying pattern?If I have the following string variable with these entries: median_age_____ median_age_group1__ med…
how to generate variables contaning distinct values of other varaibles?For example, accordging to expDomain1 to expDomain4, I want to generate var6, which includes the dis…
Country-Industry pair correlation as a variableDear all, I am new to Statalist, and this is my first post. Thank you in advance for your support an…
how to add*observations at the end of the observations for existing variables?When name and year exist, I cannot use the command below because it says variables already exist. ho…
I want to duplicate values of a variable for the same identifierHello, I am working with a dataset that has households' IDs matched with individuals' IDs, so that …
Subscribe to:
Post Comments (Atom)
0 Response to String variable related commands
Post a Comment