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
Splitting Multiple Response VariableI have a multiple response variable that may take any combination of responses between 1 to 5 and 97…
How to convert a scalar value into a large matrixSay I have a value of 2 How can I convert this into say a [50,1] matrix such that it is the same si…
syntax: add a minus before a list of variablesDear Stata users, I want to make a convenient wrapper using gsort command. My question is how to ad…
Outreg2 and other issues with xtprobitHi all, I have a few questions regarding my code below: 1- Using Code: xtset dep time gives me th…
xtivreg2 with time fixed effectsHello I want to find the causal effect of the number of new electric vehicles on the number of char…
Subscribe to:
Post Comments (Atom)
0 Response to String variable related commands
Post a Comment