Announcement

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

  • How to create a new variable

    Dear all,

    I actually have a character variable contains information about the position of executives like COE, Chairman, General manager, president, so on.
    HTML Code:
    [CODE]
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str282 specificposition
    "Executive Vice President"           
    "Executive Vice President"           
    "Secretary of Party Committee"       
    "Secretary of Party Committee"       
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Backbone"                           
    "Backbone"                           
    "Chairman of the Board of Directors" 
    "Chairman of the Board of Directors" 
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "President"                          
    "President"                          
    "Executive Vice President"           
    "Executive Vice President"           
    "Chairman of Employee Committee"     
    "Chairman of Employee Committee"     
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Core Personnel"                     
    "Secretary of the Board of Directors"
    "Chairman of the Board of Directors" 
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "President"                          
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Core Personnel"                     
    "Core Personnel"                     
    "Core Personnel"                     
    "Secretary of the Board of Directors"
    "Secretary of the Board of Directors"
    "Secretary of the Board of Directors"
    "Chairman of the Board of Directors" 
    "Chairman of the Board of Directors" 
    "Chairman of the Board of Directors" 
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "President"                          
    "President"                          
    "President"                          
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Core Personnel"                     
    "Secretary of the Board of Directors"
    "Chairman of the Board of Directors" 
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "President"                          
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    "Executive Vice President"           
    end
    [/CODE]
    As you know that the CEO position has different term in different firms or industries. So, I need to create a variable coded 1 if the character variable mentioned contains "General manager or CEO".
    I don't know how to do it.

    Best,

  • #2
    Code:
    gen wanted = specificposition == "General manager" | specificposition == "CEO"

    Comment


    • #3
      Originally posted by Øyvind Snilsberg View Post
      Code:
      gen wanted = specificposition == "General manager" | specificposition == "CEO"
      Thank you so much

      Comment

      Working...
      X