Dear Stata users,
I am using Stata 16 and I have country names in a string variable and would like to extract them. Below is an example of data with the original variable and my desired
Thanks in advance!
I am using Stata 16 and I have country names in a string variable and would like to extract them. Below is an example of data with the original variable and my desired
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str47 original str23 new "XXX TRFD (China)" "China" "SGDTE (Uruguay) FGRED BHEGR (New Zealand)" "Uruguay / New Zealand" "GHENDGG (Nigeria)" "Nigeria" "MKGSER (South Africa)" "South Africa" "BHGED (United States) VGDENW (Vietnam) HGDNNEEE" "United States / Vietnam" end
Comment