Hi. I have two datasets both with string variables. The first one has a variable CountryName with names of countries for each observation. The second has a variable EventDetails which has mentions of countries along with other information for each observation. From the string for each observation in EventDetails in the second dataset, I want to parse out the country name only if it was in the variable CountryName in the first dataset. Merging the two datasets is not an option here for multiple reasons. Is there anyway for me to use the commands levelsof, locals and a loop to do this across datasets? Or possibly any other way to do this other than making a list of all the country names under the CountryName variable from the first dataset?
Thank you.
Related Posts with Levelsof, local and loops across datasets
learning Stata's postestimation toolsHi Statalist I recently watched Kristin MacDonald's webinar 'Stata Tips and Tricks' and there was a…
Measures to compare distributions and the Probability-Probability-PlotHi Statalisters, I want to compare the distributional fit of predicted values with the original dat…
Overlay corrtable and graph matrixDear all, I wonder if there is an easy way to draw a graph by overlaying the output from graph matr…
Adding a list of variables to each observationHow do I add a list of variables from a “using” file to every observation (for a list of entities) i…
new var calculated from group means of survey dataGreetings, I working on Stata 15 with survey data using pweights. I have created the bar graph belo…
Subscribe to:
Post Comments (Atom)
0 Response to Levelsof, local and loops across datasets
Post a Comment