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?
extract letters from wordsDear All, Suppose that I have this data set (with variable "Journal_e": Code: * Example generated b…
Finding sum per row based on conditionsMembers, I have a dataset with multiple columns (var1, var2, var3, etc.) with missing observations.…
Heteroskedasticity - Breusch–Pagan testDear Stata community! I am running the three Breusch–Pagan tests versions most common in Stata (es…
Graph of event study for multiple regressions using eventdd packageUsing the following command and using the data, you can use an event study graph for only one set of…
Correlation between variablesHello Statalists, Please, could anyone help with the correct command? I have two datasets measuring …
Subscribe to:
Post Comments (Atom)
0 Response to How to label data by keywords using shortcuts?
Post a Comment