Announcement

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

  • #16
    Originally posted by Jorrit Gosens View Post
    This works, also with repeated id values
    Code:
    clear
    input float(id otherid)
    101 102
    102 104
    103 101
    103 102
    end
    gen n=_n
    rename (id otherid) (idorig idother)
    reshape long id, i(n) j(idtype) string
    egen newid = group(id)
    reshape wide id newid, i(n) j(idtype) string
    This works perfectly fine and is, in my opinion, the most elegant solution to my issue. Thank you all!

    Comment

    Working...
    X