Announcement

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

  • #16
    Here you go.

    Code:
    replace PHONETYPE = "ZZZ" if PHONETYPE==""
    sort  CASENUM (PHONETYPE)
    bys CASENUM: g id_n = _n
    egen cid = group(CASENUM)
    reshape wide PHONETYPE PHONENUMBER, i(cid) j(id_n)
    order CASENUM, before(cid)
    forv i = 2/4 {
        replace PHONETYPE`i' = "" if PHONETYPE`i'!="Cell"
        replace PHONENUMBER`i' = . if PHONETYPE`i'!="Cell"
    }

    Comment


    • #17
      Originally posted by George Ford View Post
      I wonder if reshape might do this more directly. I'll try it.
      Sorry to bother you but I was wondering if you maybe had come up with a solution?

      Comment


      • #18
        Did you try Post #16

        Comment

        Working...
        X