Dear All, II find this question here (https://bbs.pinggu.org/forum.php?mod...=1#pid58387315). The data set is
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double(patid clmid) str10 fst_dt str30(diag1 diag2 diag3 diag4 diag5 diag6 diag7 diag8)
33003282913  147531993 "2018-09-17" "I739" "I2111" "Z955"  "I10"   "I2510" "" "" ""
33003283151 4962568716 "2018-08-06" "I480" "I2510" "I2102" "I10"   "E782"  "" "" ""
33003284508 4959930691 "2018-08-29" "I10"  "I214"  "R079"  "R9431" ""      "" "" ""
33003284508 4960456903 "2018-08-25" ""     ""      ""      ""      "I2510" "" "" ""
33003284508 4960456903 "2018-08-25" ""     "I10"   ""      "R0602" ""      "" "" ""
33003284508 4960456903 "2018-08-25" "I214" ""      "R9431" ""      ""      "" "" ""
33003284508 4966580498 "2018-09-12" "I10"  "I214"  ""      ""      ""      "" "" ""
end
As you can see, `patid', `clmid', and `fst_dt' are the same for observations 4,5,6. I'd like to collapse them into one row. Any suggestions? Thanks.