I am trying to label names to ethics in my dataset A, so far I've collected all the names in my data and containing surnames in such format:
company Names
aaa jacky liu jenny xia
bbb benny chong alice wong
ccc ben chua larry Tse
What I can do is gen ethics = "Cantonese" if strpos(Names,"WONG""TSE"), and so on to generate a new variable to label each company. But I have another dataset B about all the surnames in different ethics. So I want to import that dataset to do it, then I don't need to manually type all the surnames in the strpos. What can I do?
The format of the separate dataset for all the surnames is in this format:
Mandarin Cantonese Hokkien ....
xxx xxx xxx
xxx xxx xxx
xxx xxx xxx
so the xxx represents each surname that may contain in the first dataset A.
Related Posts with How to label data by keywords using shortcuts?
Combining date variables in panel dataDear Stata users, I have panel data, with multiple entries per ID for every day they partook in exe…
ivreg2 exogeneity test vs. biprobit exogeneity test, contradictory resultsHello Stata Listers, I am using Stata 15.1. My dependent variable is nonreceipt of a measles, mumps…
Graph displaying part years and part quarters on the y axis,Hi all, I am trying to create a graph like the one below, but I would like to show one density for 2…
Graph displaying part years and part quarters on the y axisHi all, I am trying to create a graph like the one below, but I would like to show one density for 2…
New version of dtastamp on SSCThanks once again to Kit Baum, a new version of the dtastamp package is now available for download f…
Subscribe to:
Post Comments (Atom)
0 Response to How to label data by keywords using shortcuts?
Post a Comment