Announcement

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

  • Adding string variables together

    Hi,

    I am dealing w panel data and have a string variable (rating) that takes on let's say the values A B C D E. I want to recode these values so that I have A B E, where B = B + C + D. So, if the rating takes on the value B, C, or D, it will now be coded as B. Is this possible at all?


    Thanks,

    Sandra

  • #2
    Code:
    replace rating = "B" if inlist(rating, "C", "D")
    See

    Code:
    help inlist()

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      Code:
      replace rating = "B" if inlist(rating, "C", "D")
      See

      Code:
      help inlist()
      Thank you so much!

      Comment

      Working...
      X