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?
Error with clchi2 (clustered chi-squared test) commandHello, I am trying to assess the relationship between two categorical variables in a clustered data…
Catplot - plotting subcategories or subgroups along with main categoriesDear Statalisters I am using STATA 14.2 with the user written program catplot (ssc install catplot)…
npregress series: R2 value not availableHello everyone, I am using Stata 17, and trying out the example from the npregress series manual. .…
Which count model to use?I have a dependent variable that ranges from 0-11, and it's the number of Covid-19 precautions the r…
Combining regression results and then test for significanceHi Statalists, I have run a lot of regressions in this format: y1 = a1 + b1x1 + b2x2 + e y2 = a2 + …
Subscribe to:
Post Comments (Atom)
0 Response to How to label data by keywords using shortcuts?
Post a Comment