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 construct a 'reputation' variable?Hi, I have a dataset on compliance actions and penalties for violations of an environmental statute…
Help Creating New Variable Equal to the Square of the ResidualsDear all, I am using Stata 16, on mac. I want to create a new variable called resid_sq that is equa…
change spanish letters to englishI have a data set that lists Salvadorian towns, the data has been imputed in Spanish so there are Sp…
Mahapick with foreach loopDear Statalists, I want to find several (5) company matches based on financial data, always for a g…
Time Series merge with ID classificationHello, I am currently trying to connect time series data (with long/lat attributes for each observat…
Subscribe to:
Post Comments (Atom)
0 Response to String variable related commands
Post a Comment