Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to label data by keywords using shortcuts?

    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.


  • #2
    Provide a data example using dataex showing the exact attributes of your dataset (see FAQ Advice #12 for details). It seems to me that with the datasets in long layout, all you need is a simple merge.

    Comment

    Working...
    X