Announcement

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

  • replacing a value of a variable with a selfmade value (name) using strmatch if (or another command)


    Code:
      
        gen University=. replace University=Harvard University if strmatch(Degree,"*Harvard*")
    Harvard not found
    r(111);


    Harvard University is a selfmade name, it's not the name of a variable

    I have a variable called Degree containing string values like Harvardgraduated, Harvard school, Harvard college
    I want to rename those different kind of names with 1 universal name (e.g. Harvard University) that describes them. Based on : http://satscores.us/

    The website contains a list of all the US universities like Harvard University, Yale University
    It's okay if I need to make 150 commands, 1 command for each university
    My dataset contains 753,594 observations, so I cannot do this without a good command to replace my different university names for universal names

    If i'm able to do so, I can link/merge the listed corresponding SAT scores of those universities with my dataset

    By the way, how can someone delete a topic?

  • #2
    Duplicate post. You already got an answer:
    http://www.statalist.org/forums/foru...he-dataset-yet

    Comment

    Working...
    X